edfcore 0.4.37 → 0.4.39
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/dist/bytes/view.d.ts.map +1 -1
- package/dist/bytes/view.js +4 -2
- package/dist/bytes/view.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/docs/CHANGELOG.md +11 -0
- package/package.json +1 -1
- package/src/bytes/view.ts +8 -2
- package/src/constants.ts +1 -1
package/dist/bytes/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/bytes/view.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/bytes/view.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA8BH;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAGxF;AAED,qEAAqE;AACrE,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAGvF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAExF"}
|
package/dist/bytes/view.js
CHANGED
|
@@ -15,10 +15,12 @@ import { decodeHeaderLatin1 } from './latin1.js';
|
|
|
15
15
|
*/
|
|
16
16
|
function assertInBounds(bytes, offset, length) {
|
|
17
17
|
if (!Number.isSafeInteger(offset) || offset < 0) {
|
|
18
|
-
throw new RangeError(`byte offset must be a non-negative safe integer, got ${offset}`
|
|
18
|
+
throw new RangeError(`byte offset must be a non-negative safe integer, got ${offset}. Next: report this — the ` +
|
|
19
|
+
'offset is computed by edfcore rather than passed in.');
|
|
19
20
|
}
|
|
20
21
|
if (!Number.isSafeInteger(length) || length < 0) {
|
|
21
|
-
throw new RangeError(`byte length must be a non-negative safe integer, got ${length}`
|
|
22
|
+
throw new RangeError(`byte length must be a non-negative safe integer, got ${length}. Next: report this — the ` +
|
|
23
|
+
'length comes from the header layout, not from the call site.');
|
|
22
24
|
}
|
|
23
25
|
if (offset + length > bytes.length) {
|
|
24
26
|
throw new RangeError(`byte range [${offset}, ${offset + length}) is outside the ${bytes.length}-byte buffer`);
|
package/dist/bytes/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../src/bytes/view.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAAiB,EAAE,MAAc,EAAE,MAAc;IACvE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,UAAU,
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../src/bytes/view.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAAiB,EAAE,MAAc,EAAE,MAAc;IACvE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,UAAU,CAClB,wDAAwD,MAAM,4BAA4B;YACxF,sDAAsD,CACzD,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,UAAU,CAClB,wDAAwD,MAAM,4BAA4B;YACxF,8DAA8D,CACjE,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACnC,MAAM,IAAI,UAAU,CAClB,eAAe,MAAM,KAAK,MAAM,GAAG,MAAM,oBAAoB,KAAK,CAAC,MAAM,cAAc,CACxF,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,KAAiB,EAAE,MAAc,EAAE,MAAc;IAC1E,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AACjD,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,SAAS,CAAC,KAAiB,EAAE,MAAc,EAAE,MAAc;IACzE,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,KAAiB,EAAE,MAAc,EAAE,MAAc;IAC9E,OAAO,kBAAkB,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/D,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -109,5 +109,5 @@ export declare const SIGNAL_FIELD_BLOCK_OFFSETS: {
|
|
|
109
109
|
readonly reserved: 224;
|
|
110
110
|
};
|
|
111
111
|
/** Published package version. Kept in sync with package.json by a test. */
|
|
112
|
-
export declare const VERSION = "0.4.
|
|
112
|
+
export declare const VERSION = "0.4.39";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,17 @@ alone does not tell you whether you were affected.
|
|
|
6
6
|
edfcore is pre-1.0. Patch releases have carried behaviour changes where the old behaviour was a
|
|
7
7
|
defect; those are called out below.
|
|
8
8
|
|
|
9
|
+
## 0.4.39
|
|
10
|
+
|
|
11
|
+
- **Fixed** the byte-length bounds refusal, the sibling of the one 0.4.38 fixed and the second of
|
|
12
|
+
three in `assertInBounds` without a `Next:` clause.
|
|
13
|
+
|
|
14
|
+
## 0.4.38
|
|
15
|
+
|
|
16
|
+
- **Fixed** the byte-offset bounds refusal in `bytes/view.ts` carrying no `Next:` clause. Nothing
|
|
17
|
+
a caller passes reaches it directly — every offset is computed by edfcore — so the useful
|
|
18
|
+
instruction is to report it, which the message now gives.
|
|
19
|
+
|
|
9
20
|
## 0.4.37
|
|
10
21
|
|
|
11
22
|
- **Fixed** the only refusal in `decode/digital.ts` without a `Next:` clause, where the other four
|
package/package.json
CHANGED
package/src/bytes/view.ts
CHANGED
|
@@ -17,10 +17,16 @@ import { decodeHeaderLatin1 } from './latin1.js';
|
|
|
17
17
|
*/
|
|
18
18
|
function assertInBounds(bytes: Uint8Array, offset: number, length: number): void {
|
|
19
19
|
if (!Number.isSafeInteger(offset) || offset < 0) {
|
|
20
|
-
throw new RangeError(
|
|
20
|
+
throw new RangeError(
|
|
21
|
+
`byte offset must be a non-negative safe integer, got ${offset}. Next: report this — the ` +
|
|
22
|
+
'offset is computed by edfcore rather than passed in.',
|
|
23
|
+
);
|
|
21
24
|
}
|
|
22
25
|
if (!Number.isSafeInteger(length) || length < 0) {
|
|
23
|
-
throw new RangeError(
|
|
26
|
+
throw new RangeError(
|
|
27
|
+
`byte length must be a non-negative safe integer, got ${length}. Next: report this — the ` +
|
|
28
|
+
'length comes from the header layout, not from the call site.',
|
|
29
|
+
);
|
|
24
30
|
}
|
|
25
31
|
if (offset + length > bytes.length) {
|
|
26
32
|
throw new RangeError(
|
package/src/constants.ts
CHANGED