edfcore 0.6.225 → 0.6.227
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/annotations-query.d.ts.map +1 -1
- package/dist/annotations-query.js +38 -2
- package/dist/annotations-query.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/sample-locate.d.ts.map +1 -1
- package/dist/sample-locate.js +15 -4
- package/dist/sample-locate.js.map +1 -1
- package/docs/CHANGELOG.md +36 -0
- package/package.json +1 -1
- package/src/annotations-query.ts +40 -2
- package/src/constants.ts +1 -1
- package/src/sample-locate.ts +16 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations-query.d.ts","sourceRoot":"","sources":["../src/annotations-query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAmDrE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,MAAM,EAAE,mBAAmB,GAC1B,SAAS,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"annotations-query.d.ts","sourceRoot":"","sources":["../src/annotations-query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAmDrE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,MAAM,EAAE,mBAAmB,GAC1B,SAAS,aAAa,EAAE,CA6E1B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GACnD,SAAS,aAAa,EAAE,CAiB1B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,SAAS,aAAa,EAAE,GACpC,aAAa,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CASlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,OAAO,EAAE,MAAM,GACd,SAAS,aAAa,EAAE,CA2B1B"}
|
|
@@ -82,8 +82,29 @@ export function filterAnnotationsByTime(annotations, window) {
|
|
|
82
82
|
// Cannot read properties of undefined (reading 'startSeconds')`, naming a field rather than the
|
|
83
83
|
// argument, with no `Next:` clause.
|
|
84
84
|
if (typeof window !== 'object' || window === null) {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
/*
|
|
86
|
+
* A NUMBER, which is an INSTANT, and the one wrong window whose advice led somewhere worse than
|
|
87
|
+
* where it started.
|
|
88
|
+
*
|
|
89
|
+
* "Pass a window carrying startSeconds and durationSeconds" is followable: a reader holding a
|
|
90
|
+
* cursor position writes `{ startSeconds: t, durationSeconds: 0 }`, because a window over one
|
|
91
|
+
* instant has no length. `annotationsAt`'s own docblock says what that does — the window form
|
|
92
|
+
* "works — a zero-length window — except that `filterAnnotationsByTime` returns nothing for a
|
|
93
|
+
* non-positive duration, so the obvious call returns an empty list at every position" — and it
|
|
94
|
+
* is why that function exists at all. So the advice ended in silence rather than in an error,
|
|
95
|
+
* at the call a viewer makes on every mouse move.
|
|
96
|
+
*
|
|
97
|
+
* The sibling is one export away and takes exactly what was passed. 0.6.88 made this argument
|
|
98
|
+
* for `readWindow` and `readRecords`, the other pair in this package that differ only in the
|
|
99
|
+
* unit they bound by.
|
|
100
|
+
*/
|
|
101
|
+
throw new RangeError(`filterAnnotationsByTime(): the window is ${describeValue(window)}, not an object.` +
|
|
102
|
+
(typeof window === 'number'
|
|
103
|
+
? ' That is an instant, and this call bounds events by an interval — a zero-length one ' +
|
|
104
|
+
'returns nothing, so a cursor position asked for as a window reads as no annotations ' +
|
|
105
|
+
'at every position. Next: call annotationsAt(annotations, seconds), which takes the ' +
|
|
106
|
+
'instant, or pass a window carrying startSeconds and durationSeconds.'
|
|
107
|
+
: ' Next: pass a window carrying startSeconds and durationSeconds.'));
|
|
87
108
|
}
|
|
88
109
|
/*
|
|
89
110
|
* An ARRAY, which is an object and therefore walked straight past the check above.
|
|
@@ -178,6 +199,21 @@ export function countAnnotationsByText(annotations) {
|
|
|
178
199
|
*/
|
|
179
200
|
export function annotationsAt(annotations, seconds) {
|
|
180
201
|
assertAnnotations(annotations, 'annotationsAt');
|
|
202
|
+
/*
|
|
203
|
+
* And the OTHER WAY. `filterAnnotationsByTime` is the neighbour this function's docblock names,
|
|
204
|
+
* the two differ only in whether they bound by an instant or by an interval, and a window here
|
|
205
|
+
* reached `secondsToTicks` — which answered "seconds must be a number of seconds, and was given
|
|
206
|
+
* an object. Next: convert it first". There is no conversion: a window is not a number spelled
|
|
207
|
+
* differently, and the reader was being sent to invent one.
|
|
208
|
+
*/
|
|
209
|
+
const given = seconds;
|
|
210
|
+
if (typeof given === 'object' && given !== null && !Array.isArray(given)) {
|
|
211
|
+
if ('startSeconds' in given || 'durationSeconds' in given) {
|
|
212
|
+
throw new RangeError('annotationsAt(): that is a time window, and this call takes a single instant in seconds. ' +
|
|
213
|
+
'Next: pass window.startSeconds for the instant under a cursor, or call ' +
|
|
214
|
+
'filterAnnotationsByTime(annotations, window), which is the one that takes an interval.');
|
|
215
|
+
}
|
|
216
|
+
}
|
|
181
217
|
const at = secondsToTicks(seconds, 'seconds');
|
|
182
218
|
return Object.freeze(annotations.filter((annotation) => {
|
|
183
219
|
const onset = annotation.onsetTicksFromFirstRecord;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations-query.js","sourceRoot":"","sources":["../src/annotations-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EAAE,eAAe,CAAC,CAAC;IAChD;;;;;;OAMG;IACH,MAAM,KAAK,GAAG,OAAmF,CAAC;IAClG,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzE,IAAI,cAAc,IAAI,KAAK,IAAI,iBAAiB,IAAI,KAAK,EAAE,CAAC;YAC1D,MAAM,IAAI,UAAU,CAClB,2FAA2F;gBACzF,yEAAyE;gBACzE,wFAAwF,CAC3F,CAAC;QACJ,CAAC;IACH,CAAC;IACD,MAAM,EAAE,GAAG,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,MAAM,CAClB,WAAW,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE;QAChC,MAAM,KAAK,GAAG,UAAU,CAAC,yBAAyB,CAAC;QACnD,MAAM,QAAQ,GAAG,UAAU,CAAC,aAAa,IAAI,EAAE,CAAC;QAChD,OAAO,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,IAAI,EAAE,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC/E,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
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.227";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sample-locate.d.ts","sourceRoot":"","sources":["../src/sample-locate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAyB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"sample-locate.d.ts","sourceRoot":"","sources":["../src/sample-locate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAyB,MAAM,YAAY,CAAC;AA4HzF;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CACtB,SAAS,EAAE,YAAY,EACvB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,iBAAiB,GAAG,SAAS,CAgE/B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,YAAY,EACvB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,MAAM,CAwCR;AAED,wFAAwF;AACxF,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,YAAY,EACvB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,MAAM,CAQR"}
|
package/dist/sample-locate.js
CHANGED
|
@@ -60,12 +60,23 @@ function resolveSignal(recording, signalIndex, call) {
|
|
|
60
60
|
* falls between two, which is the distinction 0.6.93 drew in `getSignal` itself. This is the
|
|
61
61
|
* other copy of that message (fixed in 0.6.133).
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
// The canonical decimal string is a SPELLING of an index here, not text: the lookup one line up
|
|
64
|
+
// IS `recording.header.signals['9']`, which is the property access `recording.header.signals[9]`
|
|
65
|
+
// is — the coercion `a-selection-from-json.test.ts` names. Until 0.6.226 it was called "not a
|
|
66
|
+
// number this header can be indexed by", which is the one thing it is: index 9 simply is not in
|
|
67
|
+
// a 3-signal file, and the message said the spelling was the problem. 0.6.218 made this argument
|
|
68
|
+
// for the refusal the five reading calls share and 0.6.225 for `decodeDigital`; this is the copy
|
|
69
|
+
// that predates both. `' 9 '` and `''` are not spellings this header can be indexed by, and
|
|
70
|
+
// reading 9 or 0 out of them would name a signal nobody wrote.
|
|
71
|
+
const index = typeof signalIndex === 'string' && signalIndex === String(Number(signalIndex))
|
|
72
|
+
? Number(signalIndex)
|
|
73
|
+
: signalIndex;
|
|
74
|
+
const problem = !Number.isFinite(index)
|
|
64
75
|
? `signalIndex is ${describeValue(signalIndex)}, not a number this header can be indexed by`
|
|
65
|
-
: Number.isInteger(
|
|
66
|
-
? `signalIndex ${
|
|
76
|
+
: Number.isInteger(index)
|
|
77
|
+
? `signalIndex ${index} is outside the ` +
|
|
67
78
|
`${recording.header.signals.length} signals this file declares`
|
|
68
|
-
: `signalIndex ${
|
|
79
|
+
: `signalIndex ${index} is not a whole number, so it falls between two signals ` +
|
|
69
80
|
'rather than outside them';
|
|
70
81
|
throw new EdfChannelNotFoundError(`${problem}. Next: pass an index from ` +
|
|
71
82
|
'header.dataSignalIndices, or resolve one with getSignal(header, label).', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sample-locate.js","sourceRoot":"","sources":["../src/sample-locate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD;;;;;GAKG;AACH,SAAS,aAAa,CAAC,SAAuB,EAAE,WAAmB,EAAE,IAAY;IAC/E,iGAAiG;IACjG,kGAAkG;IAClG,mGAAmG;IACnG,+FAA+F;IAC/F,eAAe,CAAC,SAAS,EAAE,IAAI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GAAiG;IACjG,+FAA+F;IAC/F,kFAAkF;IAClF,kCAAkC;IAClC,eAAe,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;IACnD,OAAO,cAAc,CAAC,kBAAkB,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AACjF,CAAC"}
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,42 @@ 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.227
|
|
10
|
+
|
|
11
|
+
- **Fixed** `annotationsAt` and `filterAnnotationsByTime` refusing each other's argument without
|
|
12
|
+
naming each other. They differ in one thing — an instant or an interval — and `annotationsAt`
|
|
13
|
+
exists because of it: the window form "works — a zero-length window — except that
|
|
14
|
+
`filterAnnotationsByTime` returns nothing for a non-positive duration, so the obvious call
|
|
15
|
+
returns an empty list at every position".
|
|
16
|
+
- A number where the window belongs was the costly direction, because its advice was followable. A
|
|
17
|
+
reader holding a cursor position, told to "pass a window carrying startSeconds and
|
|
18
|
+
durationSeconds", writes `{ startSeconds: t, durationSeconds: 0 }` — and gets `[]` at every
|
|
19
|
+
position, with no error, at the call a viewer makes on every mouse move. The sibling that takes
|
|
20
|
+
the number is one export away and is now named.
|
|
21
|
+
- A window where the instant belongs reached `secondsToTicks` and was told to "convert it first".
|
|
22
|
+
A window is not a number spelled differently, so there was nothing to convert; it now names
|
|
23
|
+
`window.startSeconds` and `filterAnnotationsByTime`. 0.6.88 made the same argument for
|
|
24
|
+
`readWindow` and `readRecords`, the other pair that differ only in the unit they bound by.
|
|
25
|
+
- Every other wrong window keeps the refusal it had, including the array one that names
|
|
26
|
+
`resolveTimeWindow`, and neither function's answer changes.
|
|
27
|
+
|
|
28
|
+
## 0.6.226
|
|
29
|
+
|
|
30
|
+
- **Fixed** `sampleAt`, `sampleStartTicksOf` and `sampleStartSecondsOf` calling the canonical
|
|
31
|
+
decimal string the one thing it is not. The lookup they share is
|
|
32
|
+
`recording.header.signals[signalIndex]`, so `signals['9']` is the property access `signals[9]` is
|
|
33
|
+
— the coercion `a-selection-from-json.test.ts` names and 0.6.135 deduplicates against — and a
|
|
34
|
+
selection built from JSON, a query parameter or a form arrives with its index as text.
|
|
35
|
+
- The refusal said `signalIndex is the string "9", not a number this header can be indexed by`.
|
|
36
|
+
Index 9 is simply not in a 3-signal file, which is the sentence the same guard prints for `9`;
|
|
37
|
+
the message blamed the spelling instead and sent a reader to convert a value that needed no
|
|
38
|
+
converting.
|
|
39
|
+
- 0.6.218 made this argument for the refusal the five reading calls share and 0.6.225 for
|
|
40
|
+
`decodeDigital`. This copy is older than both — 0.6.133 wrote it, and its comment calls itself
|
|
41
|
+
"the other copy of that message" — so all three now agree.
|
|
42
|
+
- Only a round-trip-exact spelling counts: `' 9 '`, `''` and `'0x10'` are still described as the
|
|
43
|
+
strings they are, a label is untouched, and every number keeps its sentence.
|
|
44
|
+
|
|
9
45
|
## 0.6.225
|
|
10
46
|
|
|
11
47
|
- **Fixed** `decodeDigital` answering three different selector mistakes with one sentence and the
|
package/package.json
CHANGED
package/src/annotations-query.ts
CHANGED
|
@@ -92,9 +92,30 @@ export function filterAnnotationsByTime(
|
|
|
92
92
|
// Cannot read properties of undefined (reading 'startSeconds')`, naming a field rather than the
|
|
93
93
|
// argument, with no `Next:` clause.
|
|
94
94
|
if (typeof window !== 'object' || window === null) {
|
|
95
|
+
/*
|
|
96
|
+
* A NUMBER, which is an INSTANT, and the one wrong window whose advice led somewhere worse than
|
|
97
|
+
* where it started.
|
|
98
|
+
*
|
|
99
|
+
* "Pass a window carrying startSeconds and durationSeconds" is followable: a reader holding a
|
|
100
|
+
* cursor position writes `{ startSeconds: t, durationSeconds: 0 }`, because a window over one
|
|
101
|
+
* instant has no length. `annotationsAt`'s own docblock says what that does — the window form
|
|
102
|
+
* "works — a zero-length window — except that `filterAnnotationsByTime` returns nothing for a
|
|
103
|
+
* non-positive duration, so the obvious call returns an empty list at every position" — and it
|
|
104
|
+
* is why that function exists at all. So the advice ended in silence rather than in an error,
|
|
105
|
+
* at the call a viewer makes on every mouse move.
|
|
106
|
+
*
|
|
107
|
+
* The sibling is one export away and takes exactly what was passed. 0.6.88 made this argument
|
|
108
|
+
* for `readWindow` and `readRecords`, the other pair in this package that differ only in the
|
|
109
|
+
* unit they bound by.
|
|
110
|
+
*/
|
|
95
111
|
throw new RangeError(
|
|
96
|
-
`filterAnnotationsByTime(): the window is ${describeValue(window)}, not an object
|
|
97
|
-
|
|
112
|
+
`filterAnnotationsByTime(): the window is ${describeValue(window)}, not an object.` +
|
|
113
|
+
(typeof window === 'number'
|
|
114
|
+
? ' That is an instant, and this call bounds events by an interval — a zero-length one ' +
|
|
115
|
+
'returns nothing, so a cursor position asked for as a window reads as no annotations ' +
|
|
116
|
+
'at every position. Next: call annotationsAt(annotations, seconds), which takes the ' +
|
|
117
|
+
'instant, or pass a window carrying startSeconds and durationSeconds.'
|
|
118
|
+
: ' Next: pass a window carrying startSeconds and durationSeconds.'),
|
|
98
119
|
);
|
|
99
120
|
}
|
|
100
121
|
/*
|
|
@@ -213,6 +234,23 @@ export function annotationsAt(
|
|
|
213
234
|
seconds: number,
|
|
214
235
|
): readonly EdfAnnotation[] {
|
|
215
236
|
assertAnnotations(annotations, 'annotationsAt');
|
|
237
|
+
/*
|
|
238
|
+
* And the OTHER WAY. `filterAnnotationsByTime` is the neighbour this function's docblock names,
|
|
239
|
+
* the two differ only in whether they bound by an instant or by an interval, and a window here
|
|
240
|
+
* reached `secondsToTicks` — which answered "seconds must be a number of seconds, and was given
|
|
241
|
+
* an object. Next: convert it first". There is no conversion: a window is not a number spelled
|
|
242
|
+
* differently, and the reader was being sent to invent one.
|
|
243
|
+
*/
|
|
244
|
+
const given = seconds as { startSeconds?: unknown; durationSeconds?: unknown } | null | undefined;
|
|
245
|
+
if (typeof given === 'object' && given !== null && !Array.isArray(given)) {
|
|
246
|
+
if ('startSeconds' in given || 'durationSeconds' in given) {
|
|
247
|
+
throw new RangeError(
|
|
248
|
+
'annotationsAt(): that is a time window, and this call takes a single instant in seconds. ' +
|
|
249
|
+
'Next: pass window.startSeconds for the instant under a cursor, or call ' +
|
|
250
|
+
'filterAnnotationsByTime(annotations, window), which is the one that takes an interval.',
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
216
254
|
const at = secondsToTicks(seconds, 'seconds');
|
|
217
255
|
return Object.freeze(
|
|
218
256
|
annotations.filter((annotation) => {
|
package/src/constants.ts
CHANGED
package/src/sample-locate.ts
CHANGED
|
@@ -63,12 +63,24 @@ function resolveSignal(recording: EdfRecording, signalIndex: number, call: strin
|
|
|
63
63
|
* falls between two, which is the distinction 0.6.93 drew in `getSignal` itself. This is the
|
|
64
64
|
* other copy of that message (fixed in 0.6.133).
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
// The canonical decimal string is a SPELLING of an index here, not text: the lookup one line up
|
|
67
|
+
// IS `recording.header.signals['9']`, which is the property access `recording.header.signals[9]`
|
|
68
|
+
// is — the coercion `a-selection-from-json.test.ts` names. Until 0.6.226 it was called "not a
|
|
69
|
+
// number this header can be indexed by", which is the one thing it is: index 9 simply is not in
|
|
70
|
+
// a 3-signal file, and the message said the spelling was the problem. 0.6.218 made this argument
|
|
71
|
+
// for the refusal the five reading calls share and 0.6.225 for `decodeDigital`; this is the copy
|
|
72
|
+
// that predates both. `' 9 '` and `''` are not spellings this header can be indexed by, and
|
|
73
|
+
// reading 9 or 0 out of them would name a signal nobody wrote.
|
|
74
|
+
const index =
|
|
75
|
+
typeof signalIndex === 'string' && signalIndex === String(Number(signalIndex))
|
|
76
|
+
? Number(signalIndex)
|
|
77
|
+
: signalIndex;
|
|
78
|
+
const problem = !Number.isFinite(index)
|
|
67
79
|
? `signalIndex is ${describeValue(signalIndex)}, not a number this header can be indexed by`
|
|
68
|
-
: Number.isInteger(
|
|
69
|
-
? `signalIndex ${
|
|
80
|
+
: Number.isInteger(index)
|
|
81
|
+
? `signalIndex ${index} is outside the ` +
|
|
70
82
|
`${recording.header.signals.length} signals this file declares`
|
|
71
|
-
: `signalIndex ${
|
|
83
|
+
: `signalIndex ${index} is not a whole number, so it falls between two signals ` +
|
|
72
84
|
'rather than outside them';
|
|
73
85
|
throw new EdfChannelNotFoundError(
|
|
74
86
|
`${problem}. Next: pass an index from ` +
|