edfcore 0.6.260 → 0.6.261

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.260";
112
+ export declare const VERSION = "0.6.261";
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.260';
82
+ export const VERSION = '0.6.261';
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,CA6ClF;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
@@ -101,6 +101,23 @@ export function assertMaterializeOptions(options, call) {
101
101
  'than an entry in a list, so this call took the default budget. Next: pass it on an ' +
102
102
  'options object.');
103
103
  }
104
+ /*
105
+ * A PENDING PROMISE, the other object the check below lets through — and in this family the one
106
+ * field is the whole of the argument, so there is nothing left on it to look wrong.
107
+ *
108
+ * 0.6.248 added this guard because `MaterializeOptions` "carries that field and nothing else, so
109
+ * the number is the WHOLE of what a caller holds". A Promise is that sentence again: the budget
110
+ * read as `undefined`, `resolveMaterializeBudget` returned the 256 MiB default, and the allocation
111
+ * went ahead — on the option whose entire job is to "refuse before allocating rather than dying
112
+ * inside it".
113
+ *
114
+ * A property read, never a call.
115
+ */
116
+ if (typeof options?.then === 'function') {
117
+ throw new RangeError(`${call}(): the options are a pending Promise, and maxMaterializeBytes is read off the ` +
118
+ 'object rather than awaited — so this call took the default budget and allocated. Next: ' +
119
+ 'await them before passing them.');
120
+ }
104
121
  if (options === undefined || options === null || typeof options === 'object')
105
122
  return;
106
123
  throw new RangeError(`${call}(): the options are ${describeValue(options)}, not an object — maxMaterializeBytes ` +
@@ -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;;;;;;;;;;;;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;;;;;;;;;;;;;;;;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,20 @@ 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.261
10
+
11
+ - **Fixed** `MaterializeOptions` accepted as the Promise that will produce it. 0.6.248 gave this family
12
+ its first guard and gave the reason: it "carries that field and nothing else, so the number is the
13
+ WHOLE of what a caller holds". A pending Promise is that sentence from the other side — there is no
14
+ second field left on the object that could make the call look wrong.
15
+ - `maxMaterializeBytes` read as `undefined`, `resolveMaterializeBudget` returned the 256 MiB default,
16
+ and the allocation went ahead — on the option whose entire job is to "refuse before allocating rather
17
+ than dying inside it". A caller who capped a browser tab at four megabytes got that cap on no call.
18
+ - Covers `toPhysical`, `clampToDigitalRange` and `decodeDigital`, the three calls that resolve it. The
19
+ read half went in 0.6.258, the parse half in 0.6.259 and the listing half in 0.6.260.
20
+ - A property read, never a call: a Promise that never settles is refused rather than awaited. The array
21
+ and bare-value branches keep their own sentences.
22
+
9
23
  ## 0.6.260
10
24
 
11
25
  - **Fixed** the three listing formatters accepting their options as the Promise that will produce them.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.6.260",
3
+ "version": "0.6.261",
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.260';
96
+ export const VERSION = '0.6.261';
package/src/options.ts CHANGED
@@ -110,6 +110,25 @@ export function assertMaterializeOptions(options: unknown, call: string): void {
110
110
  'options object.',
111
111
  );
112
112
  }
113
+ /*
114
+ * A PENDING PROMISE, the other object the check below lets through — and in this family the one
115
+ * field is the whole of the argument, so there is nothing left on it to look wrong.
116
+ *
117
+ * 0.6.248 added this guard because `MaterializeOptions` "carries that field and nothing else, so
118
+ * the number is the WHOLE of what a caller holds". A Promise is that sentence again: the budget
119
+ * read as `undefined`, `resolveMaterializeBudget` returned the 256 MiB default, and the allocation
120
+ * went ahead — on the option whose entire job is to "refuse before allocating rather than dying
121
+ * inside it".
122
+ *
123
+ * A property read, never a call.
124
+ */
125
+ if (typeof (options as { then?: unknown } | null | undefined)?.then === 'function') {
126
+ throw new RangeError(
127
+ `${call}(): the options are a pending Promise, and maxMaterializeBytes is read off the ` +
128
+ 'object rather than awaited — so this call took the default budget and allocated. Next: ' +
129
+ 'await them before passing them.',
130
+ );
131
+ }
113
132
  if (options === undefined || options === null || typeof options === 'object') return;
114
133
  throw new RangeError(
115
134
  `${call}(): the options are ${describeValue(options)}, not an object — maxMaterializeBytes ` +