edfcore 0.6.256 → 0.6.258
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/format-header.d.ts.map +1 -1
- package/dist/format-header.js +19 -6
- package/dist/format-header.js.map +1 -1
- package/dist/io/source.d.ts.map +1 -1
- package/dist/io/source.js +18 -0
- package/dist/io/source.js.map +1 -1
- package/docs/CHANGELOG.md +41 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/format-header.ts +19 -6
- package/src/io/source.ts +20 -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.258";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-header.d.ts","sourceRoot":"","sources":["../src/format-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH,OAAO,KAAK,EAAmB,SAAS,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAsElF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"format-header.d.ts","sourceRoot":"","sources":["../src/format-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH,OAAO,KAAK,EAAmB,SAAS,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAsElF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAyQrF"}
|
package/dist/format-header.js
CHANGED
|
@@ -147,14 +147,27 @@ export function formatHeader(header, options) {
|
|
|
147
147
|
*/
|
|
148
148
|
/*
|
|
149
149
|
* An ARRAY, which is an object, so the check below cannot see it. Same argument as `assertOptions`
|
|
150
|
-
* makes for the three listing formatters
|
|
151
|
-
*
|
|
152
|
-
*
|
|
150
|
+
* makes for the three listing formatters.
|
|
151
|
+
*
|
|
152
|
+
* NOT the same cost, and 0.6.247 wrote theirs in here. `redactFields` is the array-valued option
|
|
153
|
+
* that argument turns on, and it is not an option of this call — `FormatHeaderOptions` is
|
|
154
|
+
* `includePatientId` and `diagnosticsHint`. So the message named a field to pass on an object,
|
|
155
|
+
* and a reader who passed it got the silent failure `format.ts` reserves its strongest wording
|
|
156
|
+
* for: "the one option in this package whose silent failure sends a person's name somewhere it
|
|
157
|
+
* should not go", here spelled as an option that does nothing at all.
|
|
158
|
+
*
|
|
159
|
+
* And "nothing was withheld" is backwards for this formatter, which withholds by DEFAULT:
|
|
160
|
+
* `includePatientId` is opt-in and read as `=== true`, so an array left the identification OUT.
|
|
161
|
+
* The guard below says so correctly for a bare value, three lines away, and this one said the
|
|
162
|
+
* opposite of it.
|
|
153
163
|
*/
|
|
154
164
|
if (Array.isArray(options)) {
|
|
155
|
-
throw new RangeError('formatHeader(): the options are an array, and includePatientId and
|
|
156
|
-
'fields on the options rather than entries in a list — so
|
|
157
|
-
'
|
|
165
|
+
throw new RangeError('formatHeader(): the options are an array, and includePatientId and diagnosticsHint are ' +
|
|
166
|
+
'fields on the options rather than entries in a list — so the identification lines were ' +
|
|
167
|
+
'left out and the summary looks exactly like one that never asked for them. ' +
|
|
168
|
+
'Next: pass them on an object. Redaction is not an option here: this formatter omits the ' +
|
|
169
|
+
'identification unless includePatientId asks for it, and redactFields belongs to ' +
|
|
170
|
+
'formatDiagnostics(), which prints the raw bytes of a field it reports on.');
|
|
158
171
|
}
|
|
159
172
|
if (options !== undefined && typeof options !== 'object') {
|
|
160
173
|
throw new RangeError(`formatHeader(): the options are ${describeValue(options)}, not an object — ` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-header.js","sourceRoot":"","sources":["../src/format-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD;;;;;;;;;GASG;AACH,SAAS,UAAU,CAAC,IAAiC;IACnD,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,KAAa;IACxC,IAAI,KAAK,GAAG,EAAE;QAAE,OAAO,SAAS,CAAC;IACjC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,gBAAgB,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;IACxB,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,C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;YACvC,KAAK,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/io/source.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/io/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,WAAW,EAAE,CAAC;AAMvB;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAYhG;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CA8BxF;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAG1D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/io/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,WAAW,EAAE,CAAC;AAMvB;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAYhG;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CA8BxF;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAG1D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkExD;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAmCnE;AA+FD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,IAAI,UAAU,CAyC9E"}
|
package/dist/io/source.js
CHANGED
|
@@ -156,6 +156,24 @@ export function assertReadOptions(options) {
|
|
|
156
156
|
throw new RangeError(`the read options are an array, and maxMaterializeBytes and signal are fields on the options rather than ` +
|
|
157
157
|
'entries in a list. Next: pass them on an object.');
|
|
158
158
|
}
|
|
159
|
+
/*
|
|
160
|
+
* A PENDING PROMISE, which is the last shape that reaches this guard as an object and leaves as
|
|
161
|
+
* one. The array branch above closed the bracketed spelling in 0.6.245; this is the awaited one.
|
|
162
|
+
*
|
|
163
|
+
* Every field is read off the object, never awaited, so the cost is the one the branch below
|
|
164
|
+
* states in full: the read "took the default budget and no cancellation", and it RESOLVED. A
|
|
165
|
+
* viewer whose options come from a stored setting or a config file — anything behind an async
|
|
166
|
+
* helper of the caller's own — got an unbounded, uncancellable read that looked like a successful
|
|
167
|
+
* one. `assertRecording` coined the argument for naming the keyword (0.6.89) and the options are
|
|
168
|
+
* the one argument in this package where making the mistake produces data rather than an error.
|
|
169
|
+
*
|
|
170
|
+
* A property read, never a call: nothing here awaits, settles or subscribes to anything.
|
|
171
|
+
*/
|
|
172
|
+
if (typeof options?.then === 'function') {
|
|
173
|
+
throw new RangeError('the read options are a pending Promise, and every field is read off the object rather than ' +
|
|
174
|
+
'awaited — so this read took the default budget and no cancellation, and it resolved. ' +
|
|
175
|
+
'Next: await them before passing them.');
|
|
176
|
+
}
|
|
159
177
|
if (options !== undefined && options !== null && typeof options !== 'object') {
|
|
160
178
|
throw new RangeError(`the read options are ${describeValue(options)}, not an object — maxMaterializeBytes and ` +
|
|
161
179
|
'signal are fields on one, so this read took the default budget and no cancellation. ' +
|
package/dist/io/source.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/io/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,SAAS,gBAAgB,CAAC,QAAiB;IACzC,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,QAAoB,EAAE,MAAc,EAAE,MAAc;IAClF,MAAM,cAAc,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,cAAc,KAAK,MAAM;QAAE,OAAO,QAAQ,CAAC;IAC/C,MAAM,GAAG,GACP,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,kCAAkC,CAAC,CA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,SAAS,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;QACtF;;;;;;;;;;;;;;;;WAgBG;QACH,IAAI,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,UAAU,CAAC,IAAK,SAAS,CAAC,UAAqB,IAAI,CAAC;YAAE,OAAO;QAChG;;;;;;WAMG;QACH,MAAM,IAAI,UAAU,CAClB,wFAAwF;YACtF,GAAG,aAAa,CAAC,SAAS,CAAC,UAAU,CAAC,gDAAgD;YACtF,2FAA2F;YAC3F,kFAAkF,CACrF,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,IAAI,cAAc,CACtB,mFAAmF;QACjF,GAAG,QAAQ,WAAW,UAAU,CAAC,MAAM,CAAC,GAAG,EAC7C,EAAE,MAAM,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,CAClC,CAAC;AACJ,CAAC"}
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,47 @@ 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.258
|
|
10
|
+
|
|
11
|
+
- **Fixed** read options handed over as the Promise that will produce them being accepted. Every field
|
|
12
|
+
is read off the object rather than awaited, so `options.signal` and `options.maxMaterializeBytes`
|
|
13
|
+
were both `undefined` and both took their defaults: the cost the bare-value branch already spells
|
|
14
|
+
out, "took the default budget and no cancellation" — and the read RESOLVED.
|
|
15
|
+
- This is the argument where the mistake produces data rather than an error. Every other forgotten
|
|
16
|
+
`await` lands on a guard — `formatHeader(readHeader(source))` throws, `mergeChunks(readWindow(...))`
|
|
17
|
+
throws — while `readWindow(recording, selection, optionsFor(session))` came back with the samples,
|
|
18
|
+
unbounded and uncancellable, indistinguishable from a read whose options were honoured.
|
|
19
|
+
- It closes the last object shape that reached `assertReadOptions` and left as one. The `AbortSignal`
|
|
20
|
+
passed whole went in 0.6.155, the bracketed spelling in 0.6.245. Covers `readWindow`, `readRecords`,
|
|
21
|
+
`readAnnotations`, `readEnvelope`, `readEnvelopeAtResolution`, `readTriggers`, `streamRecords`,
|
|
22
|
+
`readRecordBytes`, `buildRecordIndex`, `inspectEdf`, `validateRecording` (wired up in 0.6.252) and
|
|
23
|
+
`index.locate`/`index.onsetTicks`.
|
|
24
|
+
- A property read, never a call: a Promise that never settles is still refused rather than awaited.
|
|
25
|
+
The three existing branches keep their own sentences, and a real options object is unchanged.
|
|
26
|
+
- Not yet closed: `assertParseOptions` — `openEdf`, `readHeader` and `decodeAnnotations` still take a
|
|
27
|
+
pending Promise where `strict` belongs. Same shape, smaller cost, and its own release.
|
|
28
|
+
|
|
29
|
+
## 0.6.257
|
|
30
|
+
|
|
31
|
+
- **Fixed** `formatHeader`'s array refusal naming `redactFields`, which is not an option of this call.
|
|
32
|
+
`FormatHeaderOptions` is `includePatientId` and `diagnosticsHint`, and nothing here reads a
|
|
33
|
+
`redactFields` at all — so the message told a reader to pass it on an object, and passing it does
|
|
34
|
+
nothing. That is the failure `format.ts` reserves its strongest wording for, "the one option in this
|
|
35
|
+
package whose silent failure sends a person's name somewhere it should not go", reached by following
|
|
36
|
+
edfcore's own advice and around `assertRedactableFields`, which exists so a name outside the
|
|
37
|
+
vocabulary "is refused rather than ignored".
|
|
38
|
+
- 0.6.247 wrote `assertOptions`' argument into this guard when it gave the four formatters an array
|
|
39
|
+
branch. It holds for the three listing formatters, whose `redactFields` really is the array-valued
|
|
40
|
+
option that makes the mistake likely. It does not hold here.
|
|
41
|
+
- **Fixed** the same message stating the consequence backwards. This formatter withholds by default —
|
|
42
|
+
`includePatientId` is opt-in and read as `=== true` — so an array leaves the identification OUT, not
|
|
43
|
+
in. "Nothing was withheld" was the opposite of the bare-value guard three lines below it, which has
|
|
44
|
+
always said "the identification lines would have been left out and the summary would look exactly
|
|
45
|
+
like one that never asked for them". Two copies of one fact, in one function, disagreeing about
|
|
46
|
+
which way a person's name leaks.
|
|
47
|
+
- The refusal now names the two real options, states the direction both guards agree on, and says
|
|
48
|
+
where redaction lives: `formatDiagnostics()`, which prints the raw bytes of a field it reports on.
|
|
49
|
+
|
|
9
50
|
## 0.6.256
|
|
10
51
|
|
|
11
52
|
- **Fixed** `decodeStatusWord(digital)` — the whole Status channel where one sample of it belongs —
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
package/src/format-header.ts
CHANGED
|
@@ -157,15 +157,28 @@ export function formatHeader(header: EdfHeader, options?: FormatHeaderOptions):
|
|
|
157
157
|
*/
|
|
158
158
|
/*
|
|
159
159
|
* An ARRAY, which is an object, so the check below cannot see it. Same argument as `assertOptions`
|
|
160
|
-
* makes for the three listing formatters
|
|
161
|
-
*
|
|
162
|
-
*
|
|
160
|
+
* makes for the three listing formatters.
|
|
161
|
+
*
|
|
162
|
+
* NOT the same cost, and 0.6.247 wrote theirs in here. `redactFields` is the array-valued option
|
|
163
|
+
* that argument turns on, and it is not an option of this call — `FormatHeaderOptions` is
|
|
164
|
+
* `includePatientId` and `diagnosticsHint`. So the message named a field to pass on an object,
|
|
165
|
+
* and a reader who passed it got the silent failure `format.ts` reserves its strongest wording
|
|
166
|
+
* for: "the one option in this package whose silent failure sends a person's name somewhere it
|
|
167
|
+
* should not go", here spelled as an option that does nothing at all.
|
|
168
|
+
*
|
|
169
|
+
* And "nothing was withheld" is backwards for this formatter, which withholds by DEFAULT:
|
|
170
|
+
* `includePatientId` is opt-in and read as `=== true`, so an array left the identification OUT.
|
|
171
|
+
* The guard below says so correctly for a bare value, three lines away, and this one said the
|
|
172
|
+
* opposite of it.
|
|
163
173
|
*/
|
|
164
174
|
if (Array.isArray(options)) {
|
|
165
175
|
throw new RangeError(
|
|
166
|
-
'formatHeader(): the options are an array, and includePatientId and
|
|
167
|
-
'fields on the options rather than entries in a list — so
|
|
168
|
-
'
|
|
176
|
+
'formatHeader(): the options are an array, and includePatientId and diagnosticsHint are ' +
|
|
177
|
+
'fields on the options rather than entries in a list — so the identification lines were ' +
|
|
178
|
+
'left out and the summary looks exactly like one that never asked for them. ' +
|
|
179
|
+
'Next: pass them on an object. Redaction is not an option here: this formatter omits the ' +
|
|
180
|
+
'identification unless includePatientId asks for it, and redactFields belongs to ' +
|
|
181
|
+
'formatDiagnostics(), which prints the raw bytes of a field it reports on.',
|
|
169
182
|
);
|
|
170
183
|
}
|
|
171
184
|
if (options !== undefined && typeof options !== 'object') {
|
package/src/io/source.ts
CHANGED
|
@@ -180,6 +180,26 @@ export function assertReadOptions(options: unknown): void {
|
|
|
180
180
|
'entries in a list. Next: pass them on an object.',
|
|
181
181
|
);
|
|
182
182
|
}
|
|
183
|
+
/*
|
|
184
|
+
* A PENDING PROMISE, which is the last shape that reaches this guard as an object and leaves as
|
|
185
|
+
* one. The array branch above closed the bracketed spelling in 0.6.245; this is the awaited one.
|
|
186
|
+
*
|
|
187
|
+
* Every field is read off the object, never awaited, so the cost is the one the branch below
|
|
188
|
+
* states in full: the read "took the default budget and no cancellation", and it RESOLVED. A
|
|
189
|
+
* viewer whose options come from a stored setting or a config file — anything behind an async
|
|
190
|
+
* helper of the caller's own — got an unbounded, uncancellable read that looked like a successful
|
|
191
|
+
* one. `assertRecording` coined the argument for naming the keyword (0.6.89) and the options are
|
|
192
|
+
* the one argument in this package where making the mistake produces data rather than an error.
|
|
193
|
+
*
|
|
194
|
+
* A property read, never a call: nothing here awaits, settles or subscribes to anything.
|
|
195
|
+
*/
|
|
196
|
+
if (typeof (options as { then?: unknown } | null | undefined)?.then === 'function') {
|
|
197
|
+
throw new RangeError(
|
|
198
|
+
'the read options are a pending Promise, and every field is read off the object rather than ' +
|
|
199
|
+
'awaited — so this read took the default budget and no cancellation, and it resolved. ' +
|
|
200
|
+
'Next: await them before passing them.',
|
|
201
|
+
);
|
|
202
|
+
}
|
|
183
203
|
if (options !== undefined && options !== null && typeof options !== 'object') {
|
|
184
204
|
throw new RangeError(
|
|
185
205
|
`the read options are ${describeValue(options)}, not an object — maxMaterializeBytes and ` +
|