edfcore 0.3.108 → 0.3.110
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 +29 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/format-header.d.ts.map +1 -1
- package/dist/format-header.js +12 -5
- package/dist/format-header.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/format-header.ts +12 -4
- package/src/index.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,35 @@ 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.110
|
|
10
|
+
|
|
11
|
+
- **Fixed** `formatHeader` printing a calendar year without the padding every other renderer in the
|
|
12
|
+
package applies, so one `edfcore header` run spelled the same date two ways.
|
|
13
|
+
- `format-header.ts` carried its own `formatDate`, which padded the month and the day but not the
|
|
14
|
+
year. `formatCalendarDate` in `header/dates.ts` — used by `formatStartTimeNaive` and by every
|
|
15
|
+
diagnostic — pads all three. A year below 1000 is reachable from a conforming-length field:
|
|
16
|
+
`parseSubfieldDate` requires the EDF+ `dd-MMM-yyyy` Startdate year to be four CHARACTERS, not
|
|
17
|
+
to be at least 1000, so `Startdate 24-APR-0985` resolves to year 985. The header line then read
|
|
18
|
+
`985-04-24` while a `DATE_FIELDS_DISAGREE` diagnostic eight lines below it read `0985-04-24`.
|
|
19
|
+
- `formatHeader` now calls `formatCalendarDate`, keeping its own `undefined` → `unknown` branch.
|
|
20
|
+
One renderer for the type.
|
|
21
|
+
|
|
22
|
+
## 0.3.109
|
|
23
|
+
|
|
24
|
+
- **Fixed** three more places saying one file in the package holds every `node:` import.
|
|
25
|
+
- The true statement is about reachability, which is what the packaging test checks and what
|
|
26
|
+
0.3.84 corrected four places to say. It missed `api-sources.md` ("the only module in the
|
|
27
|
+
package that imports a Node built-in (`node:fs/promises`, and nothing else)"),
|
|
28
|
+
`data-sources.md` (the same in the other phrasing) and `src/index.ts`, which ships in
|
|
29
|
+
`dist/index.d.ts`. `src/cli.ts` imports `node:fs/promises` **and** `node:process` and is the
|
|
30
|
+
package's `bin`, inside the published `files` list, so all three were false — and the
|
|
31
|
+
parenthetical was false twice over.
|
|
32
|
+
- The guard is anchored to the code rather than to three sentences: it asserts the premise
|
|
33
|
+
(exactly `cli.ts` and `node.ts` import `node:`, and nothing reachable from the universal entry
|
|
34
|
+
imports `node.js`) and only then sweeps every page and every `src/` docblock for the
|
|
35
|
+
package-wide phrasing. If a refactor ever really does leave one importer, the premise fails
|
|
36
|
+
first and the sentences become sayable again.
|
|
37
|
+
|
|
9
38
|
## 0.3.108
|
|
10
39
|
|
|
11
40
|
- **Fixed** the strict-mode claim in three more places, and rewrote the guard so a rewording cannot
|
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.3.
|
|
112
|
+
export declare const VERSION = "0.3.110";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-header.d.ts","sourceRoot":"","sources":["../src/format-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"format-header.d.ts","sourceRoot":"","sources":["../src/format-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,KAAK,EAAmB,SAAS,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAuClF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAkHrF"}
|
package/dist/format-header.js
CHANGED
|
@@ -14,13 +14,20 @@
|
|
|
14
14
|
import { trimEdfField } from './bytes/latin1.js';
|
|
15
15
|
import { TICKS_PER_SECOND } from './constants.js';
|
|
16
16
|
import { summarizeDiagnostics } from './diagnostics/summary.js';
|
|
17
|
+
import { formatCalendarDate } from './header/dates.js';
|
|
17
18
|
import { printable } from './text/printable.js';
|
|
19
|
+
/**
|
|
20
|
+
* `formatCalendarDate`, not a second renderer for the same type.
|
|
21
|
+
*
|
|
22
|
+
* The private copy this replaced padded the month and the day but not the year, so any year below
|
|
23
|
+
* 1000 came out one way here and another way everywhere else. That is reachable from a
|
|
24
|
+
* conforming-length field: `parseSubfieldDate` requires the EDF+ `dd-MMM-yyyy` Startdate year to be
|
|
25
|
+
* four characters, not to be >= 1000, so `Startdate 24-APR-0985` resolves to year 985 and one
|
|
26
|
+
* `edfcore header` run printed `985-04-24` on the start line and `0985-04-24` in a
|
|
27
|
+
* DATE_FIELDS_DISAGREE diagnostic eight lines below it (fixed in 0.3.110).
|
|
28
|
+
*/
|
|
18
29
|
function formatDate(date) {
|
|
19
|
-
|
|
20
|
-
return 'unknown';
|
|
21
|
-
const month = String(date.month).padStart(2, '0');
|
|
22
|
-
const day = String(date.day).padStart(2, '0');
|
|
23
|
-
return `${date.year}-${month}-${day}`;
|
|
30
|
+
return date === undefined ? 'unknown' : formatCalendarDate(date);
|
|
24
31
|
}
|
|
25
32
|
/**
|
|
26
33
|
* `hh:mm:ss` from an exact tick count.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-header.js","sourceRoot":"","sources":["../src/format-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB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,GAAG,MAAM,CAAC,eAAe,KAAK,MAAM,CAAC,eAAe,IAAI,SAAS,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACtG,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,KAAK,GAAG,IAAI,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,8FAA8F;QAC9F,sFAAsF;QACtF,MAAM,OAAO,GAAG,oBAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACzD,MAAM,OAAO,GACX;YACE,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC;YACzB,CAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC7B,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;SAE1B;aACE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC;aAC9B,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,QAAQ,EAAE,CAAC;aAClD,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,mBAAmB,OAAO,EAAE,CAAC,CAAC;QACrE,KAAK,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Two rules hold for everything reachable from this file, transitively:
|
|
8
8
|
*
|
|
9
|
-
* - NO import of a Node built-in, transitively. `edfcore/node` is the only module
|
|
9
|
+
* - NO import of a Node built-in, transitively. `edfcore/node` is the only module in this graph
|
|
10
|
+
* allowed one — the `bin` entry has its own, and nothing reaches it from here — and
|
|
10
11
|
* a packaging test greps the built universal bundle for the scheme prefix to prove it — which is
|
|
11
12
|
* also why that prefix is not written out anywhere in this file. It is what lets one build serve
|
|
12
13
|
* Node, browsers, Deno and Bun with no environment conditions in the exports map: conditions are
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAOH,mFAAmF;AACnF,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,YAAY,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACnF,YAAY,EACV,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,EACN,SAAS,EACT,aAAa,EACb,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,EACT,YAAY,EACZ,aAAa,EACb,WAAW,EACX,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EAC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AE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,KAAK,EACL,SAAS,GACV,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Two rules hold for everything reachable from this file, transitively:
|
|
8
8
|
*
|
|
9
|
-
* - NO import of a Node built-in, transitively. `edfcore/node` is the only module
|
|
9
|
+
* - NO import of a Node built-in, transitively. `edfcore/node` is the only module in this graph
|
|
10
|
+
* allowed one — the `bin` entry has its own, and nothing reaches it from here — and
|
|
10
11
|
* a packaging test greps the built universal bundle for the scheme prefix to prove it — which is
|
|
11
12
|
* also why that prefix is not written out anywhere in this file. It is what lets one build serve
|
|
12
13
|
* Node, browsers, Deno and Bun with no environment conditions in the exports map: conditions are
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA2EH,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,uBAAuB,EACvB,QAAQ,EACR,cAAc,EACd,aAAa,EACb,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,gCAAgC,EAChC,gBAAgB,EAChB,OAAO,GACR,MAAM,gBAAgB,CAAC;AAExB,8EAA8E;AAC9E,2EAA2E;AAC3E,2CAA2C;AAC3C,8EAA8E;AAE9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,uBAAuB,EACvB,WAA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AO,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
package/src/format-header.ts
CHANGED
|
@@ -15,14 +15,22 @@
|
|
|
15
15
|
import { trimEdfField } from './bytes/latin1.js';
|
|
16
16
|
import { TICKS_PER_SECOND } from './constants.js';
|
|
17
17
|
import { summarizeDiagnostics } from './diagnostics/summary.js';
|
|
18
|
+
import { formatCalendarDate } from './header/dates.js';
|
|
18
19
|
import { printable } from './text/printable.js';
|
|
19
20
|
import type { EdfCalendarDate, EdfHeader, FormatHeaderOptions } from './types.js';
|
|
20
21
|
|
|
22
|
+
/**
|
|
23
|
+
* `formatCalendarDate`, not a second renderer for the same type.
|
|
24
|
+
*
|
|
25
|
+
* The private copy this replaced padded the month and the day but not the year, so any year below
|
|
26
|
+
* 1000 came out one way here and another way everywhere else. That is reachable from a
|
|
27
|
+
* conforming-length field: `parseSubfieldDate` requires the EDF+ `dd-MMM-yyyy` Startdate year to be
|
|
28
|
+
* four characters, not to be >= 1000, so `Startdate 24-APR-0985` resolves to year 985 and one
|
|
29
|
+
* `edfcore header` run printed `985-04-24` on the start line and `0985-04-24` in a
|
|
30
|
+
* DATE_FIELDS_DISAGREE diagnostic eight lines below it (fixed in 0.3.110).
|
|
31
|
+
*/
|
|
21
32
|
function formatDate(date: EdfCalendarDate | undefined): string {
|
|
22
|
-
|
|
23
|
-
const month = String(date.month).padStart(2, '0');
|
|
24
|
-
const day = String(date.day).padStart(2, '0');
|
|
25
|
-
return `${date.year}-${month}-${day}`;
|
|
33
|
+
return date === undefined ? 'unknown' : formatCalendarDate(date);
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
/**
|
package/src/index.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Two rules hold for everything reachable from this file, transitively:
|
|
8
8
|
*
|
|
9
|
-
* - NO import of a Node built-in, transitively. `edfcore/node` is the only module
|
|
9
|
+
* - NO import of a Node built-in, transitively. `edfcore/node` is the only module in this graph
|
|
10
|
+
* allowed one — the `bin` entry has its own, and nothing reaches it from here — and
|
|
10
11
|
* a packaging test greps the built universal bundle for the scheme prefix to prove it — which is
|
|
11
12
|
* also why that prefix is not written out anywhere in this file. It is what lets one build serve
|
|
12
13
|
* Node, browsers, Deno and Bun with no environment conditions in the exports map: conditions are
|