edfcore 0.6.207 → 0.6.209

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.
@@ -1 +1 @@
1
- {"version":3,"file":"annotations-query.d.ts","sourceRoot":"","sources":["../src/annotations-query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAwBrE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,MAAM,EAAE,mBAAmB,GAC1B,SAAS,aAAa,EAAE,CAwD1B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GACnD,SAAS,aAAa,EAAE,CAiB1B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,SAAS,aAAa,EAAE,GACpC,aAAa,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CASlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,OAAO,EAAE,MAAM,GACd,SAAS,aAAa,EAAE,CAU1B"}
1
+ {"version":3,"file":"annotations-query.d.ts","sourceRoot":"","sources":["../src/annotations-query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAmDrE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,MAAM,EAAE,mBAAmB,GAC1B,SAAS,aAAa,EAAE,CAwD1B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GACnD,SAAS,aAAa,EAAE,CAiB1B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,SAAS,aAAa,EAAE,GACpC,aAAa,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CASlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,OAAO,EAAE,MAAM,GACd,SAAS,aAAa,EAAE,CAU1B"}
@@ -35,11 +35,36 @@ import { describeValue } from './text/describe.js';
35
35
  * 0.6.107).
36
36
  */
37
37
  function assertAnnotations(annotations, call) {
38
- if (Array.isArray(annotations))
38
+ if (!Array.isArray(annotations)) {
39
+ throw new RangeError(`${call}(): the annotations are ${describeValue(annotations)}, not an array. Next: pass the ` +
40
+ '`annotations` field of what readAnnotations(recording, records) resolved to, which is a ' +
41
+ 'result object rather than the list itself.');
42
+ }
43
+ /*
44
+ * And the ELEMENTS, which being an array says nothing about.
45
+ *
46
+ * The three printers closed this one at a time — `formatDiagnostics` in 0.6.160,
47
+ * `summarizeDiagnostics` in 0.6.168, `formatAnnotations` in 0.6.185 — and these four QUERIES share
48
+ * a guard that still stopped at `Array.isArray`. Three of the four then answered:
49
+ * `filterAnnotationsByText` and `annotationsAt` returned `[]`, which means "no event matches" said
50
+ * of a list holding no events at all, and `countAnnotationsByText` returned one row counting
51
+ * `undefined`. Only `filterAnnotationsByTime` failed, with V8's `Cannot mix BigInt and other
52
+ * types` out of the tick comparison.
53
+ *
54
+ * `header.diagnostics` and `timeline.diagnostics` are the lists that get passed: they are the
55
+ * other arrays a reader holds after opening a file, and the printers for both sit beside these
56
+ * four in the barrel.
57
+ *
58
+ * The onset is the field to test — every one of these four reads it, and it is the one an
59
+ * annotation cannot be without.
60
+ */
61
+ const first = annotations[0];
62
+ if (annotations.length === 0 || typeof first?.onsetTicksFromFirstRecord === 'bigint')
39
63
  return;
40
- throw new RangeError(`${call}(): the annotations are ${describeValue(annotations)}, not an array. Next: pass the ` +
41
- '`annotations` field of what readAnnotations(recording, records) resolved to, which is a ' +
42
- 'result object rather than the list itself.');
64
+ throw new RangeError(`${call}(): the value at 0 carries no onset, so this is not a list of annotations — and three ` +
65
+ 'of these four calls answer with a list, so a wrong one reads as a recording with nothing in ' +
66
+ 'it. Next: pass the `annotations` field of what readAnnotations(recording, records) resolved ' +
67
+ 'to, or print a list of diagnostics with formatDiagnostics().');
43
68
  }
44
69
  /**
45
70
  * The annotations that overlap a time window, in the recording's own timebase.
@@ -1 +1 @@
1
- {"version":3,"file":"annotations-query.js","sourceRoot":"","sources":["../src/annotations-query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD;;;;;;;;;;;;GAYG;AACH,SAAS,iBAAiB,CAAC,WAAqC,EAAE,IAAY;IAC5E,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;QAAE,OAAO;IACvC,MAAM,IAAI,UAAU,CAClB,GAAG,IAAI,2BAA2B,aAAa,CAAC,WAAW,CAAC,iCAAiC;QAC3F,0FAA0F;QAC1F,4CAA4C,CAC/C,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CACrC,WAAqC,EACr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gBG;AAWH,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EAEZ,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EAEX,gBAAgB,EACjB,MAAM,YAAY,CAAC;AA2CpB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAyExE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAgC9D;AAqBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAsB,YAAY,CAChC,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,gBAAgB,EAC3B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAkJrC"}
1
+ {"version":3,"file":"biosemi.d.ts","sourceRoot":"","sources":["../src/biosemi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAWH,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EAEZ,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EAEX,gBAAgB,EACjB,MAAM,YAAY,CAAC;AA2CpB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAyExE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAgC9D;AAqBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAsB,YAAY,CAChC,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,gBAAgB,EAC3B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAyKrC"}
package/dist/biosemi.js CHANGED
@@ -261,6 +261,26 @@ export async function readTriggers(recording, selection, options) {
261
261
  'or no signal is labelled "Status". Next: check header.signals, or read EDF+ ' +
262
262
  'annotations with readAnnotations().');
263
263
  }
264
+ /*
265
+ * A Status channel the file declares with NO SAMPLES, which this counted as no triggers.
266
+ *
267
+ * `samplesPerRecord` of zero makes the inner loop below run zero times, so the scan completed and
268
+ * returned `[]` — and `[]` is one of this function's real answers. An experimenter reads it as "no
269
+ * stimulus in this window", on the one path in the package where a missing event is
270
+ * indistinguishable from no events; the refusal `getStatusSignal` grew in 0.6.120 and 0.6.179 was
271
+ * for exactly that, one call earlier.
272
+ *
273
+ * It is a defect the parser already names — `ZERO_SAMPLES_PER_RECORD` — and one the sample-grid
274
+ * family already refuses in these words, in `sample-grid.ts` and `sample-locate.ts`. This is the
275
+ * third place a signal with no grid is read from, and the only one that answered.
276
+ */
277
+ if (status.samplesPerRecord <= 0) {
278
+ throw new RangeError(`readTriggers(): the Status channel (signal ${status.index}) declares ` +
279
+ `${status.samplesPerRecord} samples per record, so this file stores no trigger samples at ` +
280
+ 'all — and an empty result here reads as a recording with no stimulus in it. Next: check ' +
281
+ 'header.diagnostics for ZERO_SAMPLES_PER_RECORD; the channel is declared but carries ' +
282
+ 'nothing.');
283
+ }
264
284
  const ranges = resolveTimeWindow(timeline, recording.index, selection.startSeconds, selection.durationSeconds);
265
285
  const windowStartTicks = secondsToTicks(selection.startSeconds, 'startSeconds');
266
286
  const windowEndTicks = windowStartTicks + secondsToTicks(selection.durationSeconds, 'durationSeconds');
@@ -1 +1 @@
1
- {"version":3,"file":"biosemi.js","sourceRoot":"","sources":["../src/biosemi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAA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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.6.207";
112
+ export declare const VERSION = "0.6.209";
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.6.207';
82
+ export const VERSION = '0.6.209';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,32 @@ 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.6.209
10
+
11
+ - **Fixed** `readTriggers` answering `[]` for a BDF whose `Status` channel declares no samples.
12
+ `samplesPerRecord` of zero makes the scan loop run zero times, so the sweep completed and returned
13
+ an empty list — one of this function's real answers, read by an experimenter as "no stimulus in
14
+ this window", on the path whose own docblocks say twice that a missing event cannot be told from no
15
+ events.
16
+ - `getStatusSignal` was given a guard for that outcome twice, in 0.6.120 and 0.6.179, both for a
17
+ wrong ARGUMENT. This is the FILE producing it, one call later.
18
+ - The parser already names the defect — `ZERO_SAMPLES_PER_RECORD` — and `sample-grid.ts` and
19
+ `sample-locate.ts` both refuse such a signal in these words. This was the third place a signal with
20
+ no grid is read from, and the only one that answered.
21
+
22
+ ## 0.6.208
23
+
24
+ - **Fixed** the four annotation queries answering over an array of something else. Their shared guard
25
+ stopped at `Array.isArray`, and being an array says nothing about what is in it.
26
+ - Three of the four then ANSWERED. `filterAnnotationsByText` and `annotationsAt` returned `[]` —
27
+ "no event matches", said of a list holding no events at all — and `countAnnotationsByText` returned
28
+ one row counting `undefined`. Only `filterAnnotationsByTime` failed, with V8's `Cannot mix BigInt
29
+ and other types` out of the tick comparison.
30
+ - `header.diagnostics` and `timeline.diagnostics` are the lists that get passed: the other arrays a
31
+ reader holds after opening a file, whose printers sit beside these four in the barrel.
32
+ - The three printers closed this one at a time — 0.6.160, 0.6.168, 0.6.185 — each checking the field
33
+ its own rows must carry. These four share one guard, and the field is the onset.
34
+
9
35
  ## 0.6.207
10
36
 
11
37
  - **Fixed** `fileSource` handing a non-file URL to `fs.open`. A URL object is an accepted argument —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.6.207",
3
+ "version": "0.6.209",
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",
@@ -38,11 +38,38 @@ import type { EdfAnnotation, EdfAnnotationWindow } from './types.js';
38
38
  * 0.6.107).
39
39
  */
40
40
  function assertAnnotations(annotations: readonly EdfAnnotation[], call: string): void {
41
- if (Array.isArray(annotations)) return;
41
+ if (!Array.isArray(annotations)) {
42
+ throw new RangeError(
43
+ `${call}(): the annotations are ${describeValue(annotations)}, not an array. Next: pass the ` +
44
+ '`annotations` field of what readAnnotations(recording, records) resolved to, which is a ' +
45
+ 'result object rather than the list itself.',
46
+ );
47
+ }
48
+ /*
49
+ * And the ELEMENTS, which being an array says nothing about.
50
+ *
51
+ * The three printers closed this one at a time — `formatDiagnostics` in 0.6.160,
52
+ * `summarizeDiagnostics` in 0.6.168, `formatAnnotations` in 0.6.185 — and these four QUERIES share
53
+ * a guard that still stopped at `Array.isArray`. Three of the four then answered:
54
+ * `filterAnnotationsByText` and `annotationsAt` returned `[]`, which means "no event matches" said
55
+ * of a list holding no events at all, and `countAnnotationsByText` returned one row counting
56
+ * `undefined`. Only `filterAnnotationsByTime` failed, with V8's `Cannot mix BigInt and other
57
+ * types` out of the tick comparison.
58
+ *
59
+ * `header.diagnostics` and `timeline.diagnostics` are the lists that get passed: they are the
60
+ * other arrays a reader holds after opening a file, and the printers for both sit beside these
61
+ * four in the barrel.
62
+ *
63
+ * The onset is the field to test — every one of these four reads it, and it is the one an
64
+ * annotation cannot be without.
65
+ */
66
+ const first = annotations[0] as { onsetTicksFromFirstRecord?: unknown } | undefined;
67
+ if (annotations.length === 0 || typeof first?.onsetTicksFromFirstRecord === 'bigint') return;
42
68
  throw new RangeError(
43
- `${call}(): the annotations are ${describeValue(annotations)}, not an array. Next: pass the ` +
44
- '`annotations` field of what readAnnotations(recording, records) resolved to, which is a ' +
45
- 'result object rather than the list itself.',
69
+ `${call}(): the value at 0 carries no onset, so this is not a list of annotations — and three ` +
70
+ 'of these four calls answer with a list, so a wrong one reads as a recording with nothing in ' +
71
+ 'it. Next: pass the `annotations` field of what readAnnotations(recording, records) resolved ' +
72
+ 'to, or print a list of diagnostics with formatDiagnostics().',
46
73
  );
47
74
  }
48
75
 
package/src/biosemi.ts CHANGED
@@ -294,6 +294,29 @@ export async function readTriggers(
294
294
  );
295
295
  }
296
296
 
297
+ /*
298
+ * A Status channel the file declares with NO SAMPLES, which this counted as no triggers.
299
+ *
300
+ * `samplesPerRecord` of zero makes the inner loop below run zero times, so the scan completed and
301
+ * returned `[]` — and `[]` is one of this function's real answers. An experimenter reads it as "no
302
+ * stimulus in this window", on the one path in the package where a missing event is
303
+ * indistinguishable from no events; the refusal `getStatusSignal` grew in 0.6.120 and 0.6.179 was
304
+ * for exactly that, one call earlier.
305
+ *
306
+ * It is a defect the parser already names — `ZERO_SAMPLES_PER_RECORD` — and one the sample-grid
307
+ * family already refuses in these words, in `sample-grid.ts` and `sample-locate.ts`. This is the
308
+ * third place a signal with no grid is read from, and the only one that answered.
309
+ */
310
+ if (status.samplesPerRecord <= 0) {
311
+ throw new RangeError(
312
+ `readTriggers(): the Status channel (signal ${status.index}) declares ` +
313
+ `${status.samplesPerRecord} samples per record, so this file stores no trigger samples at ` +
314
+ 'all — and an empty result here reads as a recording with no stimulus in it. Next: check ' +
315
+ 'header.diagnostics for ZERO_SAMPLES_PER_RECORD; the channel is declared but carries ' +
316
+ 'nothing.',
317
+ );
318
+ }
319
+
297
320
  const ranges = resolveTimeWindow(
298
321
  timeline,
299
322
  recording.index,
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.6.207';
96
+ export const VERSION = '0.6.209';