edfcore 0.6.229 → 0.6.231
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/recording.d.ts.map +1 -1
- package/dist/recording.js +36 -3
- package/dist/recording.js.map +1 -1
- package/docs/CHANGELOG.md +30 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/recording.ts +38 -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.231";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/dist/recording.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recording.d.ts","sourceRoot":"","sources":["../src/recording.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAStD,OAAO,KAAK,EACV,UAAU,EACV,wBAAwB,EACxB,oBAAoB,EACpB,QAAQ,EAER,MAAM,EACN,SAAS,EACT,cAAc,EACd,YAAY,EACZ,SAAS,EAET,WAAW,EACX,WAAW,EACX,WAAW,EACX,eAAe,EACf,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAM9F;
|
|
1
|
+
{"version":3,"file":"recording.d.ts","sourceRoot":"","sources":["../src/recording.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuB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O,CAAC,QAAQ,CAAC,CAInB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,eAAe,EAC1B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,SAAS,QAAQ,EAAE,CAAC,CA6B9B;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,wBAAwB,GAAG,WAAW,GAC/C,OAAO,CAAC,oBAAoB,CAAC,CAW/B"}
|
package/dist/recording.js
CHANGED
|
@@ -55,13 +55,27 @@ export async function openEdf(source, options) {
|
|
|
55
55
|
* Exported for `stream.ts`, which must produce the byte-identical refusal `readWindow` does — not
|
|
56
56
|
* for the barrel. Validating a selection is not a public operation.
|
|
57
57
|
*/
|
|
58
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* What arrived, for a selection that is not an array. Never prints the value: it could be huge.
|
|
60
|
+
*
|
|
61
|
+
* The article is written out here rather than left off, which `io/source.ts` chose for its own
|
|
62
|
+
* version and gave the reason for: "An article needs to know that `Uint8Array` is said 'yoo-int',
|
|
63
|
+
* which no rule about vowels gets right, and getting it wrong is the kind of thing a reader notices
|
|
64
|
+
* instead of the message." That is the cost, and this hard-coded `a` was paying it — on `object`,
|
|
65
|
+
* which is exactly what the two arguments that reach it here are when they are wrong. A `Set` of
|
|
66
|
+
* indices, a `Map` from a config, an object keyed by label: `signalIndices is a object`. A header,
|
|
67
|
+
* a chunk or `header.signals` where the recording belongs: `the recording is a object`.
|
|
68
|
+
*
|
|
69
|
+
* No rule about vowels is needed. `undefined` and `null` are answered above without an article at
|
|
70
|
+
* all, and of the seven strings `typeof` can still return here — object, boolean, number, bigint,
|
|
71
|
+
* string, symbol, function — exactly one begins with a vowel.
|
|
72
|
+
*/
|
|
59
73
|
function describeSelection(value) {
|
|
60
74
|
if (value === null)
|
|
61
75
|
return 'null';
|
|
62
76
|
if (value === undefined)
|
|
63
77
|
return 'missing';
|
|
64
|
-
return `a ${typeof value}`;
|
|
78
|
+
return typeof value === 'object' ? 'an object' : `a ${typeof value}`;
|
|
65
79
|
}
|
|
66
80
|
/**
|
|
67
81
|
* The SELECTION itself, before any field of it is read.
|
|
@@ -160,7 +174,26 @@ export function assertRecording(recording, call) {
|
|
|
160
174
|
'timeline and the index, and this call needs all three. Next: pass what ' +
|
|
161
175
|
'openEdf(source) resolved to, rather than its .header.');
|
|
162
176
|
}
|
|
163
|
-
|
|
177
|
+
/*
|
|
178
|
+
* "Not the object openEdf() returns", said to someone holding the object openEdf() returns.
|
|
179
|
+
*
|
|
180
|
+
* `openEdf(source)` is async, so the object it returns IS a pending Promise — which is the one
|
|
181
|
+
* branch of this sentence where the tail denies what the head just named. The recording is what
|
|
182
|
+
* that Promise RESOLVES to, and every sibling guard in the package says it that way: 0.6.215 for
|
|
183
|
+
* the index ("it resolves to the index this takes"), 0.6.217 for the header, 0.6.229 for
|
|
184
|
+
* `validateHeader`. This is the guard all five reading calls share, and it was the one saying
|
|
185
|
+
* the opposite.
|
|
186
|
+
*
|
|
187
|
+
* The other arm is untouched: a number, a string or an object is not what `openEdf` returns, and
|
|
188
|
+
* for those the sentence was always true.
|
|
189
|
+
*/
|
|
190
|
+
if (typeof given?.then === 'function') {
|
|
191
|
+
throw new RangeError(`${call}(): the recording is a pending Promise — openEdf(source) is async, so that is what ` +
|
|
192
|
+
'it returns, and the recording is what it resolves to. Next: pass `await ' +
|
|
193
|
+
'openEdf(source)`.');
|
|
194
|
+
}
|
|
195
|
+
throw new RangeError(`${call}(): the recording is ${describeSelection(recording)}, not the object openEdf() ` +
|
|
196
|
+
'returns. Next: pass `await openEdf(source)`.');
|
|
164
197
|
}
|
|
165
198
|
/**
|
|
166
199
|
* The one required option with no default, refused in edfcore's own words.
|
package/dist/recording.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recording.js","sourceRoot":"","sources":["../src/recording.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAoBrD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,MAAkB,EAAE,OAAqB;IACrE,gGAAgG;IAChG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjD,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,MAAM,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACzE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC7C,CAAC;AAED;;;;;;;;;GASG;AACH
|
|
1
|
+
{"version":3,"file":"recording.js","sourceRoot":"","sources":["../src/recording.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,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E,OAAO,CAAC,CAAC,CAAC;IACrF,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,SAAuB,EACvB,OAAoB,EACpB,OAAgD;IAEhD,eAAe,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,MAAM,eAAe,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1F,gGAAgG;IAChG,6FAA6F;IAC7F,+FAA+F;IAC/F,iGAAiG;IACjG,OAAO,iBAAiB,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE;QACzD,gBAAgB,EAAE,SAAS,CAAC,QAAQ,CAAC,gBAAgB;QACrD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,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.231
|
|
10
|
+
|
|
11
|
+
- **Fixed** the refusal every read shares telling a pending Promise it was not the object `openEdf`
|
|
12
|
+
returns. `openEdf(source)` is async, so a pending Promise is exactly what it returns; the
|
|
13
|
+
recording is what that Promise RESOLVES to. 0.6.89 gave this guard a branch naming the argument,
|
|
14
|
+
and the shared tail then denied what the branch had just said.
|
|
15
|
+
- Every sibling says it the other way — 0.6.215 for the index ("it resolves to the index this
|
|
16
|
+
takes"), 0.6.217 for the header, 0.6.229 for `validateHeader`. This is the guard they were
|
|
17
|
+
modelled on, and the one saying the opposite.
|
|
18
|
+
- The `Next:` clause was right throughout and is unchanged, so this cost a reader nothing beyond a
|
|
19
|
+
sentence that could not both be true. The other arm keeps its wording: a number, a string or an
|
|
20
|
+
object is not what `openEdf` returns, and there the sentence was always true.
|
|
21
|
+
|
|
22
|
+
## 0.6.230
|
|
23
|
+
|
|
24
|
+
- **Fixed** `signalIndices is a object` and `the recording is a object`. `describeSelection` names
|
|
25
|
+
what arrived for `assertSignalIndices` and for `assertRecording`, and it built the phrase as
|
|
26
|
+
`a ${typeof value}`. Six of the seven things `typeof` can still return there take "a"; the
|
|
27
|
+
seventh is `object`, which is exactly what those two arguments are when they are wrong — a `Set`
|
|
28
|
+
of indices, a `Map` from a config, an object keyed by label, a header or `header.signals` where
|
|
29
|
+
the recording belongs.
|
|
30
|
+
- `io/source.ts` made the opposite choice for its own version and gave the reason: "An article
|
|
31
|
+
needs to know that `Uint8Array` is said 'yoo-int', which no rule about vowels gets right, and
|
|
32
|
+
getting it wrong is the kind of thing a reader notices instead of the message." This helper was
|
|
33
|
+
paying that cost on the one type it meets most.
|
|
34
|
+
- No rule about vowels is needed. `undefined` and `null` are answered above the article, and of the
|
|
35
|
+
seven strings that can still arrive exactly one begins with a vowel — which the test executes
|
|
36
|
+
rather than assuming.
|
|
37
|
+
- Nothing else changes: not the reason, not the `Next:` clause, not the class.
|
|
38
|
+
|
|
9
39
|
## 0.6.229
|
|
10
40
|
|
|
11
41
|
- **Fixed** `validateHeader` describing a header that had not arrived as one with no signals. The
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
package/src/recording.ts
CHANGED
|
@@ -76,11 +76,25 @@ export async function openEdf(source: ByteSource, options?: OpenOptions): Promis
|
|
|
76
76
|
* Exported for `stream.ts`, which must produce the byte-identical refusal `readWindow` does — not
|
|
77
77
|
* for the barrel. Validating a selection is not a public operation.
|
|
78
78
|
*/
|
|
79
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* What arrived, for a selection that is not an array. Never prints the value: it could be huge.
|
|
81
|
+
*
|
|
82
|
+
* The article is written out here rather than left off, which `io/source.ts` chose for its own
|
|
83
|
+
* version and gave the reason for: "An article needs to know that `Uint8Array` is said 'yoo-int',
|
|
84
|
+
* which no rule about vowels gets right, and getting it wrong is the kind of thing a reader notices
|
|
85
|
+
* instead of the message." That is the cost, and this hard-coded `a` was paying it — on `object`,
|
|
86
|
+
* which is exactly what the two arguments that reach it here are when they are wrong. A `Set` of
|
|
87
|
+
* indices, a `Map` from a config, an object keyed by label: `signalIndices is a object`. A header,
|
|
88
|
+
* a chunk or `header.signals` where the recording belongs: `the recording is a object`.
|
|
89
|
+
*
|
|
90
|
+
* No rule about vowels is needed. `undefined` and `null` are answered above without an article at
|
|
91
|
+
* all, and of the seven strings `typeof` can still return here — object, boolean, number, bigint,
|
|
92
|
+
* string, symbol, function — exactly one begins with a vowel.
|
|
93
|
+
*/
|
|
80
94
|
function describeSelection(value: unknown): string {
|
|
81
95
|
if (value === null) return 'null';
|
|
82
96
|
if (value === undefined) return 'missing';
|
|
83
|
-
return `a ${typeof value}`;
|
|
97
|
+
return typeof value === 'object' ? 'an object' : `a ${typeof value}`;
|
|
84
98
|
}
|
|
85
99
|
|
|
86
100
|
/**
|
|
@@ -196,10 +210,29 @@ export function assertRecording(
|
|
|
196
210
|
'openEdf(source) resolved to, rather than its .header.',
|
|
197
211
|
);
|
|
198
212
|
}
|
|
213
|
+
/*
|
|
214
|
+
* "Not the object openEdf() returns", said to someone holding the object openEdf() returns.
|
|
215
|
+
*
|
|
216
|
+
* `openEdf(source)` is async, so the object it returns IS a pending Promise — which is the one
|
|
217
|
+
* branch of this sentence where the tail denies what the head just named. The recording is what
|
|
218
|
+
* that Promise RESOLVES to, and every sibling guard in the package says it that way: 0.6.215 for
|
|
219
|
+
* the index ("it resolves to the index this takes"), 0.6.217 for the header, 0.6.229 for
|
|
220
|
+
* `validateHeader`. This is the guard all five reading calls share, and it was the one saying
|
|
221
|
+
* the opposite.
|
|
222
|
+
*
|
|
223
|
+
* The other arm is untouched: a number, a string or an object is not what `openEdf` returns, and
|
|
224
|
+
* for those the sentence was always true.
|
|
225
|
+
*/
|
|
226
|
+
if (typeof given?.then === 'function') {
|
|
227
|
+
throw new RangeError(
|
|
228
|
+
`${call}(): the recording is a pending Promise — openEdf(source) is async, so that is what ` +
|
|
229
|
+
'it returns, and the recording is what it resolves to. Next: pass `await ' +
|
|
230
|
+
'openEdf(source)`.',
|
|
231
|
+
);
|
|
232
|
+
}
|
|
199
233
|
throw new RangeError(
|
|
200
|
-
`${call}(): the recording is ${
|
|
201
|
-
|
|
202
|
-
}, not the object openEdf() returns. Next: pass \`await openEdf(source)\`.`,
|
|
234
|
+
`${call}(): the recording is ${describeSelection(recording)}, not the object openEdf() ` +
|
|
235
|
+
'returns. Next: pass `await openEdf(source)`.',
|
|
203
236
|
);
|
|
204
237
|
}
|
|
205
238
|
|