edfcore 0.6.212 → 0.6.214
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/errors.d.ts.map +1 -1
- package/dist/errors.js +19 -2
- package/dist/errors.js.map +1 -1
- package/dist/text/describe.d.ts.map +1 -1
- package/dist/text/describe.js +22 -0
- package/dist/text/describe.js.map +1 -1
- package/docs/CHANGELOG.md +29 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/errors.ts +19 -2
- package/src/text/describe.ts +21 -0
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.214";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEhF;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAI5F;;;;GAIG;AACH,8BAAsB,QAAS,SAAQ,KAAK;IAC1C,QAAQ,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;gBAEjC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAS3D;AAED;;;;;;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
|
this.name = 'EdfRangeError';
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
/*
|
|
105
|
+
* The two FIELDS, not the argument they came from.
|
|
106
|
+
*
|
|
107
|
+
* `requested` is declared a `RecordRange` and was whatever the caller passed, because the range
|
|
108
|
+
* guards hand over the value they refused. So a chunk given where its own `.records` belongs put
|
|
109
|
+
* the entire chunk on the error — `signals`, and every sample in every `digital` array — under a
|
|
110
|
+
* field a handler reads `.start` off and gets `undefined` from. A structured log or a
|
|
111
|
+
* `JSON.stringify(error)` then writes a recording's samples into one line, which is the outcome
|
|
112
|
+
* `describeRecordRange` and `quoteLabels` both exist to prevent: "printing its contents is how a
|
|
113
|
+
* 512-signal selection ends up on one line".
|
|
114
|
+
*
|
|
115
|
+
* Narrowed here rather than at each guard, so no later one can reintroduce it. A well-formed
|
|
116
|
+
* range is unchanged; a wrong shape keeps whatever it had under those two names and nothing
|
|
117
|
+
* else, which is the same pair the message prints.
|
|
118
|
+
*/
|
|
119
|
+
const requested = init.requested;
|
|
120
|
+
const available = init.available;
|
|
121
|
+
this.requested = { start: requested?.start, count: requested?.count };
|
|
122
|
+
this.available = { start: available?.start, count: available?.count };
|
|
106
123
|
}
|
|
107
124
|
}
|
|
108
125
|
/** A `ByteSource` broke its contract: it returned a different number of bytes than asked. */
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH,MAAM,iBAAiB,GAA6B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAEtE;;;;GAIG;AACH,MAAM,OAAgB,QAAS,SAAQ,KAAK;IAG1C,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAmC,CAAC,CAAC;QACpD,0FAA0F;QAC1F,wFAAwF;QACxF,yFAAyF;QACzF,0FAA0F;QAC1F,qFAAqF;QACrF,IAAI,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AAG,SAAkB,CAAC;IAClC,QAAQ,CAAkB;IAC1B,eAAe,CAAoB;IAE5C,YACE,OAAe,EACf,IAAwF;QAExF,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/text/describe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/text/describe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAwCpD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAC/E,MAAM,CAER"}
|
package/dist/text/describe.js
CHANGED
|
@@ -38,6 +38,28 @@ export function describeValue(value) {
|
|
|
38
38
|
if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) {
|
|
39
39
|
return Object.prototype.toString.call(value).slice(8, -1);
|
|
40
40
|
}
|
|
41
|
+
/*
|
|
42
|
+
* A PENDING PROMISE, which is the one object worth naming.
|
|
43
|
+
*
|
|
44
|
+
* `assertRecording` made the argument in 0.6.89 and coined the phrase: a forgotten `await` "passes
|
|
45
|
+
* the pending Promise `openEdf` returns", and a message that names an internal field instead says
|
|
46
|
+
* "nothing about the one keyword that fixes it". It then named it for the recording alone.
|
|
47
|
+
*
|
|
48
|
+
* Five async calls in this package resolve to values other guards take: `readHeader` to a header,
|
|
49
|
+
* `buildRecordIndex` to an index, `readWindow` to the chunk array, `validateRecording` to a report,
|
|
50
|
+
* `readAnnotations` to a result. So `formatHeader(readHeader(source))`,
|
|
51
|
+
* `mergeChunks(readWindow(recording, selection))` and `contiguityOf(buildRecordIndex(recording))`
|
|
52
|
+
* are all one keyword short — and every one of them was told it had passed "an object", which is
|
|
53
|
+
* true of the thing they meant to pass too.
|
|
54
|
+
*
|
|
55
|
+
* Named here rather than at each guard, because this is the module whose whole subject is a value
|
|
56
|
+
* "said in a way that cannot read as an accepted one", and roughly forty messages read their
|
|
57
|
+
* subject out of it.
|
|
58
|
+
*
|
|
59
|
+
* A property read, never a call: nothing here awaits, settles or subscribes to anything.
|
|
60
|
+
*/
|
|
61
|
+
if (typeof value.then === 'function')
|
|
62
|
+
return 'a pending Promise';
|
|
41
63
|
// `an object` covers an array too: a reader who passed one knows which they passed, and printing
|
|
42
64
|
// its contents is how a 512-signal selection ends up on one line behind `edfcore: `.
|
|
43
65
|
return typeof value === 'object' ? 'an object' : `a ${typeof value}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/text/describe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iGAAiG;AACjG,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,cAAc,KAAK,GAAG,CAAC;IAC7D,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,cAAc,IAAI,CAA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AAE,OAAO,WAAW,CAAC;IAC5C;;;;;;OAMG;IACH,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;QAC9D,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IACD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,OAAQ,KAA4B,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,mBAAmB,CAAC;IACzF,iGAAiG;IACjG,qFAAqF;IACrF,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,OAAO,KAAK,EAAE,CAAC;AACvE,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAgF;IAEhF,OAAO,YAAY,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC;AAC5F,CAAC"}
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,35 @@ 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.214
|
|
10
|
+
|
|
11
|
+
- **Fixed** a forgotten `await` being described as "an object". 0.6.89 made the argument for the
|
|
12
|
+
recording and coined the phrase — a message that names an internal field says "nothing about the
|
|
13
|
+
one keyword that fixes it" — and `assertRecording` was the only guard that said "a pending
|
|
14
|
+
Promise".
|
|
15
|
+
- Five async calls here resolve to values other guards take: `readHeader` to a header,
|
|
16
|
+
`buildRecordIndex` to an index, `readWindow` to the chunk array, `validateRecording` to a report,
|
|
17
|
+
`readAnnotations` to a result. So `mergeChunks(readWindow(recording, selection))` and
|
|
18
|
+
`contiguityOf(buildRecordIndex(recording))` are one keyword short, and each was told it had passed
|
|
19
|
+
"an object" — which is true of the thing it meant to pass too.
|
|
20
|
+
- Named in `describeValue`, the module whose subject is a value "said in a way that cannot read as an
|
|
21
|
+
accepted one", so roughly forty messages get it at once. A property read, never a call: nothing
|
|
22
|
+
awaits, settles or subscribes to anything.
|
|
23
|
+
|
|
24
|
+
## 0.6.213
|
|
25
|
+
|
|
26
|
+
- **Fixed** `EdfRangeError.requested` carrying whatever was refused. The field is declared a
|
|
27
|
+
`RecordRange`, and the range guards handed over the value they had just rejected — so a chunk given
|
|
28
|
+
where its own `.records` belongs put the ENTIRE CHUNK on the error: `signals`, and every sample in
|
|
29
|
+
every `digital` array, under a field a handler reads `.start` off and gets `undefined` from.
|
|
30
|
+
- The cost is not the type. `JSON.stringify(error)` and every structured logger walk own enumerable
|
|
31
|
+
properties, so one refused call wrote a recording's samples into a log line — the outcome
|
|
32
|
+
`describeRecordRange` and `quoteLabels` both exist to prevent: "printing its contents is how a
|
|
33
|
+
512-signal selection ends up on one line".
|
|
34
|
+
- Narrowed in the constructor rather than at each guard, so no later one can reintroduce it. A
|
|
35
|
+
well-formed range is unchanged, the `{}` stand-in for an absent one still reads as an object, and a
|
|
36
|
+
wrong shape keeps whatever it had under `start` and `count` — the pair the message prints.
|
|
37
|
+
|
|
9
38
|
## 0.6.212
|
|
10
39
|
|
|
11
40
|
- **Fixed** `options.signal` given the `AbortController` rather than the signal on it. A controller
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
package/src/errors.ts
CHANGED
|
@@ -163,8 +163,25 @@ export class EdfRangeError extends EdfError {
|
|
|
163
163
|
) {
|
|
164
164
|
super(message, { cause: init.cause });
|
|
165
165
|
this.name = 'EdfRangeError';
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
/*
|
|
167
|
+
* The two FIELDS, not the argument they came from.
|
|
168
|
+
*
|
|
169
|
+
* `requested` is declared a `RecordRange` and was whatever the caller passed, because the range
|
|
170
|
+
* guards hand over the value they refused. So a chunk given where its own `.records` belongs put
|
|
171
|
+
* the entire chunk on the error — `signals`, and every sample in every `digital` array — under a
|
|
172
|
+
* field a handler reads `.start` off and gets `undefined` from. A structured log or a
|
|
173
|
+
* `JSON.stringify(error)` then writes a recording's samples into one line, which is the outcome
|
|
174
|
+
* `describeRecordRange` and `quoteLabels` both exist to prevent: "printing its contents is how a
|
|
175
|
+
* 512-signal selection ends up on one line".
|
|
176
|
+
*
|
|
177
|
+
* Narrowed here rather than at each guard, so no later one can reintroduce it. A well-formed
|
|
178
|
+
* range is unchanged; a wrong shape keeps whatever it had under those two names and nothing
|
|
179
|
+
* else, which is the same pair the message prints.
|
|
180
|
+
*/
|
|
181
|
+
const requested = init.requested as { start?: number; count?: number } | null | undefined;
|
|
182
|
+
const available = init.available as { start?: number; count?: number } | null | undefined;
|
|
183
|
+
this.requested = { start: requested?.start, count: requested?.count } as RecordRange;
|
|
184
|
+
this.available = { start: available?.start, count: available?.count } as RecordRange;
|
|
168
185
|
}
|
|
169
186
|
}
|
|
170
187
|
|
package/src/text/describe.ts
CHANGED
|
@@ -34,6 +34,27 @@ export function describeValue(value: unknown): string {
|
|
|
34
34
|
if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) {
|
|
35
35
|
return Object.prototype.toString.call(value).slice(8, -1);
|
|
36
36
|
}
|
|
37
|
+
/*
|
|
38
|
+
* A PENDING PROMISE, which is the one object worth naming.
|
|
39
|
+
*
|
|
40
|
+
* `assertRecording` made the argument in 0.6.89 and coined the phrase: a forgotten `await` "passes
|
|
41
|
+
* the pending Promise `openEdf` returns", and a message that names an internal field instead says
|
|
42
|
+
* "nothing about the one keyword that fixes it". It then named it for the recording alone.
|
|
43
|
+
*
|
|
44
|
+
* Five async calls in this package resolve to values other guards take: `readHeader` to a header,
|
|
45
|
+
* `buildRecordIndex` to an index, `readWindow` to the chunk array, `validateRecording` to a report,
|
|
46
|
+
* `readAnnotations` to a result. So `formatHeader(readHeader(source))`,
|
|
47
|
+
* `mergeChunks(readWindow(recording, selection))` and `contiguityOf(buildRecordIndex(recording))`
|
|
48
|
+
* are all one keyword short — and every one of them was told it had passed "an object", which is
|
|
49
|
+
* true of the thing they meant to pass too.
|
|
50
|
+
*
|
|
51
|
+
* Named here rather than at each guard, because this is the module whose whole subject is a value
|
|
52
|
+
* "said in a way that cannot read as an accepted one", and roughly forty messages read their
|
|
53
|
+
* subject out of it.
|
|
54
|
+
*
|
|
55
|
+
* A property read, never a call: nothing here awaits, settles or subscribes to anything.
|
|
56
|
+
*/
|
|
57
|
+
if (typeof (value as { then?: unknown }).then === 'function') return 'a pending Promise';
|
|
37
58
|
// `an object` covers an array too: a reader who passed one knows which they passed, and printing
|
|
38
59
|
// its contents is how a 512-signal selection ends up on one line behind `edfcore: `.
|
|
39
60
|
return typeof value === 'object' ? 'an object' : `a ${typeof value}`;
|