edfcore 0.6.91 → 0.6.92

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.91";
112
+ export declare const VERSION = "0.6.92";
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.91';
82
+ export const VERSION = '0.6.92';
83
83
  //# sourceMappingURL=constants.js.map
@@ -90,28 +90,5 @@ export declare function ceilDiv(a: bigint, b: bigint): bigint;
90
90
  * that accepts exponent notation, so three bytes are enough to ask for it.
91
91
  */
92
92
  export declare function saturateToInt64(ticks: bigint): bigint;
93
- /**
94
- * Seconds to ticks, rounded to the NEAREST tick (ties away from zero is not required; ties go
95
- * toward +Infinity, as `Math.round` does).
96
- *
97
- * Only for user-supplied bounds such as a time window, never for a value read from disk: a
98
- * caller's `30.0` must resolve to 300000000 ticks and not to 299999999 because `30 * 1e7` landed
99
- * one ULP low. On-disk values reach ticks through the digit parsers above, which never round.
100
- *
101
- * Throws `RangeError` for a non-finite argument: there is no tick count for NaN or Infinity, and
102
- * inventing 0 would silently move a window to the file start.
103
- *
104
- * `name` is the caller's own word for the value, and it is required rather than defaulted. The
105
- * message used to end "check the window bound you passed in", which is right for five of the
106
- * fifteen call sites and wrong for the rest: nine of them convert an INSTANT — a cursor position,
107
- * a record onset, a sample start — and one converts `secondsPerBucket`, so a caller who passed a
108
- * `NaN` bucket width was sent to look at their window (fixed in 0.6.30).
109
- *
110
- * It is the pair `options.ts` documents from the other side: "One bad option, two different wrong
111
- * diagnoses. Resolving it in one place means the message names the argument that is actually
112
- * wrong." `resolveSignals` reached the same place by the opposite route and carries NO caller
113
- * prefix, "because a hard-coded name would be wrong for all but one of them" — which is the choice
114
- * available when the callers cannot say. These can.
115
- */
116
93
  export declare function secondsToTicks(seconds: number, name: string): bigint;
117
94
  //# sourceMappingURL=ticks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../src/tal/ticks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAwED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAOxD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAQ1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGpD;AAKD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIrD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CASpE"}
1
+ {"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../src/tal/ticks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAwED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAOxD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAQ1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGpD;AAKD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIrD;AAwCD,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAmBpE"}
package/dist/tal/ticks.js CHANGED
@@ -189,7 +189,32 @@ export function saturateToInt64(ticks) {
189
189
  * prefix, "because a hard-coded name would be wrong for all but one of them" — which is the choice
190
190
  * available when the callers cannot say. These can.
191
191
  */
192
+ /**
193
+ * A value that is not a number at all, said in a way that does not read as a valid one.
194
+ *
195
+ * The template below interpolated it bare, so the message named a rule the printed value satisfies.
196
+ * A BigInt is the sharp case: this package hands out `onsetTicksFromFirstRecord` and every other
197
+ * instant as ticks, and passing one where seconds belong earned "startSeconds must be a finite
198
+ * number of seconds, but was 10000000" — which is a finite number of seconds (fixed in 0.6.92).
199
+ */
200
+ function describeSeconds(seconds) {
201
+ if (typeof seconds === 'bigint')
202
+ return `the BigInt ${seconds}n`;
203
+ if (typeof seconds === 'string')
204
+ return `the string ${JSON.stringify(seconds)}`;
205
+ if (seconds === null)
206
+ return 'null';
207
+ return typeof seconds === 'object' ? 'an object' : `a ${typeof seconds}`;
208
+ }
192
209
  export function secondsToTicks(seconds, name) {
210
+ // Separated from the finiteness check below so that neither message can describe the other's
211
+ // value: "not finite" is about a number, and `NaN`, `Infinity` and `undefined` all read correctly
212
+ // as themselves. A string or a BigInt does not.
213
+ if (typeof seconds !== 'number' && seconds !== undefined) {
214
+ throw new RangeError(`${name} must be a number of seconds, and was given ${describeSeconds(seconds)}. Next: ` +
215
+ 'convert it first — Number(text) for a string, and for a tick count the matching ' +
216
+ '*Seconds field beside it, which every instant edfcore hands out carries.');
217
+ }
193
218
  if (!Number.isFinite(seconds)) {
194
219
  throw new RangeError(`${name} must be a finite number of seconds, but was ${seconds}. Next: check the ` +
195
220
  'expression that produced it — Number() on an absent environment variable, query ' +
@@ -1 +1 @@
1
- {"version":3,"file":"ticks.js","sourceRoot":"","sources":["../../src/tal/ticks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAoBnD,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,SAAS,GAAG,IAAI,CAAC;AAEvB,gGAAgG;AAChG,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B,uEAAuE;AACvE,MAA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AO,cAAc,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAChF,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IACpC,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,OAAO,OAAO,EAAE,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,IAAY;IAC1D,6FAA6F;IAC7F,kGAAkG;IAClG,gDAAgD;IAChD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACzD,MAAM,IAAI,UAAU,CAClB,GAAG,IAAI,+CAA+C,eAAe,CAAC,OAAO,CAAC,UAAU;YACtF,kFAAkF;YAClF,0EAA0E,CAC7E,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,UAAU,CAClB,GAAG,IAAI,gDAAgD,OAAO,oBAAoB;YAChF,kFAAkF;YAClF,6EAA6E,CAChF,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,sBAAsB,CAAC,CAAC,CAAC;AAC9D,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.92
10
+
11
+ - **Changed** how a time argument that is not a number at all is refused, because the old message
12
+ named a rule the printed value satisfies.
13
+ - `secondsToTicks` interpolated the value bare into "must be a finite number of seconds, but was
14
+ ${seconds}". `NaN`, `Infinity` and `undefined` read correctly there; nothing else did. The string
15
+ `'0'` came out as `but was 0` — 0 is a finite number of seconds.
16
+ - A BigInt is the case worth fixing for. Every instant this package hands out is ticks
17
+ (`onsetTicksFromFirstRecord`, `spanTicks`, `index.onsetTicks()`), so passing one back where
18
+ seconds belong is a mistake the API's own shape invites, and it earned "but was 10000000" — a
19
+ finite number of seconds, from a value out by a factor of ten million. It now says "was given the
20
+ BigInt 10000000n", and points at the `*Seconds` field beside it — every instant edfcore hands out
21
+ carries both.
22
+
9
23
  ## 0.6.91
10
24
 
11
25
  - **Fixed** `contiguityOf` answering `'unknown'` for an argument that is not a record index at all.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.6.91",
3
+ "version": "0.6.92",
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.91';
96
+ export const VERSION = '0.6.92';
package/src/tal/ticks.ts CHANGED
@@ -225,7 +225,32 @@ export function saturateToInt64(ticks: bigint): bigint {
225
225
  * prefix, "because a hard-coded name would be wrong for all but one of them" — which is the choice
226
226
  * available when the callers cannot say. These can.
227
227
  */
228
+ /**
229
+ * A value that is not a number at all, said in a way that does not read as a valid one.
230
+ *
231
+ * The template below interpolated it bare, so the message named a rule the printed value satisfies.
232
+ * A BigInt is the sharp case: this package hands out `onsetTicksFromFirstRecord` and every other
233
+ * instant as ticks, and passing one where seconds belong earned "startSeconds must be a finite
234
+ * number of seconds, but was 10000000" — which is a finite number of seconds (fixed in 0.6.92).
235
+ */
236
+ function describeSeconds(seconds: unknown): string {
237
+ if (typeof seconds === 'bigint') return `the BigInt ${seconds}n`;
238
+ if (typeof seconds === 'string') return `the string ${JSON.stringify(seconds)}`;
239
+ if (seconds === null) return 'null';
240
+ return typeof seconds === 'object' ? 'an object' : `a ${typeof seconds}`;
241
+ }
242
+
228
243
  export function secondsToTicks(seconds: number, name: string): bigint {
244
+ // Separated from the finiteness check below so that neither message can describe the other's
245
+ // value: "not finite" is about a number, and `NaN`, `Infinity` and `undefined` all read correctly
246
+ // as themselves. A string or a BigInt does not.
247
+ if (typeof seconds !== 'number' && seconds !== undefined) {
248
+ throw new RangeError(
249
+ `${name} must be a number of seconds, and was given ${describeSeconds(seconds)}. Next: ` +
250
+ 'convert it first — Number(text) for a string, and for a tick count the matching ' +
251
+ '*Seconds field beside it, which every instant edfcore hands out carries.',
252
+ );
253
+ }
229
254
  if (!Number.isFinite(seconds)) {
230
255
  throw new RangeError(
231
256
  `${name} must be a finite number of seconds, but was ${seconds}. Next: check the ` +