edfcore 0.6.267 → 0.6.268

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.268";
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.268';
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"}
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,24 @@ 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.268
10
+
11
+ - **Fixed** an array of Promises where a diagnostics array belongs being refused as a by-code summary.
12
+ `summarizeDiagnostics(recordings.map((r) => validateRecording(r)))` — the across-several-files
13
+ summary a batch report wants, written without `Promise.all` — got "the value at 0 carries no
14
+ message, so it is not a diagnostic — a row of a by-code summary counts a code rather than being
15
+ one", which names a shape the caller never passed.
16
+ - 0.6.254 closed the list level of this, where the whole argument is one Promise. The array is the
17
+ other spelling and a different mistake: the array is real and every element of it is pending, which
18
+ is what `.map` over async work produces.
19
+ - The advice has to be `Promise.all`, not `await`. One keyword in front of the array does nothing —
20
+ awaiting an array of Promises yields the array of Promises — so this is the one forgotten-await
21
+ family where naming the keyword alone would send a reader somewhere that still fails.
22
+ - `formatDiagnostics` names it one directory over, and `mergeChunks` names it per element too. This
23
+ was the last per-element guard in the package that did not.
24
+ - Said in words rather than through `describeValue`, since this module imports one type module and
25
+ nothing else. The by-code-row sentence is unchanged for the rows it was written for.
26
+
9
27
  ## 0.6.267
10
28
 
11
29
  - **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.268",
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.268';
@@ -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 ' +