edfcore 0.6.2 → 0.6.4
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/cli-run.d.ts.map +1 -1
- package/dist/cli-run.js +3 -2
- package/dist/cli-run.js.map +1 -1
- 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 +10 -2
- package/dist/format-header.js.map +1 -1
- package/dist/format-report.d.ts.map +1 -1
- package/dist/format-report.js +6 -6
- package/dist/format-report.js.map +1 -1
- package/dist/text/counted.d.ts +34 -0
- package/dist/text/counted.d.ts.map +1 -0
- package/dist/text/counted.js +38 -0
- package/dist/text/counted.js.map +1 -0
- package/dist/text/printable.d.ts +3 -2
- package/dist/text/printable.d.ts.map +1 -1
- package/dist/text/printable.js +3 -2
- package/dist/text/printable.js.map +1 -1
- package/docs/CHANGELOG.md +45 -0
- package/package.json +1 -1
- package/src/cli-run.ts +3 -2
- package/src/constants.ts +1 -1
- package/src/format-header.ts +10 -2
- package/src/format-report.ts +6 -7
- package/src/text/counted.ts +39 -0
- package/src/text/printable.ts +3 -2
package/dist/cli-run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-run.d.ts","sourceRoot":"","sources":["../src/cli-run.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"cli-run.d.ts","sourceRoot":"","sources":["../src/cli-run.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH;;;;;;;;;;;GAWG;AACH,qBAAa,aAAc,SAAQ,UAAU;IAC3C,QAAQ,CAAC,KAAK,EAAG,IAAI,CAAU;gBAEnB,OAAO,EAAE,MAAM;CAI5B;AAED,iDAAiD;AACjD,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5C,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AA4CD;;;;GAIG;AACH,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAkDvD;AAoCD;;;;GAIG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAoQnE"}
|
package/dist/cli-run.js
CHANGED
|
@@ -15,6 +15,7 @@ import { formatValidationReport } from './format-report.js';
|
|
|
15
15
|
import { byteSource } from './io/bytes.js';
|
|
16
16
|
import { buildRecordIndex } from './record-index.js';
|
|
17
17
|
import { openEdf, readAnnotations } from './recording.js';
|
|
18
|
+
import { pluralise } from './text/counted.js';
|
|
18
19
|
import { printable } from './text/printable.js';
|
|
19
20
|
import { validateRecording } from './validate.js';
|
|
20
21
|
/**
|
|
@@ -297,7 +298,7 @@ export async function runCli(args, io) {
|
|
|
297
298
|
const index = await buildRecordIndex(recording);
|
|
298
299
|
const gaps = index.gaps ?? [];
|
|
299
300
|
if (gaps.length === 0) {
|
|
300
|
-
io.out(`no gaps in ${index.recordCount}
|
|
301
|
+
io.out(`no gaps in ${pluralise(index.recordCount, 'record')}\n`);
|
|
301
302
|
return 0;
|
|
302
303
|
}
|
|
303
304
|
// An OVERLAP travels in the same array with a negative duration — 0.2.69 documented that —
|
|
@@ -309,7 +310,7 @@ export async function runCli(args, io) {
|
|
|
309
310
|
const counted = overlaps === 0
|
|
310
311
|
? `${gaps.length} gap(s)`
|
|
311
312
|
: `${gaps.length - overlaps} gap(s) and ${overlaps} overlap(s)`;
|
|
312
|
-
io.out(`${counted} in ${index.recordCount}
|
|
313
|
+
io.out(`${counted} in ${pluralise(index.recordCount, 'record')}\n\n`);
|
|
313
314
|
for (const gap of gaps) {
|
|
314
315
|
const overlap = gap.durationSeconds < 0;
|
|
315
316
|
// The kind is a FOURTH column, appended: columns 1-3 keep their meaning and position, so
|
package/dist/cli-run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-run.js","sourceRoot":"","sources":["../src/cli-run.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,aAAc,SAAQ,UAAU;IAClC,KAAK,GAAG,IAAa,CAA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: {
|
|
|
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.6.
|
|
112
|
+
export declare const VERSION = "0.6.4";
|
|
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;AAQH,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,CA2HrF"}
|
package/dist/format-header.js
CHANGED
|
@@ -15,6 +15,7 @@ import { trimEdfField } from './bytes/latin1.js';
|
|
|
15
15
|
import { TICKS_PER_SECOND } from './constants.js';
|
|
16
16
|
import { summarizeDiagnostics } from './diagnostics/summary.js';
|
|
17
17
|
import { formatCalendarDate } from './header/dates.js';
|
|
18
|
+
import { pluralise } from './text/counted.js';
|
|
18
19
|
import { printable } from './text/printable.js';
|
|
19
20
|
/**
|
|
20
21
|
* `formatCalendarDate`, not a second renderer for the same type.
|
|
@@ -61,7 +62,12 @@ function formatRate(signal) {
|
|
|
61
62
|
export function formatHeader(header, options) {
|
|
62
63
|
const lines = [];
|
|
63
64
|
const start = header.startTime;
|
|
64
|
-
|
|
65
|
+
// Through `pluralise`, which is the whole reason that helper is a module rather than a private
|
|
66
|
+
// function in the formatter next door. This is the first line of `edfcore header`, and on the
|
|
67
|
+
// one-signal file that most of this suite is built from it read `EDF · 1 signals · 6 records`
|
|
68
|
+
// while `edfcore validate` on the same file said `scanned 6 records` correctly (fixed in 0.6.4).
|
|
69
|
+
lines.push(`${header.variant} · ${pluralise(header.signals.length, 'signal')} · ` +
|
|
70
|
+
`${pluralise(header.recordCount, 'record')}`);
|
|
65
71
|
// `unknown`, not a substituted midnight. The module promise two paragraphs up is that a field
|
|
66
72
|
// edfcore could not resolve prints as `unknown` rather than as a plausible default, and the date
|
|
67
73
|
// half has always honoured it. The clock half printed `00:00:00` for a starttime field that
|
|
@@ -151,7 +157,9 @@ export function formatHeader(header, options) {
|
|
|
151
157
|
[counted.infos, 'info'],
|
|
152
158
|
]
|
|
153
159
|
.filter(([count]) => count > 0)
|
|
154
|
-
.
|
|
160
|
+
// The 0.4.421 defect verbatim, in the other formatter: `2 warning`, under a heading that
|
|
161
|
+
// had already counted them. `formatValidationReport` was fixed then and this was not.
|
|
162
|
+
.map(([count, severity]) => pluralise(count, severity))
|
|
155
163
|
.join(', ');
|
|
156
164
|
lines.push(`${header.diagnostics.length} diagnostic(s): ${summary}`);
|
|
157
165
|
if (options?.diagnosticsHint !== false) {
|
|
@@ -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,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,m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,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;YAC/B,yFAAyF;YACzF,sFAAsF;aACrF,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;aACtD,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,mBAAmB,OAAO,EAAE,CAAC,CAAC;QACrE,IAAI,OAAO,EAAE,eAAe,KAAK,KAAK,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-report.d.ts","sourceRoot":"","sources":["../src/format-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"format-report.d.ts","sourceRoot":"","sources":["../src/format-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAKnF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,gBAAgB,EACxB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,MAAM,CA+ER;AAED,qFAAqF;AACrF,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/format-report.js
CHANGED
|
@@ -14,12 +14,10 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { assertRedactableFields, formatDiagnostics } from './diagnostics/format.js';
|
|
16
16
|
import { summarizeDiagnostics } from './diagnostics/summary.js';
|
|
17
|
+
import { plural, pluralise } from './text/counted.js';
|
|
17
18
|
import { printable } from './text/printable.js';
|
|
18
19
|
/** Enough to see the pattern, few enough to read. Override with `maxItems`. */
|
|
19
20
|
const DEFAULT_MAX_ITEMS = 20;
|
|
20
|
-
function pluralise(count, noun) {
|
|
21
|
-
return `${count} ${noun}${count === 1 ? '' : 's'}`;
|
|
22
|
-
}
|
|
23
21
|
/**
|
|
24
22
|
* A multi-line summary of a validation report.
|
|
25
23
|
*
|
|
@@ -44,7 +42,8 @@ export function formatValidationReport(report, options) {
|
|
|
44
42
|
[summary.infos, 'info'],
|
|
45
43
|
]
|
|
46
44
|
.filter(([count]) => count > 0)
|
|
47
|
-
// Through `pluralise`, like the record count on the line below
|
|
45
|
+
// Through `pluralise`, like the record count on the line below, and since 0.6.4 like
|
|
46
|
+
// every other count this package prints. Until 0.4.421 this
|
|
48
47
|
// interpolated the severity name raw, so the first line of every `edfcore validate`
|
|
49
48
|
// read "2 error, 1 warning, 2 info" above a line reading "scanned 12 records" — one
|
|
50
49
|
// function, two conventions, and the ungrammatical one on the line a reader sees first.
|
|
@@ -52,7 +51,7 @@ export function formatValidationReport(report, options) {
|
|
|
52
51
|
.join(', ');
|
|
53
52
|
lines.push(`${verdict} — ${severities}`);
|
|
54
53
|
lines.push(`scanned ${pluralise(report.recordsScanned, 'record')}, ` +
|
|
55
|
-
`read ${report.bytesRead.toLocaleString('en-US')}
|
|
54
|
+
`read ${report.bytesRead.toLocaleString('en-US')} ${plural('byte', report.bytesRead)}`);
|
|
56
55
|
if (summary.byCode.length > 0) {
|
|
57
56
|
lines.push('');
|
|
58
57
|
lines.push('by code:');
|
|
@@ -74,7 +73,8 @@ export function formatValidationReport(report, options) {
|
|
|
74
73
|
? ` ${stats.outOfDigitalRangeCount} outside the declared range`
|
|
75
74
|
: '';
|
|
76
75
|
lines.push(` ${name.slice(0, 20).padEnd(21)}${stats.observedDigitalMin}..${stats.observedDigitalMax}` +
|
|
77
|
-
` over ${stats.sampleCount.toLocaleString('en-US')}
|
|
76
|
+
` over ${stats.sampleCount.toLocaleString('en-US')} ` +
|
|
77
|
+
`${plural('sample', stats.sampleCount)}${overflow}`);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
if (report.diagnostics.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-report.js","sourceRoot":"","sources":["../src/format-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,+EAA+E;AAC/E,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B
|
|
1
|
+
{"version":3,"file":"format-report.js","sourceRoot":"","sources":["../src/format-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;A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AAI,CACR,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,kBAAkB,KAAK,KAAK,CAAC,kBAAkB,EAAE;gBACzF,SAAS,KAAK,CAAC,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG;gBACrD,GAAG,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,QAAQ,EAAE,CACtD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,iBAAiB,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CACR,iBAAiB,CAAC,MAAM,CAAC,WAAW,EAAE;YACpC,QAAQ;YACR,GAAG,CAAC,OAAO,EAAE,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;SACvF,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A number and the noun it counts.
|
|
3
|
+
*
|
|
4
|
+
* Layer 1. Imports nothing.
|
|
5
|
+
*
|
|
6
|
+
* Every line edfcore prints that leads with a count needs the same two characters decided, and
|
|
7
|
+
* before this the package decided them three different ways. `formatValidationReport` had a
|
|
8
|
+
* private `pluralise` and used it; `formatHeader` interpolated the noun raw, so the first line of
|
|
9
|
+
* `edfcore header` read `EDF · 1 signals · 6 records` on a one-signal file and the diagnostic
|
|
10
|
+
* summary under it read `2 warning`; and three other lines wrote `1 gap(s)`, which is right but is
|
|
11
|
+
* a third convention. Two commands over one file disagreed about the same number — `validate` said
|
|
12
|
+
* "scanned 1 record" while `header` said "1 records", eight lines apart in the same terminal.
|
|
13
|
+
*
|
|
14
|
+
* 0.4.421 fixed exactly this inside `formatValidationReport` and named the reason: one function,
|
|
15
|
+
* two conventions, and the ungrammatical one on the line a reader sees first. The fix was a
|
|
16
|
+
* private helper, so the other five sites kept their own answer. This is that helper, one layer
|
|
17
|
+
* down, where every printer can reach it.
|
|
18
|
+
*
|
|
19
|
+
* English only, and deliberately: edfcore emits no localised text anywhere, `formatDiagnostics`
|
|
20
|
+
* states that its output is deterministic and free of locale-sensitive formatting, and a plural
|
|
21
|
+
* rule that consulted a locale would be the first thing to break it.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* The noun alone, agreeing with a count that is printed separately.
|
|
25
|
+
*
|
|
26
|
+
* Two lines of `formatValidationReport` group their number — `read 1,048,576 bytes` — so they
|
|
27
|
+
* cannot hand the count to `pluralise` and get the grouping back. Splitting the rule in two is
|
|
28
|
+
* what keeps those lines on the same rule as the rest rather than spelling it out again beside a
|
|
29
|
+
* `toLocaleString`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function plural(noun: string, count: number): string;
|
|
32
|
+
/** `1 record`, `2 records`. The noun is written singular; only a regular `s` is added. */
|
|
33
|
+
export declare function pluralise(count: number, noun: string): string;
|
|
34
|
+
//# sourceMappingURL=counted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"counted.d.ts","sourceRoot":"","sources":["../../src/text/counted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,0FAA0F;AAC1F,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A number and the noun it counts.
|
|
3
|
+
*
|
|
4
|
+
* Layer 1. Imports nothing.
|
|
5
|
+
*
|
|
6
|
+
* Every line edfcore prints that leads with a count needs the same two characters decided, and
|
|
7
|
+
* before this the package decided them three different ways. `formatValidationReport` had a
|
|
8
|
+
* private `pluralise` and used it; `formatHeader` interpolated the noun raw, so the first line of
|
|
9
|
+
* `edfcore header` read `EDF · 1 signals · 6 records` on a one-signal file and the diagnostic
|
|
10
|
+
* summary under it read `2 warning`; and three other lines wrote `1 gap(s)`, which is right but is
|
|
11
|
+
* a third convention. Two commands over one file disagreed about the same number — `validate` said
|
|
12
|
+
* "scanned 1 record" while `header` said "1 records", eight lines apart in the same terminal.
|
|
13
|
+
*
|
|
14
|
+
* 0.4.421 fixed exactly this inside `formatValidationReport` and named the reason: one function,
|
|
15
|
+
* two conventions, and the ungrammatical one on the line a reader sees first. The fix was a
|
|
16
|
+
* private helper, so the other five sites kept their own answer. This is that helper, one layer
|
|
17
|
+
* down, where every printer can reach it.
|
|
18
|
+
*
|
|
19
|
+
* English only, and deliberately: edfcore emits no localised text anywhere, `formatDiagnostics`
|
|
20
|
+
* states that its output is deterministic and free of locale-sensitive formatting, and a plural
|
|
21
|
+
* rule that consulted a locale would be the first thing to break it.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* The noun alone, agreeing with a count that is printed separately.
|
|
25
|
+
*
|
|
26
|
+
* Two lines of `formatValidationReport` group their number — `read 1,048,576 bytes` — so they
|
|
27
|
+
* cannot hand the count to `pluralise` and get the grouping back. Splitting the rule in two is
|
|
28
|
+
* what keeps those lines on the same rule as the rest rather than spelling it out again beside a
|
|
29
|
+
* `toLocaleString`.
|
|
30
|
+
*/
|
|
31
|
+
export function plural(noun, count) {
|
|
32
|
+
return count === 1 ? noun : `${noun}s`;
|
|
33
|
+
}
|
|
34
|
+
/** `1 record`, `2 records`. The noun is written singular; only a regular `s` is added. */
|
|
35
|
+
export function pluralise(count, noun) {
|
|
36
|
+
return `${count} ${plural(noun, count)}`;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=counted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"counted.js","sourceRoot":"","sources":["../../src/text/counted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM,CAAC,IAAY,EAAE,KAAa;IAChD,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC;AACzC,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,SAAS,CAAC,KAAa,EAAE,IAAY;IACnD,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;AAC3C,CAAC"}
|
package/dist/text/printable.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Text from a file, on its way to a terminal.
|
|
3
3
|
*
|
|
4
|
-
* Layer 1, and
|
|
5
|
-
*
|
|
4
|
+
* Layer 1, and one function, used by everything that prints a string edfcore read out of a file
|
|
5
|
+
* rather than wrote itself. `counted.ts` beside it is the other half of the same job: the text
|
|
6
|
+
* edfcore writes itself, where the decision is a plural rather than a control character.
|
|
6
7
|
*
|
|
7
8
|
* The rule it enforces is that a value can never become structure. EDF pads a label to 16 bytes
|
|
8
9
|
* with spaces and says nothing about what else may be in them, and EDF+ annotation text is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printable.d.ts","sourceRoot":"","sources":["../../src/text/printable.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"printable.d.ts","sourceRoot":"","sources":["../../src/text/printable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO9C"}
|
package/dist/text/printable.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Text from a file, on its way to a terminal.
|
|
3
3
|
*
|
|
4
|
-
* Layer 1, and
|
|
5
|
-
*
|
|
4
|
+
* Layer 1, and one function, used by everything that prints a string edfcore read out of a file
|
|
5
|
+
* rather than wrote itself. `counted.ts` beside it is the other half of the same job: the text
|
|
6
|
+
* edfcore writes itself, where the decision is a plural rather than a control character.
|
|
6
7
|
*
|
|
7
8
|
* The rule it enforces is that a value can never become structure. EDF pads a label to 16 bytes
|
|
8
9
|
* with spaces and says nothing about what else may be in them, and EDF+ annotation text is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printable.js","sourceRoot":"","sources":["../../src/text/printable.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"printable.js","sourceRoot":"","sources":["../../src/text/printable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,6FAA6F;AAC7F,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,MAAM,SAAS,IAAI,IAAI,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC3C,GAAG,IAAI,IAAI,GAAG,IAAI,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IACxD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,51 @@ 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.6.4
|
|
10
|
+
|
|
11
|
+
- **Fixed** six lines that followed a count of one with a plural. The first line of
|
|
12
|
+
`edfcore header` read `EDF · 1 signals · 6 records` on a one-signal file; the diagnostic summary
|
|
13
|
+
under it read `2 warning`; `edfcore gaps` said `no gaps in 1 records`; and
|
|
14
|
+
`formatValidationReport` said `over 1 samples` and would have said `read 1 bytes`.
|
|
15
|
+
- 0.4.421 fixed exactly this once, inside `formatValidationReport`, and named the reason: one
|
|
16
|
+
function, two conventions, and the ungrammatical one on the line a reader sees first. The fix was
|
|
17
|
+
a private `pluralise`, so it reached that formatter and nothing else — and the line a reader sees
|
|
18
|
+
first is not in that formatter. Two commands over one file disagreed about the same number:
|
|
19
|
+
`validate` said `scanned 1 record` and `header` said `1 records`, eight lines apart.
|
|
20
|
+
- The helper is now `src/text/counted.ts`, a layer down where every printer can reach it, beside
|
|
21
|
+
`printable.ts` — the other half of the same job, for the text edfcore reads rather than writes.
|
|
22
|
+
It is two functions, because two report lines group their number with `toLocaleString` and
|
|
23
|
+
cannot hand the count over and get the grouping back.
|
|
24
|
+
- `a-count-of-one.test.ts` is the check, and it is not a list of the six. It scans the whole output
|
|
25
|
+
of every printer and all six commands over every shape in the matrix, plus a file that is one of
|
|
26
|
+
everything, for a count of one followed by a plural of anything this package counts — so a
|
|
27
|
+
seventh site fails there rather than being found by reading a terminal. The nouns are named,
|
|
28
|
+
because `signal 1 is labelled "Resp"` is a real diagnostic that no rule about the shape of the
|
|
29
|
+
text tells apart from `1 signals`.
|
|
30
|
+
- `1 gap(s)` and `1 diagnostic(s)` are untouched. The parenthesised form is correct, and it is a
|
|
31
|
+
third convention rather than a defect.
|
|
32
|
+
|
|
33
|
+
## 0.6.3
|
|
34
|
+
|
|
35
|
+
- **Documented and pinned** what `JSON.stringify` does to a result, which is two different things
|
|
36
|
+
depending on which value you hand it. `design-decisions.md` already said ticks "do not survive
|
|
37
|
+
`JSON.stringify` without a replacer"; that is the loud half, and a caller adds a replacer and
|
|
38
|
+
moves on. The quiet half is that a replacer does not make the result JSON-safe: `Int32Array`
|
|
39
|
+
samples, `BigInt64Array` onsets and a diagnostic's `rawBytes` serialise as objects keyed by
|
|
40
|
+
numeric strings, and a property whose value is `undefined` is dropped rather than kept.
|
|
41
|
+
- So a round trip returns something with no `.length` where the caller expects one, `toPhysical`
|
|
42
|
+
will not take it, and `'durationSeconds' in annotation` is true before and false after. Nothing
|
|
43
|
+
fails at the call site; it fails wherever the value is next indexed into.
|
|
44
|
+
- `what-crosses-json.test.ts` is the sibling of `what-crosses-a-worker.test.ts` and gives the same
|
|
45
|
+
treatment to the boundary people actually use — a cache entry, a log line, a POST body. Over
|
|
46
|
+
every shape in the matrix it pins the exact split: a graph throws if and only if it holds a
|
|
47
|
+
`bigint` JSON would reach, an empty `BigInt64Array` included on the "no" side because there is no
|
|
48
|
+
element to refuse. Six of the values a caller reaches for throw and two do not, and the two that
|
|
49
|
+
do not are the ones with bytes rather than ticks in them.
|
|
50
|
+
- The shape that works is the one `edfcore json` already emits — named primitive fields — and that
|
|
51
|
+
command is now checked as the worked example of it.
|
|
52
|
+
- No behaviour changed.
|
|
53
|
+
|
|
9
54
|
## 0.6.2
|
|
10
55
|
|
|
11
56
|
- **Fixed** a misspelled `redactFields` name being ignored. Redaction matches exactly against
|
package/package.json
CHANGED
package/src/cli-run.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { formatValidationReport } from './format-report.js';
|
|
|
16
16
|
import { byteSource } from './io/bytes.js';
|
|
17
17
|
import { buildRecordIndex } from './record-index.js';
|
|
18
18
|
import { openEdf, readAnnotations } from './recording.js';
|
|
19
|
+
import { pluralise } from './text/counted.js';
|
|
19
20
|
import { printable } from './text/printable.js';
|
|
20
21
|
import { validateRecording } from './validate.js';
|
|
21
22
|
|
|
@@ -350,7 +351,7 @@ export async function runCli(args: Args, io: CliIo): Promise<number> {
|
|
|
350
351
|
const index = await buildRecordIndex(recording);
|
|
351
352
|
const gaps = index.gaps ?? [];
|
|
352
353
|
if (gaps.length === 0) {
|
|
353
|
-
io.out(`no gaps in ${index.recordCount}
|
|
354
|
+
io.out(`no gaps in ${pluralise(index.recordCount, 'record')}\n`);
|
|
354
355
|
return 0;
|
|
355
356
|
}
|
|
356
357
|
|
|
@@ -364,7 +365,7 @@ export async function runCli(args: Args, io: CliIo): Promise<number> {
|
|
|
364
365
|
overlaps === 0
|
|
365
366
|
? `${gaps.length} gap(s)`
|
|
366
367
|
: `${gaps.length - overlaps} gap(s) and ${overlaps} overlap(s)`;
|
|
367
|
-
io.out(`${counted} in ${index.recordCount}
|
|
368
|
+
io.out(`${counted} in ${pluralise(index.recordCount, 'record')}\n\n`);
|
|
368
369
|
|
|
369
370
|
for (const gap of gaps) {
|
|
370
371
|
const overlap = gap.durationSeconds < 0;
|
package/src/constants.ts
CHANGED
package/src/format-header.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { trimEdfField } from './bytes/latin1.js';
|
|
|
16
16
|
import { TICKS_PER_SECOND } from './constants.js';
|
|
17
17
|
import { summarizeDiagnostics } from './diagnostics/summary.js';
|
|
18
18
|
import { formatCalendarDate } from './header/dates.js';
|
|
19
|
+
import { pluralise } from './text/counted.js';
|
|
19
20
|
import { printable } from './text/printable.js';
|
|
20
21
|
import type { EdfCalendarDate, EdfHeader, FormatHeaderOptions } from './types.js';
|
|
21
22
|
|
|
@@ -67,8 +68,13 @@ export function formatHeader(header: EdfHeader, options?: FormatHeaderOptions):
|
|
|
67
68
|
const lines: string[] = [];
|
|
68
69
|
const start = header.startTime;
|
|
69
70
|
|
|
71
|
+
// Through `pluralise`, which is the whole reason that helper is a module rather than a private
|
|
72
|
+
// function in the formatter next door. This is the first line of `edfcore header`, and on the
|
|
73
|
+
// one-signal file that most of this suite is built from it read `EDF · 1 signals · 6 records`
|
|
74
|
+
// while `edfcore validate` on the same file said `scanned 6 records` correctly (fixed in 0.6.4).
|
|
70
75
|
lines.push(
|
|
71
|
-
`${header.variant} · ${header.signals.length}
|
|
76
|
+
`${header.variant} · ${pluralise(header.signals.length, 'signal')} · ` +
|
|
77
|
+
`${pluralise(header.recordCount, 'record')}`,
|
|
72
78
|
);
|
|
73
79
|
// `unknown`, not a substituted midnight. The module promise two paragraphs up is that a field
|
|
74
80
|
// edfcore could not resolve prints as `unknown` rather than as a plausible default, and the date
|
|
@@ -170,7 +176,9 @@ export function formatHeader(header: EdfHeader, options?: FormatHeaderOptions):
|
|
|
170
176
|
] as const
|
|
171
177
|
)
|
|
172
178
|
.filter(([count]) => count > 0)
|
|
173
|
-
.
|
|
179
|
+
// The 0.4.421 defect verbatim, in the other formatter: `2 warning`, under a heading that
|
|
180
|
+
// had already counted them. `formatValidationReport` was fixed then and this was not.
|
|
181
|
+
.map(([count, severity]) => pluralise(count, severity))
|
|
174
182
|
.join(', ');
|
|
175
183
|
lines.push(`${header.diagnostics.length} diagnostic(s): ${summary}`);
|
|
176
184
|
if (options?.diagnosticsHint !== false) {
|
package/src/format-report.ts
CHANGED
|
@@ -15,16 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
import { assertRedactableFields, formatDiagnostics } from './diagnostics/format.js';
|
|
17
17
|
import { summarizeDiagnostics } from './diagnostics/summary.js';
|
|
18
|
+
import { plural, pluralise } from './text/counted.js';
|
|
18
19
|
import { printable } from './text/printable.js';
|
|
19
20
|
import type { EdfHeader, FormatReportOptions, ValidationReport } from './types.js';
|
|
20
21
|
|
|
21
22
|
/** Enough to see the pattern, few enough to read. Override with `maxItems`. */
|
|
22
23
|
const DEFAULT_MAX_ITEMS = 20;
|
|
23
24
|
|
|
24
|
-
function pluralise(count: number, noun: string): string {
|
|
25
|
-
return `${count} ${noun}${count === 1 ? '' : 's'}`;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
25
|
/**
|
|
29
26
|
* A multi-line summary of a validation report.
|
|
30
27
|
*
|
|
@@ -58,7 +55,8 @@ export function formatValidationReport(
|
|
|
58
55
|
] as const
|
|
59
56
|
)
|
|
60
57
|
.filter(([count]) => count > 0)
|
|
61
|
-
// Through `pluralise`, like the record count on the line below
|
|
58
|
+
// Through `pluralise`, like the record count on the line below, and since 0.6.4 like
|
|
59
|
+
// every other count this package prints. Until 0.4.421 this
|
|
62
60
|
// interpolated the severity name raw, so the first line of every `edfcore validate`
|
|
63
61
|
// read "2 error, 1 warning, 2 info" above a line reading "scanned 12 records" — one
|
|
64
62
|
// function, two conventions, and the ungrammatical one on the line a reader sees first.
|
|
@@ -67,7 +65,7 @@ export function formatValidationReport(
|
|
|
67
65
|
lines.push(`${verdict} — ${severities}`);
|
|
68
66
|
lines.push(
|
|
69
67
|
`scanned ${pluralise(report.recordsScanned, 'record')}, ` +
|
|
70
|
-
`read ${report.bytesRead.toLocaleString('en-US')}
|
|
68
|
+
`read ${report.bytesRead.toLocaleString('en-US')} ${plural('byte', report.bytesRead)}`,
|
|
71
69
|
);
|
|
72
70
|
|
|
73
71
|
if (summary.byCode.length > 0) {
|
|
@@ -94,7 +92,8 @@ export function formatValidationReport(
|
|
|
94
92
|
: '';
|
|
95
93
|
lines.push(
|
|
96
94
|
` ${name.slice(0, 20).padEnd(21)}${stats.observedDigitalMin}..${stats.observedDigitalMax}` +
|
|
97
|
-
` over ${stats.sampleCount.toLocaleString('en-US')}
|
|
95
|
+
` over ${stats.sampleCount.toLocaleString('en-US')} ` +
|
|
96
|
+
`${plural('sample', stats.sampleCount)}${overflow}`,
|
|
98
97
|
);
|
|
99
98
|
}
|
|
100
99
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A number and the noun it counts.
|
|
3
|
+
*
|
|
4
|
+
* Layer 1. Imports nothing.
|
|
5
|
+
*
|
|
6
|
+
* Every line edfcore prints that leads with a count needs the same two characters decided, and
|
|
7
|
+
* before this the package decided them three different ways. `formatValidationReport` had a
|
|
8
|
+
* private `pluralise` and used it; `formatHeader` interpolated the noun raw, so the first line of
|
|
9
|
+
* `edfcore header` read `EDF · 1 signals · 6 records` on a one-signal file and the diagnostic
|
|
10
|
+
* summary under it read `2 warning`; and three other lines wrote `1 gap(s)`, which is right but is
|
|
11
|
+
* a third convention. Two commands over one file disagreed about the same number — `validate` said
|
|
12
|
+
* "scanned 1 record" while `header` said "1 records", eight lines apart in the same terminal.
|
|
13
|
+
*
|
|
14
|
+
* 0.4.421 fixed exactly this inside `formatValidationReport` and named the reason: one function,
|
|
15
|
+
* two conventions, and the ungrammatical one on the line a reader sees first. The fix was a
|
|
16
|
+
* private helper, so the other five sites kept their own answer. This is that helper, one layer
|
|
17
|
+
* down, where every printer can reach it.
|
|
18
|
+
*
|
|
19
|
+
* English only, and deliberately: edfcore emits no localised text anywhere, `formatDiagnostics`
|
|
20
|
+
* states that its output is deterministic and free of locale-sensitive formatting, and a plural
|
|
21
|
+
* rule that consulted a locale would be the first thing to break it.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The noun alone, agreeing with a count that is printed separately.
|
|
26
|
+
*
|
|
27
|
+
* Two lines of `formatValidationReport` group their number — `read 1,048,576 bytes` — so they
|
|
28
|
+
* cannot hand the count to `pluralise` and get the grouping back. Splitting the rule in two is
|
|
29
|
+
* what keeps those lines on the same rule as the rest rather than spelling it out again beside a
|
|
30
|
+
* `toLocaleString`.
|
|
31
|
+
*/
|
|
32
|
+
export function plural(noun: string, count: number): string {
|
|
33
|
+
return count === 1 ? noun : `${noun}s`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** `1 record`, `2 records`. The noun is written singular; only a regular `s` is added. */
|
|
37
|
+
export function pluralise(count: number, noun: string): string {
|
|
38
|
+
return `${count} ${plural(noun, count)}`;
|
|
39
|
+
}
|
package/src/text/printable.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Text from a file, on its way to a terminal.
|
|
3
3
|
*
|
|
4
|
-
* Layer 1, and
|
|
5
|
-
*
|
|
4
|
+
* Layer 1, and one function, used by everything that prints a string edfcore read out of a file
|
|
5
|
+
* rather than wrote itself. `counted.ts` beside it is the other half of the same job: the text
|
|
6
|
+
* edfcore writes itself, where the decision is a plural rather than a control character.
|
|
6
7
|
*
|
|
7
8
|
* The rule it enforces is that a value can never become structure. EDF pads a label to 16 bytes
|
|
8
9
|
* with spaces and says nothing about what else may be in them, and EDF+ annotation text is
|