edfcore 0.6.168 → 0.6.169
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/stream.d.ts.map +1 -1
- package/dist/stream.js +18 -0
- package/dist/stream.js.map +1 -1
- package/docs/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/stream.ts +19 -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.169";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/dist/stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAe,eAAe,EAAE,MAAM,YAAY,CAAC;AAKpG;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,eAAe,EAC1B,OAAO,CAAC,EAAE,WAAW,GACpB,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC,CAiE3C"}
|
package/dist/stream.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* Chunks arrive in time order, never span a gap, and carry the same `precededByGap` a
|
|
13
13
|
* `readWindow` chunk would, so a consumer sees the discontinuities rather than a smooth lie.
|
|
14
14
|
*/
|
|
15
|
+
import { assertReadOptions } from './io/source.js';
|
|
15
16
|
import { assertRecording, assertSelection, readRecords, resolveSignals } from './recording.js';
|
|
16
17
|
import { describeValue } from './text/describe.js';
|
|
17
18
|
import { assertMonotonicOnsets } from './time/timeline.js';
|
|
@@ -50,6 +51,23 @@ export function streamRecords(recording, selection, options) {
|
|
|
50
51
|
`${describeValue(chunkRecords)}. ` +
|
|
51
52
|
'Next: omit it for the default, or pass how many records you want to hold at once.');
|
|
52
53
|
}
|
|
54
|
+
/*
|
|
55
|
+
* The OPTIONS, here rather than on the first read.
|
|
56
|
+
*
|
|
57
|
+
* `readRecords` refuses a bare value — 0.6.155 for an `AbortSignal` handed over in place of the
|
|
58
|
+
* options, 0.6.166 for any other — but this function does not read; the generator below does, and
|
|
59
|
+
* only once someone iterates it. So `streamRecords(recording, selection, controller.signal)` was
|
|
60
|
+
* built without complaint and refused in the `for await`, which is the split 0.6.118 was spent
|
|
61
|
+
* closing: "a caller who builds the stream in one place and consumes it in another gets the
|
|
62
|
+
* refusal in the second".
|
|
63
|
+
*
|
|
64
|
+
* And on a window that resolves to no records — past the end, inside an EDF+D gap, of zero
|
|
65
|
+
* duration — the loop body never runs, so it was never refused at all: the stream simply
|
|
66
|
+
* completed, empty. That is the same data-dependent guard 0.6.118 found here, one argument over,
|
|
67
|
+
* and for the signal case it is the worst version of it. An abort that was never wired up and a
|
|
68
|
+
* window with nothing in it both end as a stream that yielded nothing.
|
|
69
|
+
*/
|
|
70
|
+
assertReadOptions(options);
|
|
53
71
|
// Validated BEFORE the window is resolved, for the reason `readWindow` and `readEnvelope` both
|
|
54
72
|
// state: a caller mistake is a caller mistake wherever the window lands. Resolving first meant
|
|
55
73
|
// that a window past the end, one inside an EDF+D gap, or one of zero duration produced no
|
package/dist/stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../src/stream.ts"],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,UAAU,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,GAAG,mBAAmB;aACzE,CAAC;YAEF,MAAM,KAAK,CAAC;YACZ,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC;QAC3B,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ 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.169
|
|
10
|
+
|
|
11
|
+
- **Fixed** `streamRecords` handing the read options to the generator unchecked. `readRecords`
|
|
12
|
+
refuses a bare value where they belong, but it is the generator that calls it, so
|
|
13
|
+
`streamRecords(recording, selection, controller.signal)` was built without complaint and refused
|
|
14
|
+
on the first `for await` — the split 0.6.118 turned this function inside out to close.
|
|
15
|
+
- On a window that resolves to no records — past the end, inside an EDF+D gap, of zero duration —
|
|
16
|
+
the loop body never runs, so nothing was ever refused: the stream completed, empty, with the
|
|
17
|
+
options dropped. Whether a caller mistake was reported depended on where the window landed.
|
|
18
|
+
- The `AbortSignal` case is the pair that cannot be told apart: a cancellation that was never wired
|
|
19
|
+
up, and a stream that yields nothing, which is what an abort looks like from outside.
|
|
20
|
+
|
|
9
21
|
## 0.6.168
|
|
10
22
|
|
|
11
23
|
- **Fixed** a by-code summary counted as a diagnostics list. `summarizeDiagnostics` reads `code`
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
package/src/stream.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* `readWindow` chunk would, so a consumer sees the discontinuities rather than a smooth lie.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
+
import { assertReadOptions } from './io/source.js';
|
|
16
17
|
import { assertRecording, assertSelection, readRecords, resolveSignals } from './recording.js';
|
|
17
18
|
import { describeValue } from './text/describe.js';
|
|
18
19
|
import { assertMonotonicOnsets } from './time/timeline.js';
|
|
@@ -65,6 +66,24 @@ export function streamRecords(
|
|
|
65
66
|
);
|
|
66
67
|
}
|
|
67
68
|
|
|
69
|
+
/*
|
|
70
|
+
* The OPTIONS, here rather than on the first read.
|
|
71
|
+
*
|
|
72
|
+
* `readRecords` refuses a bare value — 0.6.155 for an `AbortSignal` handed over in place of the
|
|
73
|
+
* options, 0.6.166 for any other — but this function does not read; the generator below does, and
|
|
74
|
+
* only once someone iterates it. So `streamRecords(recording, selection, controller.signal)` was
|
|
75
|
+
* built without complaint and refused in the `for await`, which is the split 0.6.118 was spent
|
|
76
|
+
* closing: "a caller who builds the stream in one place and consumes it in another gets the
|
|
77
|
+
* refusal in the second".
|
|
78
|
+
*
|
|
79
|
+
* And on a window that resolves to no records — past the end, inside an EDF+D gap, of zero
|
|
80
|
+
* duration — the loop body never runs, so it was never refused at all: the stream simply
|
|
81
|
+
* completed, empty. That is the same data-dependent guard 0.6.118 found here, one argument over,
|
|
82
|
+
* and for the signal case it is the worst version of it. An abort that was never wired up and a
|
|
83
|
+
* window with nothing in it both end as a stream that yielded nothing.
|
|
84
|
+
*/
|
|
85
|
+
assertReadOptions(options);
|
|
86
|
+
|
|
68
87
|
// Validated BEFORE the window is resolved, for the reason `readWindow` and `readEnvelope` both
|
|
69
88
|
// state: a caller mistake is a caller mistake wherever the window lands. Resolving first meant
|
|
70
89
|
// that a window past the end, one inside an EDF+D gap, or one of zero duration produced no
|