edfcore 0.4.259 → 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.259";
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.259';
82
+ export const VERSION = '0.4.260';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,23 @@ 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
+
9
26
  ## 0.4.259
10
27
 
11
28
  - **Fixed** the snippet in `AGENTS.md` that does not compile. Its "Using edfcore in generated
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.4.259",
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.259';
96
+ export const VERSION = '0.4.260';