edfcore 0.6.242 → 0.6.244

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.
@@ -1 +1 @@
1
- {"version":3,"file":"biosemi.d.ts","sourceRoot":"","sources":["../src/biosemi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAWH,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EAEZ,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EAEX,gBAAgB,EACjB,MAAM,YAAY,CAAC;AA2CpB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CA6FxE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAgC9D;AAqBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAsB,YAAY,CAChC,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,gBAAgB,EAC3B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CA+KrC"}
1
+ {"version":3,"file":"biosemi.d.ts","sourceRoot":"","sources":["../src/biosemi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAWH,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EAEZ,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EAEX,gBAAgB,EACjB,MAAM,YAAY,CAAC;AA2DpB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CA6FxE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAgC9D;AAqBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAsB,YAAY,CAChC,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,gBAAgB,EAC3B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CA+KrC"}
package/dist/biosemi.js CHANGED
@@ -26,12 +26,29 @@ import { ceilDiv, secondsToTicks, ticksToSeconds } from './tal/ticks.js';
26
26
  import { resolveTimeWindow } from './time/window.js';
27
27
  /** BioSemi's own label for the channel. Matched case-insensitively after trimming. */
28
28
  const STATUS_LABEL = 'status';
29
- /** `undefined`, `a string`, `NaN`, `1.5` — named as itself, since `&` would have taken them all. */
29
+ /**
30
+ * `undefined`, `an object`, `NaN`, `1.5` — named as itself, since `&` would have taken them all.
31
+ *
32
+ * The article is written out here rather than left off, and `object` is the one `typeof` answer
33
+ * that does not take "a". This was the last of the package's five describers still saying `a
34
+ * object`; 0.6.230 fixed the one behind every read and gave the reason `io/source.ts` states — "an
35
+ * article needs to know that `Uint8Array` is said 'yoo-int', which no rule about vowels gets right,
36
+ * and getting it wrong is the kind of thing a reader notices instead of the message".
37
+ *
38
+ * It is reachable from the mistake this guard exists for. `decodeStatusWord(chunk.signals[0])` —
39
+ * the signal rather than one sample of its `digital` — is an object, and so is the typed array one
40
+ * field along.
41
+ *
42
+ * `null` and `undefined` are answered above the article, so of the six that can still arrive
43
+ * exactly one begins with a vowel.
44
+ */
30
45
  function describeSample(sample) {
31
46
  if (sample === null)
32
47
  return 'null';
33
48
  if (sample === undefined)
34
49
  return 'undefined';
50
+ if (typeof sample === 'object')
51
+ return 'an object';
35
52
  if (typeof sample !== 'number')
36
53
  return `a ${typeof sample}`;
37
54
  return String(sample);
@@ -1 +1 @@
1
- {"version":3,"file":"biosemi.js","sourceRoot":"","sources":["../src/biosemi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,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AG,aAAa,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC;wBACjF,CAAC,CAAC,gBAAgB,CAAC;oBAEvB,IAAI,KAAK,GAAG,gBAAgB,IAAI,KAAK,IAAI,cAAc;wBAAE,SAAS;oBAClE,IAAI,QAAQ,IAAI,CAAC,OAAO;wBAAE,SAAS;oBACnC,MAAM,UAAU,GAAG,CAAC,QAAQ,CAAC;oBAC7B,QAAQ,GAAG,IAAI,CAAC;oBAEhB,MAAM,CAAC,IAAI,CAAC;wBACV,WAAW,EAAE,WAAW,GAAG,gBAAgB,GAAG,CAAC;wBAC/C,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC;wBAC9B,KAAK;wBACL,OAAO,EAAE,IAAI,CAAC,OAAO;wBACrB,MAAM,EAAE,IAAI;wBACZ,qFAAqF;wBACrF,2EAA2E;wBAC3E,aAAa,EACX,UAAU,IAAI,CAAC,WAAW,KAAK,SAAS,IAAI,KAAK,KAAK,WAAW,CAAC;4BAChE,CAAC,CAAC,aAAa;4BACf,CAAC,CAAC,SAAS;qBAChB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAED,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
@@ -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.242";
112
+ export declare const VERSION = "0.6.244";
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.242';
82
+ export const VERSION = '0.6.244';
83
83
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/io/read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAWH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAoBhG;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAuC9F;AA4ID;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,UAAU,CAAC,CAyDrB"}
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/io/read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAWH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAoBhG;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAuC9F;AAmKD;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,UAAU,CAAC,CAyDrB"}
package/dist/io/read.js CHANGED
@@ -173,14 +173,37 @@ function assertRecordRange(header, records) {
173
173
  * every caller of this guard is pinned on, and it is true of both.
174
174
  */
175
175
  const clampable = typeof range.start === 'number' && typeof range.count === 'number';
176
+ /*
177
+ * "Pass a start and a count", said to a caller who passed both.
178
+ *
179
+ * 0.6.221 split this clause on whether there are two numbers to clamp, and treated everything
180
+ * that is not two numbers as a missing range. `{ start: 0n, count: 2n }` is not one: both bounds
181
+ * are there, named, and in the right order — they are BigInts, which this call cannot use because
182
+ * it ADDS and MULTIPLIES them rather than keying by them. So the advice for an absent range went
183
+ * to a caller holding a complete one, telling them a whole-file read has no default when what
184
+ * they wanted was a two-record read they had already written out.
185
+ *
186
+ * A BigInt reaches here because ticks are BigInt everywhere in this package, which is the same
187
+ * route 0.6.242 traced for the signal index — and there the spelling resolves, because a key
188
+ * stringifies. Here it does not.
189
+ *
190
+ * BOTH bounds have to be there for this to be the right sentence. `{ start: 0 }` named one, and
191
+ * the caller who wrote it is missing a count rather than holding the wrong kind of one, so it
192
+ * keeps the clause 0.6.221 wrote.
193
+ */
194
+ const bound = (value) => value !== undefined && value !== null;
195
+ const mistyped = !clampable && bound(range.start) && bound(range.count);
176
196
  throw new EdfRangeError(`records ${describeRecordRange(range)} is not inside the ` +
177
197
  `${header.recordCount} data records this file contains. Next: ` +
178
198
  (clampable
179
199
  ? 'clamp the range against header.recordCount, or call index.locate(seconds) to find a ' +
180
200
  'record index for a time.'
181
- : 'pass a start and a count — there is no default, so a whole-file read is written out ' +
182
- `rather than implied, and here that is start 0, count ${header.recordCount}. Or call ` +
183
- 'readWindow(), which takes seconds and resolves the records itself.'), { requested: range, available });
201
+ : mistyped
202
+ ? 'pass the two bounds as numbers — this counts and adds them rather than using them as ' +
203
+ 'keys, so a BigInt or a string is not the same value here. Number(value) converts one.'
204
+ : 'pass a start and a count — there is no default, so a whole-file read is written out ' +
205
+ `rather than implied, and here that is start 0, count ${header.recordCount}. Or call ` +
206
+ 'readWindow(), which takes seconds and resolves the records itself.'), { requested: range, available });
184
207
  }
185
208
  /**
186
209
  * Refused BEFORE the allocation, never during it.
@@ -1 +1 @@
1
- {"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/io/read.ts"],"names":[],"mappings":"AAAA;;;;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AAE,IAAI,KAAK,UAAU,EAAE,CAAC;YAClF,MAAM,IAAI,UAAU,CAClB,kGAAkG;gBAChG,oCAAoC,CACvC,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,UAAU,CAClB,4FAA4F;YAC1F,0FAA0F;YAC1F,gDAAgD,CACnD,CAAC;IACJ,CAAC;IACD,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAC3D,IAAI,UAAU,KAAK,CAAC;QAAE,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;IAE/C,kBAAkB,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,MAAM,CAAC,gBAAgB,GAAG,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC;IACrF,OAAO,eAAe,CACpB,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAClD,UAAU,EACV,UAAU,CACX,CAAC;AACJ,CAAC"}
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,40 @@ 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.244
10
+
11
+ - **Fixed** `a object` in the last of this package's five describers still saying it.
12
+ `describeSample` names what `decodeStatusWord` refused, and built the phrase as
13
+ `a ${typeof sample}`. Five of the six things `typeof` can still return there take "a"; the sixth
14
+ is `object`, which is exactly what this guard exists to catch — its own comment says `&` "coerces
15
+ rather than refuses", so a caller who passed the signal, or the typed array one field along, gets
16
+ a well-formed Status word out of a wrong argument unless something refuses it.
17
+ - 0.6.230 fixed the describer behind every read and quoted `io/source.ts` for the reason: "an
18
+ article needs to know that `Uint8Array` is said 'yoo-int', which no rule about vowels gets right,
19
+ and getting it wrong is the kind of thing a reader notices instead of the message".
20
+ `io/bytes.ts`, `tal/ticks.ts` and `text/describe.ts` already special-cased `object`.
21
+ - The test reads the property out of `src/` rather than asserting the single case, so a sixth
22
+ describer cannot appear with the same slip. Every other value this one names is unchanged, and so
23
+ is the rest of the sentence.
24
+
25
+ ## 0.6.243
26
+
27
+ - **Fixed** "pass a start and a count" being said to a caller who passed both. 0.6.221 split that
28
+ clause on whether there are two numbers to clamp and treated everything else as a missing range.
29
+ `{ start: 0n, count: 2n }` is not one: both bounds are there, named and in the right order. They
30
+ are BigInts, which this call cannot use because it ADDS and MULTIPLIES them —
31
+ `records.start + records.count`, `records.count * header.recordByteLength` — rather than keying
32
+ by them.
33
+ - So the advice written for an absent range went to a caller holding a complete one, telling them a
34
+ whole-file read has no default when what they had written was the two-record read they wanted.
35
+ The clause now says what the bounds are used for and that `Number(value)` converts one.
36
+ - A BigInt gets here because ticks are BigInt everywhere in this package, the same route 0.6.242
37
+ traced for the signal index. There the spelling resolves, because a property key stringifies;
38
+ here it does not, because arithmetic mixing a BigInt and a number throws.
39
+ - Both bounds have to be present for this to be the right sentence. `{ start: 0 }` names one, and a
40
+ caller missing a count keeps the clause 0.6.221 wrote — as do an absent range, `null`, an empty
41
+ object and a string. A range that is two numbers keeps the clamp.
42
+
9
43
  ## 0.6.242
10
44
 
11
45
  - **Fixed** a BigInt signal index being told it is "not a number this header can be indexed by".
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.6.242",
3
+ "version": "0.6.244",
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/biosemi.ts CHANGED
@@ -40,10 +40,26 @@ import type {
40
40
  /** BioSemi's own label for the channel. Matched case-insensitively after trimming. */
41
41
  const STATUS_LABEL = 'status';
42
42
 
43
- /** `undefined`, `a string`, `NaN`, `1.5` — named as itself, since `&` would have taken them all. */
43
+ /**
44
+ * `undefined`, `an object`, `NaN`, `1.5` — named as itself, since `&` would have taken them all.
45
+ *
46
+ * The article is written out here rather than left off, and `object` is the one `typeof` answer
47
+ * that does not take "a". This was the last of the package's five describers still saying `a
48
+ * object`; 0.6.230 fixed the one behind every read and gave the reason `io/source.ts` states — "an
49
+ * article needs to know that `Uint8Array` is said 'yoo-int', which no rule about vowels gets right,
50
+ * and getting it wrong is the kind of thing a reader notices instead of the message".
51
+ *
52
+ * It is reachable from the mistake this guard exists for. `decodeStatusWord(chunk.signals[0])` —
53
+ * the signal rather than one sample of its `digital` — is an object, and so is the typed array one
54
+ * field along.
55
+ *
56
+ * `null` and `undefined` are answered above the article, so of the six that can still arrive
57
+ * exactly one begins with a vowel.
58
+ */
44
59
  function describeSample(sample: unknown): string {
45
60
  if (sample === null) return 'null';
46
61
  if (sample === undefined) return 'undefined';
62
+ if (typeof sample === 'object') return 'an object';
47
63
  if (typeof sample !== 'number') return `a ${typeof sample}`;
48
64
  return String(sample);
49
65
  }
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.242';
96
+ export const VERSION = '0.6.244';
package/src/io/read.ts CHANGED
@@ -187,15 +187,38 @@ function assertRecordRange(header: EdfHeader, records: RecordRange): void {
187
187
  * every caller of this guard is pinned on, and it is true of both.
188
188
  */
189
189
  const clampable = typeof range.start === 'number' && typeof range.count === 'number';
190
+ /*
191
+ * "Pass a start and a count", said to a caller who passed both.
192
+ *
193
+ * 0.6.221 split this clause on whether there are two numbers to clamp, and treated everything
194
+ * that is not two numbers as a missing range. `{ start: 0n, count: 2n }` is not one: both bounds
195
+ * are there, named, and in the right order — they are BigInts, which this call cannot use because
196
+ * it ADDS and MULTIPLIES them rather than keying by them. So the advice for an absent range went
197
+ * to a caller holding a complete one, telling them a whole-file read has no default when what
198
+ * they wanted was a two-record read they had already written out.
199
+ *
200
+ * A BigInt reaches here because ticks are BigInt everywhere in this package, which is the same
201
+ * route 0.6.242 traced for the signal index — and there the spelling resolves, because a key
202
+ * stringifies. Here it does not.
203
+ *
204
+ * BOTH bounds have to be there for this to be the right sentence. `{ start: 0 }` named one, and
205
+ * the caller who wrote it is missing a count rather than holding the wrong kind of one, so it
206
+ * keeps the clause 0.6.221 wrote.
207
+ */
208
+ const bound = (value: unknown): boolean => value !== undefined && value !== null;
209
+ const mistyped = !clampable && bound(range.start) && bound(range.count);
190
210
  throw new EdfRangeError(
191
211
  `records ${describeRecordRange(range)} is not inside the ` +
192
212
  `${header.recordCount} data records this file contains. Next: ` +
193
213
  (clampable
194
214
  ? 'clamp the range against header.recordCount, or call index.locate(seconds) to find a ' +
195
215
  'record index for a time.'
196
- : 'pass a start and a count — there is no default, so a whole-file read is written out ' +
197
- `rather than implied, and here that is start 0, count ${header.recordCount}. Or call ` +
198
- 'readWindow(), which takes seconds and resolves the records itself.'),
216
+ : mistyped
217
+ ? 'pass the two bounds as numbers — this counts and adds them rather than using them as ' +
218
+ 'keys, so a BigInt or a string is not the same value here. Number(value) converts one.'
219
+ : 'pass a start and a count — there is no default, so a whole-file read is written out ' +
220
+ `rather than implied, and here that is start 0, count ${header.recordCount}. Or call ` +
221
+ 'readWindow(), which takes seconds and resolves the records itself.'),
199
222
  { requested: range, available },
200
223
  );
201
224
  }