edfcore 0.3.64 → 0.3.65

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/CHANGELOG.md CHANGED
@@ -6,6 +6,30 @@ 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.3.65
10
+
11
+ - **Fixed** `api-errors.md` publishing the wrong signature for `isEdfError` and calling a cast
12
+ mandatory that the compiler does not require.
13
+ - The page said `function isEdfError(value: unknown): value is EdfError`. It returns
14
+ `value is AnyEdfError` — the discriminated union over the seven concrete classes.
15
+ - Around that it built a **Note** explaining that "the cast in each branch is load-bearing" and
16
+ that "reaching for `error.budgetBytes` without the cast is a compile error", with three `as`
17
+ casts in the snippet to match. None of it is true: the snippet compiles without them under
18
+ edfcore's own `tsconfig.json`. `src/errors.ts` says why in the docblock on `AnyEdfError` — the
19
+ union exists precisely so that switching on `edfErrorKind` reaches the extra fields "without
20
+ one". The page documented the problem the union was added to solve as though it were still
21
+ there.
22
+ - The snippet is now in `tests/types/documented-examples.test-d.ts` alongside the other two, so
23
+ `npm run typecheck` compiles it: if a cast ever became necessary, the build would say so rather
24
+ than a paragraph.
25
+ - Adding it immediately caught a second error in the same snippet. `EdfRangeError.available` is a
26
+ `RecordRange`, not a count, so the helper the page calls `clampToFile(error.available)` cannot
27
+ take a `number`.
28
+ - The comparison against the page is now indentation-insensitive, because a page-level fragment sits
29
+ at column 0 and a compiled copy has to live inside a function. The snippet's `switch` arms were
30
+ reflowed to the form this project's formatter produces, so the page shows code that would survive
31
+ `biome check`.
32
+
9
33
  ## 0.3.64
10
34
 
11
35
  - **Fixed** the pre-0.2 status text still on the website, which contradicted the package and, in one
@@ -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.3.64";
112
+ export declare const VERSION = "0.3.65";
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.3.64';
82
+ export const VERSION = '0.3.65';
83
83
  //# sourceMappingURL=constants.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.3.64",
3
+ "version": "0.3.65",
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.3.64';
96
+ export const VERSION = '0.3.65';