edfcore 0.6.294 → 0.6.295

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.
@@ -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.294";
112
+ export declare const VERSION = "0.6.295";
113
113
  //# sourceMappingURL=constants.d.ts.map
package/dist/constants.js CHANGED
@@ -79,5 +79,5 @@ export const SIGNAL_FIELD_BLOCK_OFFSETS = {
79
79
  reserved: 224,
80
80
  };
81
81
  /** Published package version. Kept in sync with package.json by a test. */
82
- export const VERSION = '0.6.294';
82
+ export const VERSION = '0.6.295';
83
83
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"blob.d.ts","sourceRoot":"","sources":["../../src/io/blob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAe,MAAM,aAAa,CAAC;AAGrE;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,CA8ErD"}
1
+ {"version":3,"file":"blob.d.ts","sourceRoot":"","sources":["../../src/io/blob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAe,MAAM,aAAa,CAAC;AAGrE;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,CAmFrD"}
package/dist/io/blob.js CHANGED
@@ -28,8 +28,13 @@ export function blobSource(blob) {
28
28
  const given = blob;
29
29
  if (typeof given?.size !== 'number' || typeof given.slice !== 'function') {
30
30
  throw new EdfSourceError('blobSource() needs a Blob or a File — an object with a size and a slice() — and received ' +
31
- `${describeValue(blob)}. Next: pass the File an <input type="file"> or a drop event hands ` +
32
- 'you, or byteSource(bytes) if you already have the bytes in memory.', { offset: 0, requestedLength: 0 });
31
+ `${describeValue(blob)}. ` +
32
+ (typeof blob?.then === 'function'
33
+ ? 'Next: await it — every other way a browser hands over a Blob is async. ' +
34
+ 'Response.blob(), FileSystemFileHandle.getFile() and ClipboardItem.getType() all ' +
35
+ 'resolve to one; only an <input type="file"> and a drop event give it to you outright.'
36
+ : 'Next: pass the File an <input type="file"> or a drop event hands you, or ' +
37
+ 'byteSource(bytes) if you already have the bytes in memory.'), { offset: 0, requestedLength: 0 });
33
38
  }
34
39
  /*
35
40
  * The SIZE, which the check above only established is a number.
@@ -1 +1 @@
1
- {"version":3,"file":"blob.js","sourceRoot":"","sources":["../../src/io/blob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/E;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAc;IACvC;;;;;;OAMG;IACH,MAAM,KAAK,GAAG,IAAmC,CAAC;IAClD,IAAI,OAAO,KAAK,EAAE,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;QACzE,MAAM,IAAI,cAAc,CACtB,2FAA2F;YACzF,GAAG,aAAa,CAAC,IAAI,CAAC,qEAAqE;YAC3F,oEAAoE,EACtE,EAAE,MAAM,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,CAClC,CAAC;IACJ,CAAC;IACD;;;;;;;;;;;;;;OAcG;IACH,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,cAAc,CACtB,0BAA0B,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C,CAAC;YACxB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;YAC5C,IAAI,MAAM,KAAK,CAAC;gBAAE,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;YAC3C,kEAAkE;YAClE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;YACvE,cAAc,CAAC,OAAO,CAAC,CAAC;YACxB;;;;;;;;;;;;eAYG;YACH,IAAI,MAAM,CAAC,UAAU,GAAG,MAAM,EAAE,CAAC;gBAC/B,MAAM,IAAI,cAAc,CACtB,iBAAiB,MAAM,KAAK,MAAM,GAAG,MAAM,GAAG,CAAC,yBAAyB;oBACtE,GAAG,MAAM,CAAC,UAAU,uCAAuC,UAAU,iBAAiB;oBACtF,qFAAqF;oBACrF,sFAAsF;oBACtF,2CAA2C,EAC7C,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,CAAC,UAAU,EAAE,CACvE,CAAC;YACJ,CAAC;YACD,OAAO,eAAe,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACjE,CAAC;KACF,CAAC;AACJ,CAAC"}
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,22 @@ 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.295
10
+
11
+ - **Fixed** `blobSource` answering a forgotten `await` with advice for a different program. The
12
+ subject was right — `describeValue` has said "a pending Promise" since 0.6.116 — and the `Next:`
13
+ clause said "pass the File an `<input type="file">` or a drop event hands you", which names the two
14
+ routes that are not async.
15
+ - Almost every way a browser hands over a Blob is: `Response.blob()`, `FileSystemFileHandle.getFile()`
16
+ and `ClipboardItem.getType()` all resolve to one, and `<input type="file">` and a drop event are the
17
+ only two that give it to you outright. So the reader who forgot the keyword on `r.blob()` was told
18
+ to go and find a file picker — the route they had deliberately not used.
19
+ - `assertByteSource` has named this keyword since 0.6.264, but for the ADAPTER: "byteSource,
20
+ blobSource and cachedSource do not" need awaiting. That is true and is a different question from
21
+ what their arguments need.
22
+ - The other arm is unchanged: a number, a string, a plain object or a `Uint8Array` is not a Blob, and
23
+ for those the file-picker advice was always the useful thing to say.
24
+
9
25
  ## 0.6.294
10
26
 
11
27
  - **Fixed** the form 0.6.293 left open and pinned: a pending Promise passed as the whole SELECTION.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.6.294",
3
+ "version": "0.6.295",
4
4
  "description": "Modern, typed, zero-dependency reader for EDF, EDF+, BDF and BDF+ biosignal files. Works in browsers and Node with true random access.",
5
5
  "keywords": [
6
6
  "edf",
package/src/constants.ts CHANGED
@@ -93,4 +93,4 @@ export const SIGNAL_FIELD_BLOCK_OFFSETS = {
93
93
  } as const;
94
94
 
95
95
  /** Published package version. Kept in sync with package.json by a test. */
96
- export const VERSION = '0.6.294';
96
+ export const VERSION = '0.6.295';
package/src/io/blob.ts CHANGED
@@ -32,8 +32,13 @@ export function blobSource(blob: BlobLike): ByteSource {
32
32
  if (typeof given?.size !== 'number' || typeof given.slice !== 'function') {
33
33
  throw new EdfSourceError(
34
34
  'blobSource() needs a Blob or a File — an object with a size and a slice() — and received ' +
35
- `${describeValue(blob)}. Next: pass the File an <input type="file"> or a drop event hands ` +
36
- 'you, or byteSource(bytes) if you already have the bytes in memory.',
35
+ `${describeValue(blob)}. ` +
36
+ (typeof (blob as { then?: unknown } | null | undefined)?.then === 'function'
37
+ ? 'Next: await it — every other way a browser hands over a Blob is async. ' +
38
+ 'Response.blob(), FileSystemFileHandle.getFile() and ClipboardItem.getType() all ' +
39
+ 'resolve to one; only an <input type="file"> and a drop event give it to you outright.'
40
+ : 'Next: pass the File an <input type="file"> or a drop event hands you, or ' +
41
+ 'byteSource(bytes) if you already have the bytes in memory.'),
37
42
  { offset: 0, requestedLength: 0 },
38
43
  );
39
44
  }