edfcore 0.6.233 → 0.6.234
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/io/source.d.ts.map +1 -1
- package/dist/io/source.js +19 -0
- package/dist/io/source.js.map +1 -1
- package/docs/CHANGELOG.md +15 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/io/source.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.234";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
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,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
|
@@ -226,6 +226,25 @@ function adapterFor(source) {
|
|
|
226
226
|
* primitive takes the header and the shape is easy to reach for. This is that confusion pointed
|
|
227
227
|
* the other way, and it is the one direction the package answered with a list.
|
|
228
228
|
*/
|
|
229
|
+
/*
|
|
230
|
+
* A FORGOTTEN AWAIT, and the one whose advice named the call that produced it.
|
|
231
|
+
*
|
|
232
|
+
* `fileSource(path)` is the only async adapter in the package — it opens the file to learn its
|
|
233
|
+
* size — and `openEdf(fileSource("recording.edf"))` is the Node quickstart with one keyword
|
|
234
|
+
* missing. The list below answered it with `fileSource(path) from "edfcore/node" for a file`,
|
|
235
|
+
* which is the call the reader had just made. 0.6.215 named that shape for the index guard:
|
|
236
|
+
* advice a reader follows and arrives back where they started.
|
|
237
|
+
*
|
|
238
|
+
* Four published entry points take a source — `openEdf`, `readHeader`, `readRecordBytes`,
|
|
239
|
+
* `inspectEdf` — and `cachedSource` wraps one, so all five said it.
|
|
240
|
+
*
|
|
241
|
+
* The other adapters are synchronous, which is why the keyword is worth naming rather than just
|
|
242
|
+
* the shape: there is exactly one call in this package whose result needs awaiting here.
|
|
243
|
+
*/
|
|
244
|
+
if (typeof source?.then === 'function') {
|
|
245
|
+
return ('that is a pending Promise — fileSource(path) from "edfcore/node" is async, so it is the ' +
|
|
246
|
+
'one adapter whose result needs awaiting; byteSource, blobSource and httpSource are not');
|
|
247
|
+
}
|
|
229
248
|
const opened = source;
|
|
230
249
|
if (typeof opened?.source?.read === 'function' && typeof opened.header === 'object') {
|
|
231
250
|
return 'that is a recording — it carries the source on .source rather than being one, so pass recording.source';
|
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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S,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,21 @@ 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.234
|
|
10
|
+
|
|
11
|
+
- **Fixed** the source guard answering a forgotten `await` with the call the reader had just made.
|
|
12
|
+
`fileSource(path)` is the only async adapter in the package — it opens the file to learn its size
|
|
13
|
+
— so `openEdf(fileSource("recording.edf"))` is the Node quickstart one keyword short, and the
|
|
14
|
+
generic list it got back has `fileSource(path) from "edfcore/node" for a file` as its middle
|
|
15
|
+
item. 0.6.215 named that shape for the index guard: advice a reader follows and arrives back
|
|
16
|
+
where they started.
|
|
17
|
+
- It is reached from five places — `openEdf`, `readHeader`, `readRecordBytes` and `inspectEdf` all
|
|
18
|
+
take a source, and `cachedSource` wraps one — and it is the first call of the package.
|
|
19
|
+
- The clause names the keyword and says which adapter needs it, because exactly one does:
|
|
20
|
+
`byteSource`, `blobSource` and `httpSource` are synchronous.
|
|
21
|
+
- It stays an `EdfSourceError` carrying `offset` and `requestedLength`, and every other wrong
|
|
22
|
+
argument keeps the adapter it had, including the recording named in 0.6.222.
|
|
23
|
+
|
|
9
24
|
## 0.6.233
|
|
10
25
|
|
|
11
26
|
- **Fixed** "or call readRecords(), which is the one that takes records" being said by three calls
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
package/src/io/source.ts
CHANGED
|
@@ -261,6 +261,27 @@ function adapterFor(source: unknown): string {
|
|
|
261
261
|
* primitive takes the header and the shape is easy to reach for. This is that confusion pointed
|
|
262
262
|
* the other way, and it is the one direction the package answered with a list.
|
|
263
263
|
*/
|
|
264
|
+
/*
|
|
265
|
+
* A FORGOTTEN AWAIT, and the one whose advice named the call that produced it.
|
|
266
|
+
*
|
|
267
|
+
* `fileSource(path)` is the only async adapter in the package — it opens the file to learn its
|
|
268
|
+
* size — and `openEdf(fileSource("recording.edf"))` is the Node quickstart with one keyword
|
|
269
|
+
* missing. The list below answered it with `fileSource(path) from "edfcore/node" for a file`,
|
|
270
|
+
* which is the call the reader had just made. 0.6.215 named that shape for the index guard:
|
|
271
|
+
* advice a reader follows and arrives back where they started.
|
|
272
|
+
*
|
|
273
|
+
* Four published entry points take a source — `openEdf`, `readHeader`, `readRecordBytes`,
|
|
274
|
+
* `inspectEdf` — and `cachedSource` wraps one, so all five said it.
|
|
275
|
+
*
|
|
276
|
+
* The other adapters are synchronous, which is why the keyword is worth naming rather than just
|
|
277
|
+
* the shape: there is exactly one call in this package whose result needs awaiting here.
|
|
278
|
+
*/
|
|
279
|
+
if (typeof (source as { then?: unknown } | null | undefined)?.then === 'function') {
|
|
280
|
+
return (
|
|
281
|
+
'that is a pending Promise — fileSource(path) from "edfcore/node" is async, so it is the ' +
|
|
282
|
+
'one adapter whose result needs awaiting; byteSource, blobSource and httpSource are not'
|
|
283
|
+
);
|
|
284
|
+
}
|
|
264
285
|
const opened = source as { source?: { read?: unknown }; header?: unknown } | null | undefined;
|
|
265
286
|
if (typeof opened?.source?.read === 'function' && typeof opened.header === 'object') {
|
|
266
287
|
return 'that is a recording — it carries the source on .source rather than being one, so pass recording.source';
|