edfcore 0.4.90 → 0.4.91

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.4.90";
112
+ export declare const VERSION = "0.4.91";
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.4.90';
82
+ export const VERSION = '0.4.91';
83
83
  //# sourceMappingURL=constants.js.map
@@ -7,5 +7,10 @@
7
7
  * and this adapter retains nothing the caller does not already hold.
8
8
  */
9
9
  import type { ByteSource } from '../types.js';
10
+ /**
11
+ * A `ByteSource` over bytes already in memory, for a file you fetched yourself or a fixture in a
12
+ * test. The signedness of the view is checked at construction rather than at first read: an
13
+ * `Int8Array` has one byte per element and would decode into plausible, wrong sample values.
14
+ */
10
15
  export declare function byteSource(bytes: ArrayBuffer | Uint8Array): ByteSource;
11
16
  //# sourceMappingURL=bytes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../src/io/bytes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,aAAa,CAAC;AAkC3D,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAoCtE"}
1
+ {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../src/io/bytes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,aAAa,CAAC;AAkC3D;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAoCtE"}
package/dist/io/bytes.js CHANGED
@@ -41,6 +41,11 @@ function describe(value) {
41
41
  * reason and this one was missed.
42
42
  */
43
43
  const BUFFER_TAGS = new Set(['[object ArrayBuffer]', '[object SharedArrayBuffer]']);
44
+ /**
45
+ * A `ByteSource` over bytes already in memory, for a file you fetched yourself or a fixture in a
46
+ * test. The signedness of the view is checked at construction rather than at first read: an
47
+ * `Int8Array` has one byte per element and would decode into plausible, wrong sample values.
48
+ */
44
49
  export function byteSource(bytes) {
45
50
  // Refused at CONSTRUCTION, because the alternative is worse than an error. `new Uint8Array(x)`
46
51
  // accepts almost anything: a string, a plain object and `null` all yield an empty array, and a
@@ -1 +1 @@
1
- {"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../src/io/bytes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE5F;;;GAGG;AACH,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAC5C,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,eAAe,CAAC;IACjD,6FAA6F;IAC7F,iDAAiD;IACjD,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAA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E,OAAO,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACjF,CAAC;KACF,CAAC;AACJ,CAAC"}
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ 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.4.91
10
+
11
+ - **Added** a docblock to `byteSource` naming the check that happens at construction. A typed
12
+ array of the wrong signedness passes a length test and then decodes into plausible, wrong
13
+ samples, which is why the refusal is up front rather than at first read.
14
+
9
15
  ## 0.4.90
10
16
 
11
17
  - **Added** a docblock to `blobSource`. It is the browser entry point and the first call most
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.4.90",
3
+ "version": "0.4.91",
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.4.90';
96
+ export const VERSION = '0.4.91';
package/src/io/bytes.ts CHANGED
@@ -42,6 +42,11 @@ function describe(value: unknown): string {
42
42
  */
43
43
  const BUFFER_TAGS = new Set(['[object ArrayBuffer]', '[object SharedArrayBuffer]']);
44
44
 
45
+ /**
46
+ * A `ByteSource` over bytes already in memory, for a file you fetched yourself or a fixture in a
47
+ * test. The signedness of the view is checked at construction rather than at first read: an
48
+ * `Int8Array` has one byte per element and would decode into plausible, wrong sample values.
49
+ */
45
50
  export function byteSource(bytes: ArrayBuffer | Uint8Array): ByteSource {
46
51
  // Refused at CONSTRUCTION, because the alternative is worse than an error. `new Uint8Array(x)`
47
52
  // accepts almost anything: a string, a plain object and `null` all yield an empty array, and a