edfcore 0.6.181 → 0.6.183
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.
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/diagnostics/collector.d.ts.map +1 -1
- package/dist/diagnostics/collector.js +24 -5
- package/dist/diagnostics/collector.js.map +1 -1
- package/dist/header/lookup.d.ts.map +1 -1
- package/dist/header/lookup.js +26 -4
- package/dist/header/lookup.js.map +1 -1
- package/docs/CHANGELOG.md +30 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/diagnostics/collector.ts +28 -6
- package/src/header/lookup.ts +30 -5
package/dist/constants.d.ts
CHANGED
|
@@ -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.
|
|
112
|
+
export declare const VERSION = "0.6.183";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../src/diagnostics/collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAA2B,MAAM,cAAc,CAAC;AAEvE,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,KAAK,iBAAiB,EAA6B,MAAM,YAAY,CAAC;AAE/E;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,4FAA4F;IAC5F,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,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,CAAC,IAAI,EAAE,cAAc,GAAG,aAAa,CAkBpE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,aAAa,EACzB,KAAK,CAAC,EAAE,OAAO,EACf,SAAS,CAAC,EAAE,SAAS,aAAa,EAAE,GACnC,cAAc,CAUhB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,cAAc,CAEhF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6BzD;AAED;;;;GAIG;AACH,qBAAa,cAAc;;IACzB;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;gBAIb,OAAO,CAAC,EAAE,YAAY;IAKlC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;;;;;;OASG;IACH;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,cAAc;IAI5D,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI;IASlC,iGAAiG;IACjG,IAAI,WAAW,IAAI,SAAS,aAAa,EAAE,CAE1C;IAED,oEAAoE;IACpE,KAAK,IAAI,SAAS,aAAa,EAAE;CAKlC"}
|
|
@@ -138,11 +138,30 @@ export function fatalError(init, cause) {
|
|
|
138
138
|
* `null` and `undefined` still mean "no options", which is what they already meant.
|
|
139
139
|
*/
|
|
140
140
|
export function assertParseOptions(options) {
|
|
141
|
-
if (options
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
if (options !== undefined && typeof options !== 'object') {
|
|
142
|
+
throw new RangeError(`the parse options are ${describeValue(options)}, not an object — strict is a field on one, ` +
|
|
143
|
+
'so this parse collected its diagnostics rather than throwing on the first of them. ' +
|
|
144
|
+
'Next: pass strict on an options object.');
|
|
145
|
+
}
|
|
146
|
+
/*
|
|
147
|
+
* And the FIELD, once the object is there. `strict` is read as `options?.strict === true`, which
|
|
148
|
+
* is a coercion-proof test and therefore a silent one: `'true'`, `'1'` and `1` are all not-`true`,
|
|
149
|
+
* so every one of them parsed LENIENTLY.
|
|
150
|
+
*
|
|
151
|
+
* That is the same outcome the guard above exists to stop — the failure it describes as a file
|
|
152
|
+
* with a would-be diagnostic coming back "as a header carrying a list, from a caller who asked to
|
|
153
|
+
* receive no such file at all" — reached through the guard rather than past it. And text is
|
|
154
|
+
* exactly what arrives here: `strict` is the one boolean option in this package, and a flag, a
|
|
155
|
+
* query parameter and a config key all hand over a string, which is the argument `requireItemLimit`
|
|
156
|
+
* makes for its own coercion check.
|
|
157
|
+
*/
|
|
158
|
+
const strict = options?.strict;
|
|
159
|
+
if (strict !== undefined && typeof strict !== 'boolean') {
|
|
160
|
+
throw new RangeError(`options.strict must be true or false, and was ${describeValue(strict)}. It is read as ` +
|
|
161
|
+
'`=== true`, so anything else reads as false and this parse collected its diagnostics ' +
|
|
162
|
+
'rather than throwing on the first of them. Next: pass a boolean — a flag, a query ' +
|
|
163
|
+
'parameter and a config key all arrive as text, so compare with === "true" first.');
|
|
164
|
+
}
|
|
146
165
|
}
|
|
147
166
|
/**
|
|
148
167
|
* The one place `strict` is turned into a decision. Every module that finds a departure reports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../src/diagnostics/collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAA2B,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAA0B,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAwB/E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAuB,EAAE,MAAgC;IACzF,KAAK,MAAM,UAAU,IAAI,MAAM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AChD,CAAC;IAED,oEAAoE;IACpE,KAAK;QACH,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../src/header/lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAaxD;
|
|
1
|
+
{"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../src/header/lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAaxD;AA6FD,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,SAAS,EAAE,CAMlF;AAyED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoDjF;AAED;;;;;;;;;;;;;;GAcG;AACH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAM5F;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAQpE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAC3C,SAAS,SAAS,EAAE,CAgBtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAgBjE"}
|
package/dist/header/lookup.js
CHANGED
|
@@ -89,10 +89,32 @@ function assertLabel(label, call) {
|
|
|
89
89
|
* about the selector, the argument that was right.
|
|
90
90
|
*/
|
|
91
91
|
function assertHeaderSignals(header, call) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
const signals = header?.signals;
|
|
93
|
+
if (!Array.isArray(signals)) {
|
|
94
|
+
throw new RangeError(`${call}(): that is not a header — it has no signals. Next: pass recording.header, or what ` +
|
|
95
|
+
'parseHeader(bytes, sourceByteLength) returned.');
|
|
96
|
+
}
|
|
97
|
+
/*
|
|
98
|
+
* A CHUNK, whose `signals` array is the only other one in the package — and holds the other
|
|
99
|
+
* per-signal shape.
|
|
100
|
+
*
|
|
101
|
+
* Being an array was the whole test, so a chunk walked through and every function here answered
|
|
102
|
+
* about the samples instead of the declarations. `findSignals` and `matchSignals` returned `[]`,
|
|
103
|
+
* which is a real answer here and means "this file has no such channel" — said of a file that
|
|
104
|
+
* has one, because a chunk signal carries no `label` to match. `getSignal(chunk, 0)` was worse
|
|
105
|
+
* and returned the chunk signal itself, typed `EdfSignal`; `getSignal(chunk, label)` reached
|
|
106
|
+
* `quoteLabels` and threw V8's `Cannot read properties of undefined (reading 'length')`.
|
|
107
|
+
*
|
|
108
|
+
* Being an array of the RIGHT signals is the test. `index` is on a header signal and
|
|
109
|
+
* `signalIndex` on a chunk one, which is the distinction `assertChunkSignal` already draws from
|
|
110
|
+
* the other side (0.6.97).
|
|
111
|
+
*/
|
|
112
|
+
if (typeof signals[0]?.signalIndex === 'number') {
|
|
113
|
+
throw new RangeError(`${call}(): that is a chunk, not a header — a chunk has a signals array too, but its ` +
|
|
114
|
+
'entries carry the samples of each channel rather than the declaration, so none of them ' +
|
|
115
|
+
'has a label to look up. Next: pass recording.header, and reach a declaration from a ' +
|
|
116
|
+
'chunk with header.signals[chunkSignal.signalIndex].');
|
|
117
|
+
}
|
|
96
118
|
}
|
|
97
119
|
/** Every signal with this label, in signal order. Empty when none matches. */
|
|
98
120
|
export function findSignals(header, label) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup.js","sourceRoot":"","sources":["../../src/header/lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,+FAA+F;IAC/F,0FAA0F;IAC1F,+FAA+F;IAC/F,sBAAsB;IACtB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,UAAU,CAClB,qCAAqC,aAAa,CAAC,KAAK,CAAC,6BAA6B;YACpF,mDAAmD,CACtD,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACpC,OAAO,OAAO,KAAK,qBAAqB,IAAI,OAAO,KAAK,qBAAqB,CAAC;AAChF,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAS,cAAc,CAAC,QAAiB,EAAE,IAAY,EAAE,OAAe;IACtE,IAAI,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,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACjF,CAAC"}
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,36 @@ 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.183
|
|
10
|
+
|
|
11
|
+
- **Fixed** `getSignal`, `findSignals` and `matchSignals` answering about a chunk's samples. Their
|
|
12
|
+
shared guard, added in 0.6.127, tests `Array.isArray(header.signals)` — and `EdfChunk` has a
|
|
13
|
+
`signals` array too, the only other one in the package, holding the samples of each channel rather
|
|
14
|
+
than the declarations.
|
|
15
|
+
- `findSignals` and `matchSignals` returned `[]`, which is a real answer from those two and means
|
|
16
|
+
"this file has no such channel" — said of a file that has one, because a chunk signal carries no
|
|
17
|
+
label to match. `getSignal(chunk, 0)` returned the chunk signal itself typed as an `EdfSignal`, and
|
|
18
|
+
`getSignal(chunk, label)` threw V8's `Cannot read properties of undefined`, which is the exact
|
|
19
|
+
failure 0.6.127 removed.
|
|
20
|
+
- Being an array of the RIGHT signals is now the test: `index` is on a header signal and
|
|
21
|
+
`signalIndex` on a chunk one, the distinction `assertChunkSignal` has drawn from the other side
|
|
22
|
+
since 0.6.97.
|
|
23
|
+
|
|
24
|
+
## 0.6.182
|
|
25
|
+
|
|
26
|
+
- **Fixed** `strict` given as text parsing leniently and saying nothing. It is resolved everywhere as
|
|
27
|
+
`options?.strict === true` — the right way to read a boolean, and what makes the mistake silent:
|
|
28
|
+
`'true'`, `'1'` and `1` are each not-`true`.
|
|
29
|
+
- That is the outcome `assertParseOptions` exists for, in its own words — a file with a would-be
|
|
30
|
+
diagnostic coming back "as a header carrying a list, from a caller who asked to receive no such
|
|
31
|
+
file at all". It guarded the options being a bare value; the field inside them, which is the whole
|
|
32
|
+
of `ParseOptions`, was never checked, so the same failure was reachable through the guard.
|
|
33
|
+
- Text is what arrives here: `strict` is the only boolean option in the package, and a flag, a query
|
|
34
|
+
parameter and a config key all hand over a string. `requireItemLimit` makes the same argument for
|
|
35
|
+
its own coercion check.
|
|
36
|
+
- One check covers `parseHeader`, `readHeader`, `openEdf`, `decodeAnnotations`, `buildTimeline` and
|
|
37
|
+
`buildRecordIndex`, because all six reach `DiagnosticSink`.
|
|
38
|
+
|
|
9
39
|
## 0.6.181
|
|
10
40
|
|
|
11
41
|
- **Fixed** `readRecordBytes` blaming the record range for a wrong header. It is the lowest
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -175,12 +175,34 @@ export function fatalError(init: DiagnosticInit, cause?: unknown): EdfFormatErro
|
|
|
175
175
|
* `null` and `undefined` still mean "no options", which is what they already meant.
|
|
176
176
|
*/
|
|
177
177
|
export function assertParseOptions(options: unknown): void {
|
|
178
|
-
if (options
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
if (options !== undefined && typeof options !== 'object') {
|
|
179
|
+
throw new RangeError(
|
|
180
|
+
`the parse options are ${describeValue(options)}, not an object — strict is a field on one, ` +
|
|
181
|
+
'so this parse collected its diagnostics rather than throwing on the first of them. ' +
|
|
182
|
+
'Next: pass strict on an options object.',
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
/*
|
|
186
|
+
* And the FIELD, once the object is there. `strict` is read as `options?.strict === true`, which
|
|
187
|
+
* is a coercion-proof test and therefore a silent one: `'true'`, `'1'` and `1` are all not-`true`,
|
|
188
|
+
* so every one of them parsed LENIENTLY.
|
|
189
|
+
*
|
|
190
|
+
* That is the same outcome the guard above exists to stop — the failure it describes as a file
|
|
191
|
+
* with a would-be diagnostic coming back "as a header carrying a list, from a caller who asked to
|
|
192
|
+
* receive no such file at all" — reached through the guard rather than past it. And text is
|
|
193
|
+
* exactly what arrives here: `strict` is the one boolean option in this package, and a flag, a
|
|
194
|
+
* query parameter and a config key all hand over a string, which is the argument `requireItemLimit`
|
|
195
|
+
* makes for its own coercion check.
|
|
196
|
+
*/
|
|
197
|
+
const strict = (options as { strict?: unknown } | null | undefined)?.strict;
|
|
198
|
+
if (strict !== undefined && typeof strict !== 'boolean') {
|
|
199
|
+
throw new RangeError(
|
|
200
|
+
`options.strict must be true or false, and was ${describeValue(strict)}. It is read as ` +
|
|
201
|
+
'`=== true`, so anything else reads as false and this parse collected its diagnostics ' +
|
|
202
|
+
'rather than throwing on the first of them. Next: pass a boolean — a flag, a query ' +
|
|
203
|
+
'parameter and a config key all arrive as text, so compare with === "true" first.',
|
|
204
|
+
);
|
|
205
|
+
}
|
|
184
206
|
}
|
|
185
207
|
|
|
186
208
|
/**
|
package/src/header/lookup.ts
CHANGED
|
@@ -99,11 +99,36 @@ function assertLabel(label: unknown, call: string): void {
|
|
|
99
99
|
* about the selector, the argument that was right.
|
|
100
100
|
*/
|
|
101
101
|
function assertHeaderSignals(header: EdfHeader, call: string): void {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
const signals = (header as { signals?: unknown } | null | undefined)?.signals;
|
|
103
|
+
if (!Array.isArray(signals)) {
|
|
104
|
+
throw new RangeError(
|
|
105
|
+
`${call}(): that is not a header — it has no signals. Next: pass recording.header, or what ` +
|
|
106
|
+
'parseHeader(bytes, sourceByteLength) returned.',
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
/*
|
|
110
|
+
* A CHUNK, whose `signals` array is the only other one in the package — and holds the other
|
|
111
|
+
* per-signal shape.
|
|
112
|
+
*
|
|
113
|
+
* Being an array was the whole test, so a chunk walked through and every function here answered
|
|
114
|
+
* about the samples instead of the declarations. `findSignals` and `matchSignals` returned `[]`,
|
|
115
|
+
* which is a real answer here and means "this file has no such channel" — said of a file that
|
|
116
|
+
* has one, because a chunk signal carries no `label` to match. `getSignal(chunk, 0)` was worse
|
|
117
|
+
* and returned the chunk signal itself, typed `EdfSignal`; `getSignal(chunk, label)` reached
|
|
118
|
+
* `quoteLabels` and threw V8's `Cannot read properties of undefined (reading 'length')`.
|
|
119
|
+
*
|
|
120
|
+
* Being an array of the RIGHT signals is the test. `index` is on a header signal and
|
|
121
|
+
* `signalIndex` on a chunk one, which is the distinction `assertChunkSignal` already draws from
|
|
122
|
+
* the other side (0.6.97).
|
|
123
|
+
*/
|
|
124
|
+
if (typeof (signals[0] as { signalIndex?: unknown } | undefined)?.signalIndex === 'number') {
|
|
125
|
+
throw new RangeError(
|
|
126
|
+
`${call}(): that is a chunk, not a header — a chunk has a signals array too, but its ` +
|
|
127
|
+
'entries carry the samples of each channel rather than the declaration, so none of them ' +
|
|
128
|
+
'has a label to look up. Next: pass recording.header, and reach a declaration from a ' +
|
|
129
|
+
'chunk with header.signals[chunkSignal.signalIndex].',
|
|
130
|
+
);
|
|
131
|
+
}
|
|
107
132
|
}
|
|
108
133
|
|
|
109
134
|
/** Every signal with this label, in signal order. Empty when none matches. */
|