edfcore 0.5.39 → 0.5.40

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.
@@ -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.5.39";
112
+ export declare const VERSION = "0.5.40";
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.5.39';
82
+ export const VERSION = '0.5.40';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,28 @@ 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.5.40
10
+
11
+ - **Added** the resolution of every index and byte offset edfcore publishes. The API is full of
12
+ numbers that are addresses rather than measurements: `signalIndex` names a row of
13
+ `header.signals`, `recordIndex` a record, `firstSampleIndex` a position on a signal's own grid,
14
+ and `byteOffset`/`byteLength` a range a reader is expected to take to a hex editor. A measurement
15
+ that is wrong is wrong; an address that is wrong sends someone to look at the wrong bytes.
16
+ - They were checked one at a time where they are produced and nowhere as a class. Every object every
17
+ entry point returns is now walked over the eight `AWKWARD` shapes and a file with a gap — 1,500
18
+ numbers across 51 field names — and each is resolved against the file it came from. A
19
+ `signalIndex` must name a signal whose own `index` is that number; a `recordIndex` a record the
20
+ file has; `firstSampleIndex + sampleCount` must land inside the signal's `sampleCount`.
21
+ - The strongest check re-decodes. A chunk's `byteOffset` and `byteLength` are used to slice the
22
+ fixture and decode it again, and the samples that come back must be the samples the chunk carries.
23
+ A range check would pass on an offset that is inside the file and points at the wrong record.
24
+ - **Found while writing it:** that re-decode was vacuous on every shared fixture. `writer.ts`
25
+ defaults its sample generator to `(_record, index) => index % 100` — the same ramp in every record
26
+ — which is right for a fixture about a header and makes a byte-offset check unable to fail: a
27
+ chunk reporting the offset of the wrong record decodes to identical samples. The resolution now
28
+ runs against a file whose every record is distinguishable, asserts that it is before relying on
29
+ it, and shows that shifting the offset by one record changes what comes back.
30
+
9
31
  ## 0.5.39
10
32
 
11
33
  - **Added** the rule that every array edfcore hands back is frozen. `src/` calls `Object.freeze`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.5.39",
3
+ "version": "0.5.40",
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.5.39';
96
+ export const VERSION = '0.5.40';