edfcore 0.4.259 → 0.4.261
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/README.md +2 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/docs/CHANGELOG.md +30 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,8 @@ const [chunk] = await readWindow(recording, {
|
|
|
41
41
|
startSeconds: 30,
|
|
42
42
|
durationSeconds: 10,
|
|
43
43
|
});
|
|
44
|
+
// One chunk per contiguous run; a window that selects nothing returns none.
|
|
45
|
+
if (chunk?.signals[0] === undefined) throw new Error('no data in that window');
|
|
44
46
|
|
|
45
47
|
const microvolts = toPhysical(fp1, chunk.signals[0].digital); // Float64Array
|
|
46
48
|
```
|
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.261";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,36 @@ 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.261
|
|
10
|
+
|
|
11
|
+
- **Fixed** the opening example of `reading-signals.md`, which did not compile. It is the first
|
|
12
|
+
complete program on the page a reader lands on from "how do I read a signal", and it had the
|
|
13
|
+
same defect the README quick start had one release ago: `const [chunk] = await readWindow(...)`
|
|
14
|
+
followed by `chunk.signals[0].digital`, which under `noUncheckedIndexedAccess` is `TS18048` and
|
|
15
|
+
`TS2532`. Found by extracting every fenced example on the site that imports from `edfcore` and
|
|
16
|
+
compiling all 102 of them; two were complete programs failing on nothing but this, and this was
|
|
17
|
+
one. It also now says why the guard is there, because the reason is the same fact the page
|
|
18
|
+
teaches: a window inside an EDF+D gap really does select nothing.
|
|
19
|
+
- Compiled it in `documented-examples.test-d.ts` alongside the other four, with the same
|
|
20
|
+
narrowing check the README quick start got.
|
|
21
|
+
|
|
22
|
+
## 0.4.260
|
|
23
|
+
|
|
24
|
+
- **Fixed** the README's quick start, which did not compile. It is the first code most people run
|
|
25
|
+
and it sits on the npm front page, and it ended `chunk.signals[0].digital` after destructuring
|
|
26
|
+
`const [chunk] = await readWindow(...)`. Under `noUncheckedIndexedAccess` — on in this repo and
|
|
27
|
+
in every strict TypeScript project — `chunk` is `EdfChunk | undefined` and so is `signals[0]`,
|
|
28
|
+
so the last line was `TS18048` and `TS2532`. One guard fixes both, and it is the guard the
|
|
29
|
+
reader needs anyway: a window that selects nothing returns no chunks, which is an ordinary
|
|
30
|
+
answer rather than an error.
|
|
31
|
+
- **Added** it to `documented-examples.test-d.ts`, which has compiled three website snippets since
|
|
32
|
+
0.3.46 and never the README's. That comparison runs one way — every line a page has must exist
|
|
33
|
+
in the compiled copy — which catches a page gaining a line nothing compiles but not a page
|
|
34
|
+
losing one, since the copy keeps its own guard either way. So the quick start also gets a direct
|
|
35
|
+
check that the narrowing is still there, and the widening that lets the two texts be compared at
|
|
36
|
+
all: runs of spaces collapse, because a page aligns a trailing `// Float64Array` by eye and
|
|
37
|
+
Biome puts exactly one space before it.
|
|
38
|
+
|
|
9
39
|
## 0.4.259
|
|
10
40
|
|
|
11
41
|
- **Fixed** the snippet in `AGENTS.md` that does not compile. Its "Using edfcore in generated
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED