edfcore 0.3.109 → 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 +13 -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/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/format-header.ts +12 -4
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,19 @@ 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
|
+
|
|
9
22
|
## 0.3.109
|
|
10
23
|
|
|
11
24
|
- **Fixed** three more places saying one file in the package holds every `node:` import.
|
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,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,SAAS,UAAU,CAAC,IAAiC;IACnD,
|
|
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,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD;;;;;;;;;GASG;AACH,SAAS,UAAU,CAAC,IAAiC;IACnD,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,KAAa;IACxC,IAAI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,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/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
|
/**
|