edfcore 0.5.50 → 0.5.52

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.5.50";
112
+ export declare const VERSION = "0.5.52";
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.5.50';
82
+ export const VERSION = '0.5.52';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,53 @@ 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.5.52
10
+
11
+ - **Added** the sweep for a selection that came from JSON. `io/read.ts` says why this is not a
12
+ type-system question: "`records` is typed, and the type is not the only way in: a selection built
13
+ from JSON, from a config file or from a JavaScript call site arrives at run time." It then records
14
+ what used to happen — every wrong shape reached a refusal with a next step, "while `undefined` and
15
+ `null` threw `TypeError: Cannot read properties of undefined (reading 'start')` ... which names
16
+ neither the option nor anything to do about it" (fixed in 0.4.443).
17
+ - That is a whole class and it had one test. A saved view, a URL parameter, a job on a queue: all of
18
+ them arrive as `JSON.parse` output, where a number written as a string stays a string and an
19
+ omitted field is simply absent. `record-range-contract.test.ts` covers ranges that are well formed
20
+ and out of bounds; this covers ranges that are not ranges.
21
+ - Nine malformed `records` shapes — absent, null, empty, half-filled, an array, a string,
22
+ string-valued fields, a null field — are each refused at all three entry points with an
23
+ `EdfRangeError` carrying the same next step, and absent and null are asserted not to raise the
24
+ `TypeError` they once did. A valid range survives a JSON round-trip, extra properties and all.
25
+ - Four malformed `signalIndices` shapes are a plain `RangeError`, since a selection that is not an
26
+ array is a caller's mistake and not a file's.
27
+ - One shape is accepted, and it is named rather than left to be discovered: an array holding the
28
+ canonical decimal string for an index — `['0']`, which is what `JSON.parse('["0"]')` from a query
29
+ string gives — resolves to that signal. It is ordinary array-index coercion and it is tight:
30
+ `'00'`, `' 0'`, `'0.0'`, `'+0'` and a label are each an `EdfChannelNotFoundError` naming the
31
+ selector verbatim, and the chunk reports `signalIndex` as a number, so nothing downstream carries
32
+ the string.
33
+
34
+ ## 0.5.51
35
+
36
+ - **Added** the promise `annotations.md` makes about partial reads, and the thing it costs.
37
+ `readAnnotations` "supplies the rebasing origin from the timeline, so a partial range answers the
38
+ same as a whole-file one" — and could not derive that origin on its own, because "a range that
39
+ does not contain record 0 has to infer it from an observed onset, which only works while the
40
+ records in between are contiguous". Before 0.2.28 the pairing the page recommends,
41
+ `readAnnotations(recording, chunk.records)`, reported the same event a quarter of a second later
42
+ than a whole-file decode did.
43
+ - Three behaviours, one of them a defect that shipped, and none under test: `readAnnotations` was
44
+ checked on whole files and on single ranges, and nothing partitioned a file and compared.
45
+ - The property runs first. For any partition of the record range into contiguous pieces, the reads
46
+ concatenate to the whole-file read — every field of every event, both axes, both exact tick counts
47
+ and `recordOnsetTicks` — over a contiguous file, one with a quarter-second start offset, and an
48
+ EDF+D file with a twenty-second hole.
49
+ - Then the three-way comparison that shows the origin doing the work, on the post-gap range of that
50
+ EDF+D file. `readAnnotations` puts the event at 26.5 s on the record axis. `decodeAnnotations`
51
+ called directly on the same bytes puts it at 26.75 — its inferred origin lands outside `[0, 1)`,
52
+ so rebasing switches off and the two axes come back equal, exactly as documented. Passing
53
+ `startOffsetTicks` by hand restores 26.5. And on the same shape without the hole the inference
54
+ works unaided, which is what makes the failure about EDF+D rather than about partial ranges.
55
+
9
56
  ## 0.5.50
10
57
 
11
58
  - **Added** three ways a header can be written and mean the same thing. Each is documented, each is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.5.50",
3
+ "version": "0.5.52",
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.5.50';
96
+ export const VERSION = '0.5.52';