edfcore 0.6.267 → 0.6.269

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.6.267";
112
+ export declare const VERSION = "0.6.269";
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.267';
82
+ export const VERSION = '0.6.269';
83
83
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/diagnostics/summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEjF;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;CAC1C;AA+BD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,SAAS,aAAa,EAAE,GAAG,oBAAoB,CA0EhG"}
1
+ {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/diagnostics/summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEjF;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;CAC1C;AAuDD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,SAAS,aAAa,EAAE,GAAG,oBAAoB,CA0EhG"}
@@ -36,6 +36,28 @@ const SEVERITY_RANK = { error: 3, warning: 2, info: 1 };
36
36
  function assertDiagnostic(diagnostic, index) {
37
37
  if (typeof diagnostic?.message === 'string')
38
38
  return;
39
+ /*
40
+ * A PENDING PROMISE, which the sentence below is wrong about twice: it is not a by-code row, and
41
+ * "carries no message" is true of it the way it is true of almost everything.
42
+ *
43
+ * 0.6.254 closed the LIST level here, where the whole argument is one Promise. This is the other
44
+ * spelling, and it is a different mistake: an ARRAY of them, which is what `.map` over async work
45
+ * produces without `Promise.all`. `recordings.map((r) => validateRecording(r))` is the summary
46
+ * across several files that a batch report wants, and every element of it is pending.
47
+ *
48
+ * `formatDiagnostics` names it one directory over and `mergeChunks` names it per element too —
49
+ * "the value at 1 is a pending Promise, not a chunk". This was the last per-element guard in the
50
+ * package that did not.
51
+ *
52
+ * Said in words, for the reason the checks above give: this module imports one type module and
53
+ * nothing else, and a property read needs nothing.
54
+ */
55
+ if (typeof diagnostic?.then === 'function') {
56
+ throw new RangeError(`summarizeDiagnostics(): the value at ${index} is a pending Promise, so this array was ` +
57
+ 'mapped from async work and never awaited — nothing in this package resolves to a ' +
58
+ 'diagnostic. Next: await the calls first, with Promise.all over the array, and pass the ' +
59
+ 'diagnostics off what they resolved to.');
60
+ }
39
61
  throw new RangeError(`summarizeDiagnostics(): the value at ${index} carries no message, so it is not a ` +
40
62
  'diagnostic — a row of a by-code summary counts a code rather than being one, and counting ' +
41
63
  'those again reports the number of distinct codes as the number of diagnostics. Next: pass ' +
@@ -1 +1 @@
1
- {"version":3,"file":"summary.js","sourceRoot":"","sources":["../../src/diagnostics/summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA+BH,qEAAqE;AACrE,MAAM,aAAa,GAAgC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAErF;;;;;;;;;;;;;;;GAeG;AACH,SAAS,gBAAgB,CAAC,UAAyB,EAAE,KAAa;IAChE,IAAI,OAAQ,UAAuD,EAAE,OAAO,KAAK,QAAQ;QAAE,OAAO;IAClG,MAAM,IAAI,UAAU,CAClB,wCAAwC,KAAK,sCAAsC;QACjF,4FAA4F;QAC5F,4FAA4F;QAC5F,6EAA6E,CAChF,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAAqC;IACxE,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,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE;YAC1B,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,qFAAqF;YACrF,QAAQ,EAAE,QAAQ,EAAE,QAAQ,IAAI,UAAU,CAAC,QAAQ;YACnD,KAAK,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC;SAClC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,KAAK,EAAE,WAAW,CAAC,MAAM;QACzB,MAAM;QACN,QAAQ;QACR,KAAK;QACL,KAAK;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;KAC9E,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/text/describe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAwCpD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAC/E,MAAM,CAER"}
1
+ {"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/text/describe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CA2DpD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAC/E,MAAM,CAER"}
@@ -38,6 +38,25 @@ export function describeValue(value) {
38
38
  if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) {
39
39
  return Object.prototype.toString.call(value).slice(8, -1);
40
40
  }
41
+ /*
42
+ * A REGEXP, by the same tag, for the same reason, in the place it is likeliest to turn up.
43
+ *
44
+ * `a-pattern-where-a-label-belongs.test.ts` makes the argument: `matchSignals` takes a pattern and
45
+ * `findSignals` takes a label, and "a montage selector is more often a pattern than an exact
46
+ * label" — so a RegExp handed to the label-matching half is the commoner of the two spellings of
47
+ * that confusion. The guard's advice already names the kind, "matchSignals(header, pattern) for a
48
+ * RegExp or a predicate", while the subject called it "an object" and left the reader to work out
49
+ * that the object they passed was one.
50
+ *
51
+ * A predicate needs nothing here: `typeof` answers `function` and the message says so. A RegExp is
52
+ * the only matcher `typeof` flattens into `object`.
53
+ *
54
+ * `String(value)` is the source as written — `/EEG/i` — which is the whole of what a reader needs
55
+ * to recognise it, and it is a pattern they typed rather than data read out of a file.
56
+ */
57
+ if (Object.prototype.toString.call(value) === '[object RegExp]') {
58
+ return `the RegExp ${String(value)}`;
59
+ }
41
60
  /*
42
61
  * A PENDING PROMISE, which is the one object worth naming.
43
62
  *
@@ -1 +1 @@
1
- {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/text/describe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iGAAiG;AACjG,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACpD,IAAI,OAAO,KAAK,K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O,cAAc,KAAK,GAAG,CAAC;IAC7D,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,cAAc,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;IAC5E,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAC5C;;;;;;OAMG;IACH,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;QAC9D,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IACD;;;;;;;;;;;;;;;OAeG;IACH,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,iBAAiB,EAAE,CAAC;QAChE,OAAO,cAAc,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IACvC,CAAC;IACD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,OAAQ,KAA4B,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,mBAAmB,CAAC;IACzF,iGAAiG;IACjG,qFAAqF;IACrF,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,OAAO,KAAK,EAAE,CAAC;AACvE,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAgF;IAEhF,OAAO,YAAY,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC;AAC5F,CAAC"}
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,42 @@ 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.269
10
+
11
+ - **Fixed** a RegExp being described as "an object" by the guards that refuse one. `typeof` answers
12
+ `object` for a RegExp and `function` for a predicate, so of the two kinds of matcher this package
13
+ accepts, exactly one was flattened into the word every wrong value shares — while the same
14
+ sentence's advice already named the kind: "matchSignals(header, pattern) for a RegExp or a
15
+ predicate".
16
+ - It is the spelling worth naming. `a-pattern-where-a-label-belongs.test.ts` states why: `matchSignals`
17
+ takes a pattern and `findSignals` takes a label, and "a montage selector is more often a pattern
18
+ than an exact label" — so the RegExp handed to the label-matching half is the commoner of the two,
19
+ and it was the one whose message could not say what had arrived.
20
+ - Named by its built-in tag, which `describe.ts` already uses for a binary value "because that IS the
21
+ mistake wherever one turns up", and 0.6.256 applied to a typed array. The tag rather than
22
+ `instanceof`, because it is the same across realms.
23
+ - The pattern is printed as written, flags and all — `the RegExp /EEG Fp1/i` — which is what a reader
24
+ needs to recognise something they typed. Every other spelling is unchanged, including a plain
25
+ object, an array and a `Map`, and the calls that genuinely take a pattern still take one.
26
+
27
+ ## 0.6.268
28
+
29
+ - **Fixed** an array of Promises where a diagnostics array belongs being refused as a by-code summary.
30
+ `summarizeDiagnostics(recordings.map((r) => validateRecording(r)))` — the across-several-files
31
+ summary a batch report wants, written without `Promise.all` — got "the value at 0 carries no
32
+ message, so it is not a diagnostic — a row of a by-code summary counts a code rather than being
33
+ one", which names a shape the caller never passed.
34
+ - 0.6.254 closed the list level of this, where the whole argument is one Promise. The array is the
35
+ other spelling and a different mistake: the array is real and every element of it is pending, which
36
+ is what `.map` over async work produces.
37
+ - The advice has to be `Promise.all`, not `await`. One keyword in front of the array does nothing —
38
+ awaiting an array of Promises yields the array of Promises — so this is the one forgotten-await
39
+ family where naming the keyword alone would send a reader somewhere that still fails.
40
+ - `formatDiagnostics` names it one directory over, and `mergeChunks` names it per element too. This
41
+ was the last per-element guard in the package that did not.
42
+ - Said in words rather than through `describeValue`, since this module imports one type module and
43
+ nothing else. The by-code-row sentence is unchanged for the rows it was written for.
44
+
9
45
  ## 0.6.267
10
46
 
11
47
  - **Fixed** a time bound that is still a Promise being described as "an object". Every time-bounded
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.6.267",
3
+ "version": "0.6.269",
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.6.267';
96
+ export const VERSION = '0.6.269';
@@ -66,6 +66,30 @@ const SEVERITY_RANK: Record<EdfSeverity, number> = { error: 3, warning: 2, info:
66
66
  */
67
67
  function assertDiagnostic(diagnostic: EdfDiagnostic, index: number): void {
68
68
  if (typeof (diagnostic as { message?: unknown } | null | undefined)?.message === 'string') return;
69
+ /*
70
+ * A PENDING PROMISE, which the sentence below is wrong about twice: it is not a by-code row, and
71
+ * "carries no message" is true of it the way it is true of almost everything.
72
+ *
73
+ * 0.6.254 closed the LIST level here, where the whole argument is one Promise. This is the other
74
+ * spelling, and it is a different mistake: an ARRAY of them, which is what `.map` over async work
75
+ * produces without `Promise.all`. `recordings.map((r) => validateRecording(r))` is the summary
76
+ * across several files that a batch report wants, and every element of it is pending.
77
+ *
78
+ * `formatDiagnostics` names it one directory over and `mergeChunks` names it per element too —
79
+ * "the value at 1 is a pending Promise, not a chunk". This was the last per-element guard in the
80
+ * package that did not.
81
+ *
82
+ * Said in words, for the reason the checks above give: this module imports one type module and
83
+ * nothing else, and a property read needs nothing.
84
+ */
85
+ if (typeof (diagnostic as { then?: unknown } | null | undefined)?.then === 'function') {
86
+ throw new RangeError(
87
+ `summarizeDiagnostics(): the value at ${index} is a pending Promise, so this array was ` +
88
+ 'mapped from async work and never awaited — nothing in this package resolves to a ' +
89
+ 'diagnostic. Next: await the calls first, with Promise.all over the array, and pass the ' +
90
+ 'diagnostics off what they resolved to.',
91
+ );
92
+ }
69
93
  throw new RangeError(
70
94
  `summarizeDiagnostics(): the value at ${index} carries no message, so it is not a ` +
71
95
  'diagnostic — a row of a by-code summary counts a code rather than being one, and counting ' +
@@ -34,6 +34,25 @@ export function describeValue(value: unknown): string {
34
34
  if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) {
35
35
  return Object.prototype.toString.call(value).slice(8, -1);
36
36
  }
37
+ /*
38
+ * A REGEXP, by the same tag, for the same reason, in the place it is likeliest to turn up.
39
+ *
40
+ * `a-pattern-where-a-label-belongs.test.ts` makes the argument: `matchSignals` takes a pattern and
41
+ * `findSignals` takes a label, and "a montage selector is more often a pattern than an exact
42
+ * label" — so a RegExp handed to the label-matching half is the commoner of the two spellings of
43
+ * that confusion. The guard's advice already names the kind, "matchSignals(header, pattern) for a
44
+ * RegExp or a predicate", while the subject called it "an object" and left the reader to work out
45
+ * that the object they passed was one.
46
+ *
47
+ * A predicate needs nothing here: `typeof` answers `function` and the message says so. A RegExp is
48
+ * the only matcher `typeof` flattens into `object`.
49
+ *
50
+ * `String(value)` is the source as written — `/EEG/i` — which is the whole of what a reader needs
51
+ * to recognise it, and it is a pattern they typed rather than data read out of a file.
52
+ */
53
+ if (Object.prototype.toString.call(value) === '[object RegExp]') {
54
+ return `the RegExp ${String(value)}`;
55
+ }
37
56
  /*
38
57
  * A PENDING PROMISE, which is the one object worth naming.
39
58
  *