edfcore 0.6.259 → 0.6.260

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.259";
112
+ export declare const VERSION = "0.6.260";
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.259';
82
+ export const VERSION = '0.6.260';
83
83
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,MAAM,CAqBR;AAED;;;;;;;;;;;;;GAaG;AACH;;;;;;;;;;;;;;;GAeG;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAc7E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CA6BlF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAQ5F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAq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;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQ1E"}
package/dist/options.js CHANGED
@@ -128,6 +128,20 @@ export function assertOptions(options, call, listed) {
128
128
  'options rather than entries in a list — so nothing was redacted and every ' +
129
129
  `${listed} was listed. Next: pass them on an object.`);
130
130
  }
131
+ /*
132
+ * A PENDING PROMISE, the other object the check below lets through. 0.6.258 and 0.6.259 closed the
133
+ * read and parse halves; this is the family where the dropped option is `redactFields`, and
134
+ * `format.ts` says what that costs: it is "the one option in this package whose silent failure
135
+ * sends a person's name somewhere it should not go".
136
+ *
137
+ * Both options go at once, so a listing asked for twenty rows printed fifty thousand with the
138
+ * identification bytes in them. A property read, never a call.
139
+ */
140
+ if (typeof options?.then === 'function') {
141
+ throw new RangeError(`${call}(): the options are a pending Promise, and maxItems and redactFields are read off ` +
142
+ `the object rather than awaited — so nothing was redacted and every ${listed} was ` +
143
+ 'listed. Next: await them before passing them.');
144
+ }
131
145
  if (options === undefined || typeof options === 'object')
132
146
  return;
133
147
  throw new RangeError(`${call}(): the options are ${describeValue(options)}, not an object — maxItems is a field ` +
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAyB,EACzB,IAAY,EACZ,QAAgB;IAEhB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IACzC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACzC;;;;;;;;;;;;OAYG;IACH,MAAM,IAAI,UAAU,CAClB,WAAW,IAAI,qCAAqC,aAAa,CAAC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,KAAK,UAAU;QAAE,OAAO;IAC/D,MAAM,IAAI,UAAU,CAClB,WAAW,IAAI,gCAAgC,aAAa,CAAC,KAAK,CAAC,kBAAkB,OAAO,IAAI;QAC9F,4FAA4F;QAC5F,kFAAkF,CACrF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAyB,EAAE,KAAa;IACvE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACtC;;;;;;;;;;OAUG;IACH,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,UAAU,CAClB,oDAAoD,aAAa,CAAC,KAAK,CAAC,mBAAmB;YACzF,0FAA0F;YAC1F,mDAAmD,CACtD,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,UAAU,CAClB,2FAA2F;YACzF,wFAAwF;YACxF,gCAAgC,CACnC,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAyB;IAChE,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,CAAC,CAAC;IAChG,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IAC/B,MAAM,IAAI,UAAU,CAClB,6DAA6D,MAAM,0BAA0B;QAC3F,0DAA0D;QAC1D,GAAG,6BAA6B,gBAAgB,CACnD,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.260
10
+
11
+ - **Fixed** the three listing formatters accepting their options as the Promise that will produce them.
12
+ `maxItems` and `redactFields` are both read off the object rather than awaited, so both took their
13
+ defaults at once: a call asking for twenty rows with the identification withheld printed every row it
14
+ had, with the identification in them, and no `... and N more` line to show the truncation — because
15
+ there was none.
16
+ - This is the family where the dropped option costs the most. `format.ts` calls `redactFields` "the one
17
+ option in this package whose silent failure sends a person's name somewhere it should not go", and a
18
+ redaction policy out of a config file, a session record or a per-user setting is exactly the kind of
19
+ thing that sits behind an async helper.
20
+ - `assertRedactableFields` exists so a name outside the vocabulary "is refused rather than ignored". A
21
+ pending Promise has no names on it at all, so that guard saw an empty list and had nothing to refuse.
22
+ - Covers `formatDiagnostics`, `formatAnnotations` and `formatValidationReport`, which resolve these
23
+ options through one guard. The read half went in 0.6.258 and the parse half in 0.6.259.
24
+ - A property read, never a call: a Promise that never settles is refused rather than awaited. The array
25
+ and bare-value branches keep their own sentences.
26
+
9
27
  ## 0.6.259
10
28
 
11
29
  - **Fixed** parse options handed over as the Promise that will produce them, which 0.6.258 named as
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.6.259",
3
+ "version": "0.6.260",
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.259';
96
+ export const VERSION = '0.6.260';
package/src/options.ts CHANGED
@@ -141,6 +141,22 @@ export function assertOptions(options: unknown, call: string, listed: string): v
141
141
  `${listed} was listed. Next: pass them on an object.`,
142
142
  );
143
143
  }
144
+ /*
145
+ * A PENDING PROMISE, the other object the check below lets through. 0.6.258 and 0.6.259 closed the
146
+ * read and parse halves; this is the family where the dropped option is `redactFields`, and
147
+ * `format.ts` says what that costs: it is "the one option in this package whose silent failure
148
+ * sends a person's name somewhere it should not go".
149
+ *
150
+ * Both options go at once, so a listing asked for twenty rows printed fifty thousand with the
151
+ * identification bytes in them. A property read, never a call.
152
+ */
153
+ if (typeof (options as { then?: unknown } | null | undefined)?.then === 'function') {
154
+ throw new RangeError(
155
+ `${call}(): the options are a pending Promise, and maxItems and redactFields are read off ` +
156
+ `the object rather than awaited — so nothing was redacted and every ${listed} was ` +
157
+ 'listed. Next: await them before passing them.',
158
+ );
159
+ }
144
160
  if (options === undefined || typeof options === 'object') return;
145
161
  throw new RangeError(
146
162
  `${call}(): the options are ${describeValue(options)}, not an object — maxItems is a field ` +