edfcore 0.4.516 → 0.4.518
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/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/docs/CHANGELOG.md +39 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
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.518";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,45 @@ 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.518
|
|
10
|
+
|
|
11
|
+
- **Added** the other convention `api-types.md` states in bold: "Anything checkable against the
|
|
12
|
+
file is exposed twice", as the parsed value and as the raw bytes it came from, padding intact.
|
|
13
|
+
It is a convention rather than a nicety because of the sentence after it — a header field that
|
|
14
|
+
disagrees with what edfcore made of it is what you need when a file misbehaves — so the raw side
|
|
15
|
+
is the evidence a bug report is written from, and evidence that is not the file's own bytes is
|
|
16
|
+
worse than none.
|
|
17
|
+
- `type-tables.test.ts` checks the raw interfaces list every field, and individual tests quote a
|
|
18
|
+
raw value here and there. Nothing checked the convention: that each of the ten fixed fields and
|
|
19
|
+
the ten per-signal fields, on every signal, is exactly the bytes the layout puts at that offset,
|
|
20
|
+
decoded the way the header is decoded and not trimmed on the way out.
|
|
21
|
+
- The per-signal half is where a mistake would be invisible. The block is field-major, so one
|
|
22
|
+
signal's ten fields are ten different places in the header, each `256 + ns * before + i * width`,
|
|
23
|
+
and reading one from a neighbour's slot yields a plausible string rather than an error. The
|
|
24
|
+
fixture gives all three signals different values for every field and leaves padding in each, so a
|
|
25
|
+
shifted index and a trimming reader both fail — both were tried, and both do.
|
|
26
|
+
|
|
27
|
+
## 0.4.517
|
|
28
|
+
|
|
29
|
+
- **Added** the convention `api-types.md` states in bold above every table on the page: "A field
|
|
30
|
+
that may be absent is `T | undefined`, and the key is always there." It is what lets a caller
|
|
31
|
+
write `header.startTime.resolvedDate === undefined` instead of `'resolvedDate' in
|
|
32
|
+
header.startTime`, and destructure a result without guarding each name. It was prose.
|
|
33
|
+
- The type half is read out of `src/types.ts`: every optional member must live in an interface the
|
|
34
|
+
caller constructs — the ten `…Options` and `…Selection` types. An optional member on a result is
|
|
35
|
+
not a compile error anywhere. It quietly makes one field a name TypeScript will not let you read
|
|
36
|
+
without a guard.
|
|
37
|
+
- The runtime half is the one a type cannot catch. A result assembled with a conditional spread —
|
|
38
|
+
`...(date === undefined ? {} : { resolvedDate: date })` — satisfies `T | undefined` and omits the
|
|
39
|
+
key, so `Object.keys` comes up short, `in` is false, and a JSON round-trip loses a field the
|
|
40
|
+
table says is always there. Twenty result interfaces are now instantiated and every declared
|
|
41
|
+
member checked with `Object.hasOwn`; writing that spread into `resolveStartTime` fails the run.
|
|
42
|
+
- The fixture is built to leave fields ABSENT rather than present: an unreadable start date, a
|
|
43
|
+
signal with a degenerate digital range so it has no scale, annotations with no duration, and a
|
|
44
|
+
discontinuous file so one segment has a gap before it and one has none. Twenty fields come back
|
|
45
|
+
`undefined`, and the run asserts that count — on a file where everything happened to be defined
|
|
46
|
+
the check would pass while testing nothing.
|
|
47
|
+
|
|
9
48
|
## 0.4.516
|
|
10
49
|
|
|
11
50
|
- **Added** the third column of the `EdfHeader` and `EdfSignal` tables on `api-types.md`, executed.
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED