edfcore 0.4.258 → 0.4.260

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 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
  ```
@@ -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.258";
112
+ export declare const VERSION = "0.4.260";
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.258';
82
+ export const VERSION = '0.4.260';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,40 @@ 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.260
10
+
11
+ - **Fixed** the README's quick start, which did not compile. It is the first code most people run
12
+ and it sits on the npm front page, and it ended `chunk.signals[0].digital` after destructuring
13
+ `const [chunk] = await readWindow(...)`. Under `noUncheckedIndexedAccess` — on in this repo and
14
+ in every strict TypeScript project — `chunk` is `EdfChunk | undefined` and so is `signals[0]`,
15
+ so the last line was `TS18048` and `TS2532`. One guard fixes both, and it is the guard the
16
+ reader needs anyway: a window that selects nothing returns no chunks, which is an ordinary
17
+ answer rather than an error.
18
+ - **Added** it to `documented-examples.test-d.ts`, which has compiled three website snippets since
19
+ 0.3.46 and never the README's. That comparison runs one way — every line a page has must exist
20
+ in the compiled copy — which catches a page gaining a line nothing compiles but not a page
21
+ losing one, since the copy keeps its own guard either way. So the quick start also gets a direct
22
+ check that the narrowing is still there, and the widening that lets the two texts be compared at
23
+ all: runs of spaces collapse, because a page aligns a trailing `// Float64Array` by eye and
24
+ Biome puts exactly one space before it.
25
+
26
+ ## 0.4.259
27
+
28
+ - **Fixed** the snippet in `AGENTS.md` that does not compile. Its "Using edfcore in generated
29
+ code" section exists to be copied verbatim into somebody's project, which makes it the
30
+ highest-leverage code in the repository — and it ended `chunks[0].signals[0].digital`, which
31
+ under `noUncheckedIndexedAccess` is two `error TS2532`s, because both index reads are
32
+ `T | undefined`. That flag is on in this repo and in every strict TypeScript project, so the
33
+ file agents are told to copy from was teaching a line the compiler rejects. It narrows now,
34
+ which is what 0.4.208 settled on for this codebase over a `!`, and the two guards double as the
35
+ lesson the list right below it already gives: `readWindow` returns an array, and an empty one is
36
+ an ordinary answer.
37
+ - **Added** the compiled twin. `documented-examples.test-d.ts` has done this for three website
38
+ snippets since 0.3.46 found two of them rejected the same way; the snippet an agent is likeliest
39
+ to paste had no such guard. It runs both directions — the copy is real code `npm run typecheck`
40
+ compiles, and the test reads the fenced block back out of `AGENTS.md` and fails if a line of it
41
+ is missing here.
42
+
9
43
  ## 0.4.258
10
44
 
11
45
  - **Added** a check on the `Next:` convention, which `AGENTS.md` states as an absolute — "every
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.4.258",
3
+ "version": "0.4.260",
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.258';
96
+ export const VERSION = '0.4.260';