edfcore 0.5.36 → 0.5.38
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 +47 -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.5.
|
|
112
|
+
export declare const VERSION = "0.5.38";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,53 @@ 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.38
|
|
10
|
+
|
|
11
|
+
- **Added** a sweep over every `…Ticks` edfcore publishes against the `…Seconds` beside it. The
|
|
12
|
+
package's central arithmetic decision is that time is a `bigint` count of 100 ns ticks and the
|
|
13
|
+
seconds are derived from it. Twenty field pairs in `types.ts` are written that way — on the
|
|
14
|
+
header, the timeline, a segment, a gap, a location, a chunk, a chunk signal, an envelope chunk, an
|
|
15
|
+
envelope signal and an annotation — each produced by different code, and one of them was checked.
|
|
16
|
+
`timebase.test.ts` asserts "an exact tick counterpart for every second on a chunk", on chunks.
|
|
17
|
+
- The other nine kinds were computed somewhere and never compared, and the failure they would
|
|
18
|
+
produce is the quiet kind: the two fields sit next to each other in an autocomplete list, a caller
|
|
19
|
+
picks whichever the surrounding code already uses, and a disagreement shows up as a plot drawn a
|
|
20
|
+
fraction of a second from where the arithmetic says it is.
|
|
21
|
+
- The pairs are now enumerated out of `types.ts` and every object every entry point returns is
|
|
22
|
+
walked, over the eight `AWKWARD` shapes plus a file with a gap and a file with an overlap: 270
|
|
23
|
+
pairs, compared with `Object.is` against `ticksToSeconds`. `toBeCloseTo` would pass on a pair that
|
|
24
|
+
had drifted by exactly the thing this arithmetic exists to prevent. Every enumerated field is
|
|
25
|
+
asserted to have been reached, so none is checked in absentia, and the visited set is asserted to
|
|
26
|
+
include a negative tick count and a hundred non-zero ones.
|
|
27
|
+
- `EdfAnnotation` is the pair that cannot be inferred from the names, and it is why the rule is
|
|
28
|
+
spelled out: its four onset fields are two axes, `onsetTicks` with `onsetSecondsFromHeaderStart`
|
|
29
|
+
and `onsetTicksFromFirstRecord` with `onsetSecondsFromFirstRecord`. Crossing them passes on every
|
|
30
|
+
file with no sub-second start offset, which is most of them — so the last block builds one that
|
|
31
|
+
has an offset and shows the crossed pairing failing by exactly that offset. That is the trap
|
|
32
|
+
`annotations.md` warns about, and it is what makes this pairing a rule rather than a coincidence.
|
|
33
|
+
|
|
34
|
+
## 0.5.37
|
|
35
|
+
|
|
36
|
+
- **Added** the safety property for the CLI. `fuzz.test.ts` states it for the library — for any byte
|
|
37
|
+
sequence, edfcore either parses it or throws an `EdfError`, never a bare `TypeError`, never a
|
|
38
|
+
hang, never believable garbage. The CLI is a second surface over the same parser, with its own
|
|
39
|
+
formatting, six commands and exit codes, and nothing had ever pointed it at bytes nobody chose.
|
|
40
|
+
Every CLI test in the suite feeds it a file written to make a point.
|
|
41
|
+
- That matters because of how `cli.ts` ends. `main()` catches everything and reports
|
|
42
|
+
`edfcore: ${error.message}` with exit 1, so a `TypeError` escaping `runCli` does not crash — it
|
|
43
|
+
arrives as a line with no code, no byte offset and no `Next:` clause, wearing the prefix a real
|
|
44
|
+
diagnostic wears. The failure is indistinguishable from a working refusal unless something checks
|
|
45
|
+
the class.
|
|
46
|
+
- Two properties now run over ~1,300 cases — random bytes, single-bit flips of a good file,
|
|
47
|
+
truncation at every length, and each header and per-signal field replaced with something that
|
|
48
|
+
breaks it. Every rejection is an `EdfError` whose message opens with a bracketed code and ends
|
|
49
|
+
with a `Next:` clause. And nothing reaches stdout before a rejection, so
|
|
50
|
+
`edfcore json big.edf > out.json` either writes a whole document or writes nothing — a redirect
|
|
51
|
+
cannot leave a half-written file beside a non-zero exit.
|
|
52
|
+
- The exit codes are checked for reachability rather than assumed: 0 for a clean file, 1 for one
|
|
53
|
+
that reads and fails validation, 2 for bad usage. `parseArgs` over 500 arbitrary argv arrays
|
|
54
|
+
throws nothing but `CliUsageError`, which is what keeps 2 distinguishable from 1.
|
|
55
|
+
|
|
9
56
|
## 0.5.36
|
|
10
57
|
|
|
11
58
|
- **Added** the `ByteSource` `data-sources.md` tells you to write, written and read through. "Writing
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED