edfcore 0.4.422 → 0.4.425
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/bytes.d.ts.map +1 -1
- package/dist/io/bytes.js +7 -5
- package/dist/io/bytes.js.map +1 -1
- package/docs/CHANGELOG.md +51 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/io/bytes.ts +7 -5
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.4.
|
|
112
|
+
export declare const VERSION = "0.4.425";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/dist/io/bytes.d.ts.map
CHANGED
|
@@ -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;
|
|
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;AAoC3D;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAoCtE"}
|
package/dist/io/bytes.js
CHANGED
|
@@ -11,6 +11,13 @@ import { assertExactRead, assertReadRange, isByteArray, throwIfAborted } from '.
|
|
|
11
11
|
/**
|
|
12
12
|
* Describes what arrived, for an argument that is not bytes. Never prints the value: it could be
|
|
13
13
|
* anything, including something large.
|
|
14
|
+
*
|
|
15
|
+
* No `ArrayBuffer` or `SharedArrayBuffer` branch, and there cannot usefully be one: this is called
|
|
16
|
+
* on the throw path alone, which `byteSource` reaches only when the SAME `BUFFER_TAGS` test has
|
|
17
|
+
* already answered no. A branch here carried one for a while — added when a refusal called them
|
|
18
|
+
* "a plain object" — and it stopped being reachable once the acceptance check was widened to the
|
|
19
|
+
* tags in 0.3.20. Removed in 0.4.423, along with the comment claiming it prevented a message
|
|
20
|
+
* nothing can produce.
|
|
14
21
|
*/
|
|
15
22
|
function describe(value) {
|
|
16
23
|
if (value === null)
|
|
@@ -21,11 +28,6 @@ function describe(value) {
|
|
|
21
28
|
return Object.prototype.toString.call(value).slice(8, -1);
|
|
22
29
|
if (Array.isArray(value))
|
|
23
30
|
return 'a plain Array';
|
|
24
|
-
// Buffers are named too. Without this a refusal called them "a plain object", which sent the
|
|
25
|
-
// reader looking for the wrong problem entirely.
|
|
26
|
-
if (BUFFER_TAGS.has(Object.prototype.toString.call(value))) {
|
|
27
|
-
return Object.prototype.toString.call(value).slice(8, -1);
|
|
28
|
-
}
|
|
29
31
|
return typeof value === 'object' ? 'a plain object' : `a ${typeof value}`;
|
|
30
32
|
}
|
|
31
33
|
/**
|
package/dist/io/bytes.js.map
CHANGED
|
@@ -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
|
|
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,EA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C,EAAE,CAClC,CAAC;IACJ,CAAC;IAED,2FAA2F;IAC3F,oFAAoF;IACpF,MAAM,IAAI,GAAe,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,KAAoB,CAAC,CAAC;IAC3F,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IAEnC,OAAO;QACL,UAAU;QACV,KAAK,CAAC,IAAI,CAAC,MAAc,EAAE,MAAc,EAAE,OAAqB;YAC9D,cAAc,CAAC,OAAO,CAAC,CAAC;YACxB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;YAC5C,iFAAiF;YACjF,+EAA+E;YAC/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,57 @@ 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.425
|
|
10
|
+
|
|
11
|
+
- **Added** tests for the one sentence `api-reading.md` gives about the shape of `signalIndices`:
|
|
12
|
+
"Duplicates are dropped; the order you give is the order of `chunk.signals`." It was prose, in
|
|
13
|
+
the options table every reader consults before their first read.
|
|
14
|
+
- Both halves are reached by ordinary code. A repeated index comes from a multi-select that appends
|
|
15
|
+
on click, a "select all" over a list that already had one checked, or `[...montage, ...extras]`
|
|
16
|
+
where the two overlap. The order comes from wherever the indices were built, and a caller drawing
|
|
17
|
+
`chunk.signals[0]` as the top trace is trusting it.
|
|
18
|
+
- They fail differently and both quietly. A duplicate that is not dropped costs a second decode and
|
|
19
|
+
returns an array with one more entry than the caller's legend has rows, so every trace below the
|
|
20
|
+
repeat is drawn with the wrong label. An order that is not preserved swaps two traces outright,
|
|
21
|
+
and on a montage two channels of EEG look like two channels of EEG.
|
|
22
|
+
- `readRecords`, `readWindow` and `streamRecords` are all checked. They share one resolver today —
|
|
23
|
+
`stream.ts` says it must produce the byte-identical refusal `readWindow` does — but that is a
|
|
24
|
+
fact about the code and the promise is about the API.
|
|
25
|
+
|
|
26
|
+
## 0.4.424
|
|
27
|
+
|
|
28
|
+
- **Added** a property test that reading a stretch in pieces and joining them is reading it whole.
|
|
29
|
+
That is the promise `mergeChunks` exists to make, and it is what lets a caller bound memory
|
|
30
|
+
without changing an answer. `merge-chunks.test.ts` demonstrated it on one split of one file, and
|
|
31
|
+
every check around it is about a merge that must be refused — the thing that has to hold for
|
|
32
|
+
every split of every file was shown for one.
|
|
33
|
+
- The failure it guards is silent and arithmetic. A merge that dropped the last sample of each
|
|
34
|
+
piece, or summed the wrong bytes, returns an array of the length a caller expects, holding real
|
|
35
|
+
samples from the real file, shifted. Nothing downstream can tell: the timestamps come from the
|
|
36
|
+
record range, which is right, and the values are plausible because they came from the recording.
|
|
37
|
+
It surfaces as an event marked half a second late, weeks later, in someone else's analysis. So
|
|
38
|
+
the bookkeeping is checked alongside the samples — `records`, `byteLength` and the chunk's own
|
|
39
|
+
start in ticks are all quantities a caller reads off the result.
|
|
40
|
+
- **Removed** an unreachable branch from `byteSource`'s argument description, and the comment
|
|
41
|
+
claiming it prevented a message nothing can produce. It named an `ArrayBuffer` or a
|
|
42
|
+
`SharedArrayBuffer` in a refusal — but the description is built on the throw path alone, which is
|
|
43
|
+
reached only when the same `BUFFER_TAGS` test has already answered no.
|
|
44
|
+
- It was reachable once. The branch was added when a refusal called those buffers "a plain
|
|
45
|
+
object", and it stopped being reachable in 0.3.20, when the acceptance check was widened from
|
|
46
|
+
`instanceof` to the same tags. Nothing noticed, because dead code that agrees with the code
|
|
47
|
+
around it reads as thoroughness.
|
|
48
|
+
- `BUFFER_TAGS` itself stays: it is what accepts a buffer from another realm, which 0.4.422 now
|
|
49
|
+
exercises through `node:vm`.
|
|
50
|
+
|
|
51
|
+
## 0.4.423
|
|
52
|
+
|
|
53
|
+
Never released. The release run bumped the version, passed its own checks and pushed, and CI then
|
|
54
|
+
failed all three Node jobs on formatting: a test file written after `npm run format` had run was
|
|
55
|
+
swept into the commit by `git add -A` unformatted. Nothing was tagged and nothing went to npm, but
|
|
56
|
+
the bump was already public, which consumed the number. The same failure as `0.4.176`, arriving
|
|
57
|
+
from the other side — there the local check caught it after the bump, here the local check never
|
|
58
|
+
saw the file. The work that carried this heading shipped in `0.4.424`.
|
|
59
|
+
|
|
9
60
|
## 0.4.422
|
|
10
61
|
|
|
11
62
|
- **Added** tests for what `byteSource` accepts and what it says about everything else. It is the
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
package/src/io/bytes.ts
CHANGED
|
@@ -14,17 +14,19 @@ import { assertExactRead, assertReadRange, isByteArray, throwIfAborted } from '.
|
|
|
14
14
|
/**
|
|
15
15
|
* Describes what arrived, for an argument that is not bytes. Never prints the value: it could be
|
|
16
16
|
* anything, including something large.
|
|
17
|
+
*
|
|
18
|
+
* No `ArrayBuffer` or `SharedArrayBuffer` branch, and there cannot usefully be one: this is called
|
|
19
|
+
* on the throw path alone, which `byteSource` reaches only when the SAME `BUFFER_TAGS` test has
|
|
20
|
+
* already answered no. A branch here carried one for a while — added when a refusal called them
|
|
21
|
+
* "a plain object" — and it stopped being reachable once the acceptance check was widened to the
|
|
22
|
+
* tags in 0.3.20. Removed in 0.4.423, along with the comment claiming it prevented a message
|
|
23
|
+
* nothing can produce.
|
|
17
24
|
*/
|
|
18
25
|
function describe(value: unknown): string {
|
|
19
26
|
if (value === null) return 'null';
|
|
20
27
|
if (value === undefined) return 'undefined';
|
|
21
28
|
if (ArrayBuffer.isView(value)) return Object.prototype.toString.call(value).slice(8, -1);
|
|
22
29
|
if (Array.isArray(value)) return 'a plain Array';
|
|
23
|
-
// Buffers are named too. Without this a refusal called them "a plain object", which sent the
|
|
24
|
-
// reader looking for the wrong problem entirely.
|
|
25
|
-
if (BUFFER_TAGS.has(Object.prototype.toString.call(value))) {
|
|
26
|
-
return Object.prototype.toString.call(value).slice(8, -1);
|
|
27
|
-
}
|
|
28
30
|
return typeof value === 'object' ? 'a plain object' : `a ${typeof value}`;
|
|
29
31
|
}
|
|
30
32
|
|