edfcore 0.4.422 → 0.4.424

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.
@@ -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.422";
112
+ export declare const VERSION = "0.4.424";
113
113
  //# sourceMappingURL=constants.d.ts.map
package/dist/constants.js CHANGED
@@ -79,5 +79,5 @@ export const SIGNAL_FIELD_BLOCK_OFFSETS = {
79
79
  reserved: 224,
80
80
  };
81
81
  /** Published package version. Kept in sync with package.json by a test. */
82
- export const VERSION = '0.4.422';
82
+ export const VERSION = '0.4.424';
83
83
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../src/io/bytes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,aAAa,CAAC;AAkC3D;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAoCtE"}
1
+ {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../src/io/bytes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,aAAa,CAAC;AAoC3D;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAoCtE"}
package/dist/io/bytes.js CHANGED
@@ -11,6 +11,13 @@ import { assertExactRead, assertReadRange, isByteArray, throwIfAborted } from '.
11
11
  /**
12
12
  * Describes what arrived, for an argument that is not bytes. Never prints the value: it could be
13
13
  * anything, including something large.
14
+ *
15
+ * No `ArrayBuffer` or `SharedArrayBuffer` branch, and there cannot usefully be one: this is called
16
+ * on the throw path alone, which `byteSource` reaches only when the SAME `BUFFER_TAGS` test has
17
+ * already answered no. A branch here carried one for a while — added when a refusal called them
18
+ * "a plain object" — and it stopped being reachable once the acceptance check was widened to the
19
+ * tags in 0.3.20. Removed in 0.4.423, along with the comment claiming it prevented a message
20
+ * nothing can produce.
14
21
  */
15
22
  function describe(value) {
16
23
  if (value === null)
@@ -21,11 +28,6 @@ function describe(value) {
21
28
  return Object.prototype.toString.call(value).slice(8, -1);
22
29
  if (Array.isArray(value))
23
30
  return 'a plain Array';
24
- // Buffers are named too. Without this a refusal called them "a plain object", which sent the
25
- // reader looking for the wrong problem entirely.
26
- if (BUFFER_TAGS.has(Object.prototype.toString.call(value))) {
27
- return Object.prototype.toString.call(value).slice(8, -1);
28
- }
29
31
  return typeof value === 'object' ? 'a plain object' : `a ${typeof value}`;
30
32
  }
31
33
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../src/io/bytes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE5F;;;GAGG;AACH,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAC5C,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,eAAe,CAAC;IACjD,6FAA6F;IAC7F,iDAAiD;IACjD,IAAI,WAAW,CAAC,GAAG,C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one 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.424
10
+
11
+ - **Added** a property test that reading a stretch in pieces and joining them is reading it whole.
12
+ That is the promise `mergeChunks` exists to make, and it is what lets a caller bound memory
13
+ without changing an answer. `merge-chunks.test.ts` demonstrated it on one split of one file, and
14
+ every check around it is about a merge that must be refused — the thing that has to hold for
15
+ every split of every file was shown for one.
16
+ - The failure it guards is silent and arithmetic. A merge that dropped the last sample of each
17
+ piece, or summed the wrong bytes, returns an array of the length a caller expects, holding real
18
+ samples from the real file, shifted. Nothing downstream can tell: the timestamps come from the
19
+ record range, which is right, and the values are plausible because they came from the recording.
20
+ It surfaces as an event marked half a second late, weeks later, in someone else's analysis. So
21
+ the bookkeeping is checked alongside the samples — `records`, `byteLength` and the chunk's own
22
+ start in ticks are all quantities a caller reads off the result.
23
+ - **Removed** an unreachable branch from `byteSource`'s argument description, and the comment
24
+ claiming it prevented a message nothing can produce. It named an `ArrayBuffer` or a
25
+ `SharedArrayBuffer` in a refusal — but the description is built on the throw path alone, which is
26
+ reached only when the same `BUFFER_TAGS` test has already answered no.
27
+ - It was reachable once. The branch was added when a refusal called those buffers "a plain
28
+ object", and it stopped being reachable in 0.3.20, when the acceptance check was widened from
29
+ `instanceof` to the same tags. Nothing noticed, because dead code that agrees with the code
30
+ around it reads as thoroughness.
31
+ - `BUFFER_TAGS` itself stays: it is what accepts a buffer from another realm, which 0.4.422 now
32
+ exercises through `node:vm`.
33
+
34
+ ## 0.4.423
35
+
36
+ Never released. The release run bumped the version, passed its own checks and pushed, and CI then
37
+ failed all three Node jobs on formatting: a test file written after `npm run format` had run was
38
+ swept into the commit by `git add -A` unformatted. Nothing was tagged and nothing went to npm, but
39
+ the bump was already public, which consumed the number. The same failure as `0.4.176`, arriving
40
+ from the other side — there the local check caught it after the bump, here the local check never
41
+ saw the file. The work that carried this heading shipped in `0.4.424`.
42
+
9
43
  ## 0.4.422
10
44
 
11
45
  - **Added** tests for what `byteSource` accepts and what it says about everything else. It is the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.4.422",
3
+ "version": "0.4.424",
4
4
  "description": "Modern, typed, zero-dependency reader for EDF, EDF+, BDF and BDF+ biosignal files. Works in browsers and Node with true random access.",
5
5
  "keywords": [
6
6
  "edf",
package/src/constants.ts CHANGED
@@ -93,4 +93,4 @@ export const SIGNAL_FIELD_BLOCK_OFFSETS = {
93
93
  } as const;
94
94
 
95
95
  /** Published package version. Kept in sync with package.json by a test. */
96
- export const VERSION = '0.4.422';
96
+ export const VERSION = '0.4.424';
package/src/io/bytes.ts CHANGED
@@ -14,17 +14,19 @@ import { assertExactRead, assertReadRange, isByteArray, throwIfAborted } from '.
14
14
  /**
15
15
  * Describes what arrived, for an argument that is not bytes. Never prints the value: it could be
16
16
  * anything, including something large.
17
+ *
18
+ * No `ArrayBuffer` or `SharedArrayBuffer` branch, and there cannot usefully be one: this is called
19
+ * on the throw path alone, which `byteSource` reaches only when the SAME `BUFFER_TAGS` test has
20
+ * already answered no. A branch here carried one for a while — added when a refusal called them
21
+ * "a plain object" — and it stopped being reachable once the acceptance check was widened to the
22
+ * tags in 0.3.20. Removed in 0.4.423, along with the comment claiming it prevented a message
23
+ * nothing can produce.
17
24
  */
18
25
  function describe(value: unknown): string {
19
26
  if (value === null) return 'null';
20
27
  if (value === undefined) return 'undefined';
21
28
  if (ArrayBuffer.isView(value)) return Object.prototype.toString.call(value).slice(8, -1);
22
29
  if (Array.isArray(value)) return 'a plain Array';
23
- // Buffers are named too. Without this a refusal called them "a plain object", which sent the
24
- // reader looking for the wrong problem entirely.
25
- if (BUFFER_TAGS.has(Object.prototype.toString.call(value))) {
26
- return Object.prototype.toString.call(value).slice(8, -1);
27
- }
28
30
  return typeof value === 'object' ? 'a plain object' : `a ${typeof value}`;
29
31
  }
30
32