edfcore 0.5.27 → 0.5.29

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.27";
112
+ export declare const VERSION = "0.5.29";
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.27';
82
+ export const VERSION = '0.5.29';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,55 @@ 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.29
10
+
11
+ - **Added** the contract `signalIndices` has to keep at all five reads that take one.
12
+ `duplicate-signal-indices.test.ts` covers two of the rules `api-reading.md` states — duplicates are
13
+ dropped, the order given is the order returned — over `readRecords`, `readWindow` and
14
+ `streamRecords`. It does not reach the two envelope entry points, and nothing covered what the
15
+ option does when it is wrong.
16
+ - The refusals are the part worth pinning, because there are two of them and they are deliberately
17
+ different classes. An index the file does not have is an `EdfChannelNotFoundError`, an `EdfError`
18
+ carrying `selector` and `availableLabels` so a caller can offer the right one. An index naming the
19
+ annotations channel is a plain `RangeError`, because it can only be a caller's mistake and never a
20
+ file's — the bytes there are TAL text, and decoding them as samples produces numbers that look
21
+ exactly like a signal. `isEdfError` is the split, and a caller writing one `catch` for bad files
22
+ and another for bad calls depends on it holding at every entry point rather than at the one they
23
+ tested against.
24
+ - There is no reason for five functions to diverge — they share `resolveSignals` — which is exactly
25
+ why it is worth a test: a sixth entry point, or one that grows its own validation to report
26
+ something friendlier, is how a shared rule stops being one. All nine functions in `src/` that take
27
+ a `signalIndices` are enumerated by resolving their parameter types, and split into the five under
28
+ test, the two shared helpers, and the two annotation reads whose `signalIndices` selects annotation
29
+ signals and inverts both rules.
30
+ - Nine cases run at every one of the five: out of range, negative, fractional, the annotations
31
+ channel alone and mixed with a real signal, a repeat, a repeat out of order, a reversal, and an
32
+ empty selection — which returns no signals rather than all of them.
33
+
34
+ ## 0.5.28
35
+
36
+ - **Added** an already-aborted signal driven through every entry point that takes one.
37
+ `api-sources.md` says edfcore "polls `.aborted` before and after each read and throws an `Error`
38
+ whose `name` is `'AbortError'`"; `data-sources.md` adds that every bundled adapter checks it
39
+ before it starts, and that the rejection "is a plain `Error` ... not an `EdfError`.
40
+ `isEdfError` returns false for it, so a `catch` that re-throws aborts stays simple."
41
+ - `http-abort-signal.test.ts` covers the adapter with the most to go wrong. What nothing covered is
42
+ the sentence's scope. The guard lives in the SOURCES, and every reading function reaches it only
43
+ by issuing a read — so whether each of them actually does, before allocating, before scanning,
44
+ before decoding, is a property of thirteen call paths rather than of the four adapters. A function
45
+ that resolved its window or sized its buffer first would do that work for a caller who had already
46
+ cancelled.
47
+ - All thirteen are now driven, and each must reject with `name === 'AbortError'` and `isEdfError`
48
+ false — the discriminator the page says consumers branch on, chosen because `DOMException` cannot
49
+ be named without the DOM lib. The four adapters are driven directly alongside them, and each is
50
+ also shown to read normally when the signal is simply not aborted.
51
+ - The one place it does not fire is checked with them, because it is documented rather than
52
+ accidental: `api-reading.md` says a record range with `count: 0` "issues no read at all", and a
53
+ call that reads nothing has nothing to abort.
54
+ - The last block is the other half of `ReadOptions`' own docblock — "cancelling a read and capping an
55
+ allocation never alter what a completed call returns". A signal that is never aborted leaves every
56
+ result identical to one passed no options at all.
57
+
9
58
  ## 0.5.27
10
59
 
11
60
  - **Added** a non-finite bound driven through every entry point that takes a time in seconds.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.5.27",
3
+ "version": "0.5.29",
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.27';
96
+ export const VERSION = '0.5.29';