edfcore 0.5.34 → 0.5.36

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.34";
112
+ export declare const VERSION = "0.5.36";
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.34';
82
+ export const VERSION = '0.5.36';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,57 @@ 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.36
10
+
11
+ - **Added** the `ByteSource` `data-sources.md` tells you to write, written and read through. "Writing
12
+ your own ByteSource" is the section that makes the interface a promise rather than an
13
+ implementation detail — "the whole job is: know the length, return exactly the bytes asked for, and
14
+ reject otherwise" — and it prints a complete forty-line adapter over a range-returning object
15
+ store, with four rules under it "in order of how badly they bite". None of it was run.
16
+ `source-contract.test.ts` covers the contract from edfcore's side, with sources written for the
17
+ test; the adapter a reader would copy had nothing.
18
+ - It is now transcribed and used: a recording is opened over it, a window is read, and the samples
19
+ are compared against the same file through `byteSource`. The store streams in irregular pieces —
20
+ 7, 1, 4096, 3 — which is the whole reason the adapter has a loop, and a test that returned each
21
+ range in one go would never reach it. That is asserted too: no single piece the store hands back
22
+ is a whole read.
23
+ - Each of the four rules is then broken on purpose, in an adapter of its own. A short return is
24
+ caught by the adapter, which can name the key and the range, and by edfcore anyway for a source
25
+ that does not check. A padded one is the dangerous case: on a plain EDF every sample of every
26
+ record comes back as a legal zero with no diagnostic at all, and only the annotation region of an
27
+ EDF+ notices, with `TIMEKEEPING_TAL_MISSING`. A reused buffer is shown corrupting an array a
28
+ caller had already been handed, which the page's own per-read allocation does not.
29
+ - The fourth is the page's Warning, and it is the one worth having under test: "edfcore itself does
30
+ not poll the signal between reads. A custom `ByteSource` that ignores `options.signal` makes
31
+ cancellation a complete no-op, including for a long `validateRecording` sweep that issues hundreds
32
+ of reads." A whole-file sweep and a chunked index traversal both run to completion over an
33
+ already-aborted signal, serving twenty reads after the abort. A stated limitation nobody checks is
34
+ indistinguishable from a bug.
35
+
36
+ ## 0.5.35
37
+
38
+ - **Added** the resolution of every name a `Next:` clause points at. `next-clause.test.ts` proves
39
+ every thrown message and every diagnostic has one; 0.5.34 follows the eight whose advice is a
40
+ concrete instruction. This is the mechanical half between them: of the 166 clauses in `src/`, most
41
+ name something — a function to call instead, an option to raise, a field to read — and a name that
42
+ no longer exists is how this rots. Nothing renames a public export without noticing, but a message
43
+ is a string, so a clause mentioning one is not a reference and no compiler follows it.
44
+ - Three kinds of name, each checked against the thing it would have to be true of. A bare
45
+ `something()` must be exported from one of the three entry points, or be a method on a value
46
+ edfcore hands back — `locate` on the index and `read` on a source are the two clauses that name a
47
+ method rather than an export, and both are resolved on the real object. An `options.something`
48
+ must be a field some options type declares; the two misdiagnoses `options.ts` records were both of
49
+ that shape, a message naming a lever the caller does not hold. A `header.something`,
50
+ `signal.something` or `index.something` must exist on a recording opened from a fixture, checked
51
+ with `in` rather than against a type: a field that is declared and never populated would satisfy a
52
+ type check and still leave the reader looking for something that is not there.
53
+ - The extraction is narrow about what counts as advice, and says so. Comments are stripped first, so
54
+ a helper mentioned in a note beside a message is not mistaken for a name the message uses.
55
+ `${...}` interpolations are stripped too — `Next: ${adapterFor(source)}` names no function to the
56
+ reader, since the function is how the sentence was built rather than what it says. And the capture
57
+ crosses the `'…' + '…'` seams a long clause is written in, because stopping at the first would
58
+ read half of every one of them, and the half that names the field is usually the second.
59
+
9
60
  ## 0.5.34
10
61
 
11
62
  - **Added** the `Next:` clause, followed. Every message edfcore throws ends with one, and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.5.34",
3
+ "version": "0.5.36",
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.34';
96
+ export const VERSION = '0.5.36';