typed-array-byte-offset 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/index.d.ts +10 -13
- package/index.js +6 -4
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [v1.0.4](https://github.com/inspect-js/typed-array-byte-offset/compare/v1.0.3...v1.0.4) - 2024-12-18
|
|
9
|
+
|
|
10
|
+
### Commits
|
|
11
|
+
|
|
12
|
+
- [Tests] split out and enhance "no-proto" tests [`64d1a73`](https://github.com/inspect-js/typed-array-byte-offset/commit/64d1a73a0a7f20484ee817c4a6758121887e30d3)
|
|
13
|
+
- [types] improve types [`21f484f`](https://github.com/inspect-js/typed-array-byte-offset/commit/21f484f55f9c6e3406b5eacbc937aa2e195da731)
|
|
14
|
+
- [Tests] add `--disable-proto=delete` tests [`8f77f2a`](https://github.com/inspect-js/typed-array-byte-offset/commit/8f77f2af48e1522aae10e0429810907df9f9f6fc)
|
|
15
|
+
- [actions] re-add a finisher; add perms [`59c1b7b`](https://github.com/inspect-js/typed-array-byte-offset/commit/59c1b7bfab826bceb43441c60affb1c1ad4e6cc7)
|
|
16
|
+
- [Deps] update `call-bind`, `gopd`, `has-proto`, `reflect.getprototypeof` [`c0c30d5`](https://github.com/inspect-js/typed-array-byte-offset/commit/c0c30d57642858c8327b3d90b6104ccbb459d71a)
|
|
17
|
+
- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape` [`2638bd5`](https://github.com/inspect-js/typed-array-byte-offset/commit/2638bd5d7000e6d902414aeac88c00a148f5b152)
|
|
18
|
+
- [Deps] update `is-typed-array`, `reflect.getprototypeof` [`11540a5`](https://github.com/inspect-js/typed-array-byte-offset/commit/11540a577044442ce42d684d00d4686d7613bed4)
|
|
19
|
+
- [Deps] update `is-typed-array` [`ad9cb70`](https://github.com/inspect-js/typed-array-byte-offset/commit/ad9cb70bcc09eaf535c24ce24a00716058833d64)
|
|
20
|
+
- [Dev Deps] update `@types/tape` [`2838854`](https://github.com/inspect-js/typed-array-byte-offset/commit/2838854db6053003b0818a337f1e2f95ab383bce)
|
|
21
|
+
|
|
8
22
|
## [v1.0.3](https://github.com/inspect-js/typed-array-byte-offset/compare/v1.0.2...v1.0.3) - 2024-11-21
|
|
9
23
|
|
|
10
24
|
### Fixed
|
package/index.d.ts
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
| Int8Array
|
|
3
|
-
| Uint8Array
|
|
4
|
-
| Uint8ClampedArray
|
|
5
|
-
| Int16Array
|
|
6
|
-
| Uint16Array
|
|
7
|
-
| Int32Array
|
|
8
|
-
| Uint32Array
|
|
9
|
-
| Float32Array
|
|
10
|
-
| Float64Array
|
|
11
|
-
| BigInt64Array
|
|
12
|
-
| BigUint64Array;
|
|
1
|
+
import TypedArrayNames from 'possible-typed-array-names';
|
|
13
2
|
|
|
14
|
-
declare
|
|
3
|
+
declare namespace typedArrayByteOffset {
|
|
4
|
+
export type TypedArrayName = typeof TypedArrayNames[number];
|
|
5
|
+
|
|
6
|
+
export type TypedArrayConstructor = typeof globalThis[TypedArrayName];
|
|
7
|
+
|
|
8
|
+
export type TypedArray = TypedArrayConstructor['prototype'];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare function typedArrayByteOffset(value: typedArrayByteOffset.TypedArray): number;
|
|
15
12
|
declare function typedArrayByteOffset(value: unknown): false;
|
|
16
13
|
|
|
17
14
|
export = typedArrayByteOffset;
|
package/index.js
CHANGED
|
@@ -6,11 +6,13 @@ var gPO = require('reflect.getprototypeof/polyfill')();
|
|
|
6
6
|
|
|
7
7
|
var typedArrays = require('available-typed-arrays')();
|
|
8
8
|
|
|
9
|
-
/** @typedef {
|
|
10
|
-
/** @typedef {(x: TypedArray) => number} ByteOffsetGetter */
|
|
9
|
+
/** @typedef {(x: import('.').TypedArray) => number} ByteOffsetGetter */
|
|
11
10
|
|
|
12
|
-
/** @type {
|
|
13
|
-
var getters = {
|
|
11
|
+
/** @type {Record<import('.').TypedArrayName, ByteOffsetGetter>} */
|
|
12
|
+
var getters = {
|
|
13
|
+
// @ts-expect-error TS can't handle __proto__ or `satisfies` in jsdoc
|
|
14
|
+
__proto__: null
|
|
15
|
+
};
|
|
14
16
|
|
|
15
17
|
var gOPD = require('gopd');
|
|
16
18
|
var oDP = Object.defineProperty;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typed-array-byte-offset",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Robustly get the byte offset of a Typed Array",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -58,17 +58,17 @@
|
|
|
58
58
|
"homepage": "https://github.com/inspect-js/typed-array-byte-offset#readme",
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"available-typed-arrays": "^1.0.7",
|
|
61
|
-
"call-bind": "^1.0.
|
|
61
|
+
"call-bind": "^1.0.8",
|
|
62
62
|
"for-each": "^0.3.3",
|
|
63
|
-
"gopd": "^1.0
|
|
64
|
-
"has-proto": "^1.0
|
|
65
|
-
"is-typed-array": "^1.1.
|
|
66
|
-
"reflect.getprototypeof": "^1.0.
|
|
63
|
+
"gopd": "^1.2.0",
|
|
64
|
+
"has-proto": "^1.2.0",
|
|
65
|
+
"is-typed-array": "^1.1.15",
|
|
66
|
+
"reflect.getprototypeof": "^1.0.9"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@arethetypeswrong/cli": "^0.17.
|
|
69
|
+
"@arethetypeswrong/cli": "^0.17.1",
|
|
70
70
|
"@ljharb/eslint-config": "^21.1.1",
|
|
71
|
-
"@ljharb/tsconfig": "^0.2.
|
|
71
|
+
"@ljharb/tsconfig": "^0.2.2",
|
|
72
72
|
"@types/call-bind": "^1.0.5",
|
|
73
73
|
"@types/es-abstract": "^1.17.9",
|
|
74
74
|
"@types/for-each": "^0.3.3",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@types/make-arrow-function": "^1.2.2",
|
|
78
78
|
"@types/make-generator-function": "^2.0.3",
|
|
79
79
|
"@types/object-inspect": "^1.13.0",
|
|
80
|
-
"@types/tape": "^5.
|
|
80
|
+
"@types/tape": "^5.8.0",
|
|
81
81
|
"auto-changelog": "^2.5.0",
|
|
82
82
|
"eslint": "=8.8.0",
|
|
83
83
|
"evalmd": "^0.0.19",
|