edfcore 0.6.129 → 0.6.130
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/dist/diagnostics/format.d.ts.map +1 -1
- package/dist/diagnostics/format.js +2 -1
- package/dist/diagnostics/format.js.map +1 -1
- package/dist/format-annotations.d.ts.map +1 -1
- package/dist/format-annotations.js +2 -1
- package/dist/format-annotations.js.map +1 -1
- package/dist/format-report.d.ts.map +1 -1
- package/dist/format-report.js +2 -0
- package/dist/format-report.js.map +1 -1
- package/dist/options.d.ts +17 -0
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +23 -0
- package/dist/options.js.map +1 -1
- package/docs/CHANGELOG.md +11 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/diagnostics/format.ts +2 -1
- package/src/format-annotations.ts +2 -1
- package/src/format-report.ts +2 -0
- package/src/options.ts +25 -0
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.6.
|
|
112
|
+
export declare const VERSION = "0.6.130";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/diagnostics/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,aAAa,CAAC;AAE9D;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAmBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI,CAUlF;AAgBD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,OAAO,CAAC,EAAE,wBAAwB,GACjC,MAAM,
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/diagnostics/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,aAAa,CAAC;AAE9D;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAmBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI,CAUlF;AAgBD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,OAAO,CAAC,EAAE,wBAAwB,GACjC,MAAM,CAkCR"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { trimEdfField } from '../bytes/latin1.js';
|
|
12
12
|
import { HEADER_FIELDS, SIGNAL_FIELD_WIDTHS } from '../constants.js';
|
|
13
|
-
import { requireItemLimit } from '../options.js';
|
|
13
|
+
import { assertOptions, requireItemLimit } from '../options.js';
|
|
14
14
|
import { describeValue } from '../text/describe.js';
|
|
15
15
|
import { printable } from '../text/printable.js';
|
|
16
16
|
/**
|
|
@@ -83,6 +83,7 @@ export function formatDiagnostics(diagnostics, options) {
|
|
|
83
83
|
'chunk or the report you have.');
|
|
84
84
|
}
|
|
85
85
|
const color = options?.color === true;
|
|
86
|
+
assertOptions(options, 'formatDiagnostics', 'diagnostic');
|
|
86
87
|
const shown = requireItemLimit(options?.maxItems, diagnostics.length);
|
|
87
88
|
const lines = [];
|
|
88
89
|
assertRedactableFields(options?.redactFields);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/diagnostics/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/diagnostics/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA4BjD;;;;;;;;GAQG;AACH,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC;IACrD,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;IAC7B,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC;IACnC,aAAa;IACb,QAAQ;IACR,kBAAkB;CACnB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,sBAAsB,CAAC,MA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KAAK,GAAG,IAAI,IAAI,KAAK,IAAI;YAAE,GAAG,IAAI,KAAK,IAAI,EAAE,CAAC;aACjD,IAAI,gBAAgB,CAAC,IAAI,CAAC;YAAE,GAAG,IAAI,IAAI,CAAC;aACxC,IAAI,IAAI,IAAI,IAAI;YAAE,GAAG,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;;YACpE,GAAG,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC;IAC1C,CAAC;IACD,OAAO,GAAG,GAAG,GAAG,CAAC;AACnB,CAAC;AAED,SAAS,KAAK,CAAC,IAAY,EAAE,KAAa,EAAE,OAAgB;IAC1D,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-annotations.d.ts","sourceRoot":"","sources":["../src/format-annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,kGAAkG;IAClG,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;CACnC;AA0CD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,OAAO,CAAC,EAAE,wBAAwB,GACjC,MAAM,
|
|
1
|
+
{"version":3,"file":"format-annotations.d.ts","sourceRoot":"","sources":["../src/format-annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,kGAAkG;IAClG,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;CACnC;AA0CD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,SAAS,aAAa,EAAE,EACrC,OAAO,CAAC,EAAE,wBAAwB,GACjC,MAAM,CAsER"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* file says. Clamping it to zero would silently move an event.
|
|
16
16
|
*/
|
|
17
17
|
import { TICKS_PER_SECOND } from './constants.js';
|
|
18
|
-
import { requireItemLimit } from './options.js';
|
|
18
|
+
import { assertOptions, requireItemLimit } from './options.js';
|
|
19
19
|
import { floorDiv } from './tal/ticks.js';
|
|
20
20
|
import { describeValue } from './text/describe.js';
|
|
21
21
|
import { printable } from './text/printable.js';
|
|
@@ -78,6 +78,7 @@ export function formatAnnotations(annotations, options) {
|
|
|
78
78
|
}
|
|
79
79
|
if (annotations.length === 0)
|
|
80
80
|
return '';
|
|
81
|
+
assertOptions(options, 'formatAnnotations', 'annotation');
|
|
81
82
|
const limit = requireItemLimit(options?.maxItems, annotations.length);
|
|
82
83
|
/*
|
|
83
84
|
* Both time columns are sized from the rows being printed, the way `formatHeader` sizes its
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-annotations.js","sourceRoot":"","sources":["../src/format-annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"format-annotations.js","sourceRoot":"","sources":["../src/format-annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;A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AAI,CAAC,IAAI,CAAC,WAAW,MAAM,OAAO,CAAC,CAAC;IAEpD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,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;AAOH,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,CA2HR;AAED,qFAAqF;AACrF,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/format-report.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { assertRedactableFields, formatDiagnostics } from './diagnostics/format.js';
|
|
16
16
|
import { summarizeDiagnostics } from './diagnostics/summary.js';
|
|
17
|
+
import { assertOptions } from './options.js';
|
|
17
18
|
import { plural, pluralise } from './text/counted.js';
|
|
18
19
|
import { printable } from './text/printable.js';
|
|
19
20
|
/** Enough to see the pattern, few enough to read. Override with `maxItems`. */
|
|
@@ -47,6 +48,7 @@ export function formatValidationReport(report, options) {
|
|
|
47
48
|
// Before anything is rendered, and outside the `diagnostics.length > 0` branch below. A report
|
|
48
49
|
// that passes still has to report a misspelled `redactFields`: the typo belongs to the call, and
|
|
49
50
|
// the clean file is the cheap place to find out about it.
|
|
51
|
+
assertOptions(options, 'formatValidationReport', 'diagnostic');
|
|
50
52
|
assertRedactableFields(options?.redactFields);
|
|
51
53
|
// One counting implementation, shared with the public `summarizeDiagnostics`.
|
|
52
54
|
const summary = summ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;gBACpF,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,QAAQ,EAAE,CAC/B,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"}
|
package/dist/options.d.ts
CHANGED
|
@@ -37,6 +37,23 @@ export declare function requireFiniteOption(value: number | undefined, name: str
|
|
|
37
37
|
* it. `parseArgs` has refused a `NaN --limit` since the flag existed, and says why in a comment;
|
|
38
38
|
* the library function underneath it did the thing that comment describes.
|
|
39
39
|
*/
|
|
40
|
+
/**
|
|
41
|
+
* The OPTIONS object, in the three formatters that take a `maxItems`.
|
|
42
|
+
*
|
|
43
|
+
* Every option in this package is a field on one, so the number a caller means IS the option:
|
|
44
|
+
* `formatAnnotations(annotations, 20)` is what gets written when the intent is twenty rows. A bare
|
|
45
|
+
* number has no `maxItems`, so `options?.maxItems` was `undefined`, `requireItemLimit` took that
|
|
46
|
+
* as "no limit given" — its documented default — and every annotation was printed.
|
|
47
|
+
*
|
|
48
|
+
* Silently. `format-annotations.ts` argues the opposite case at length: truncation "always says how
|
|
49
|
+
* much it withheld", because a listing that stopped without saying so "would be indistinguishable
|
|
50
|
+
* from a recording that simply had no more events". A listing that did NOT truncate when it was
|
|
51
|
+
* asked to is the same confusion from the other side, and on a scoring file with fifty thousand
|
|
52
|
+
* events it is fifty thousand lines where twenty were asked for.
|
|
53
|
+
*
|
|
54
|
+
* `null` and `undefined` still mean "no options", which is what they already meant.
|
|
55
|
+
*/
|
|
56
|
+
export declare function assertOptions(options: unknown, call: string, listed: string): void;
|
|
40
57
|
export declare function requireItemLimit(value: number | undefined, total: number): number;
|
|
41
58
|
/**
|
|
42
59
|
* `maxMaterializeBytes`, or the 256 MiB default.
|
package/dist/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,MAAM,CAqBR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CA4BjF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQ1E"}
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,MAAM,CAqBR;AAED;;;;;;;;;;;;;GAaG;AACH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAOlF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CA4BjF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQ1E"}
|
package/dist/options.js
CHANGED
|
@@ -60,6 +60,29 @@ export function requireFiniteOption(value, name, fallback) {
|
|
|
60
60
|
* it. `parseArgs` has refused a `NaN --limit` since the flag existed, and says why in a comment;
|
|
61
61
|
* the library function underneath it did the thing that comment describes.
|
|
62
62
|
*/
|
|
63
|
+
/**
|
|
64
|
+
* The OPTIONS object, in the three formatters that take a `maxItems`.
|
|
65
|
+
*
|
|
66
|
+
* Every option in this package is a field on one, so the number a caller means IS the option:
|
|
67
|
+
* `formatAnnotations(annotations, 20)` is what gets written when the intent is twenty rows. A bare
|
|
68
|
+
* number has no `maxItems`, so `options?.maxItems` was `undefined`, `requireItemLimit` took that
|
|
69
|
+
* as "no limit given" — its documented default — and every annotation was printed.
|
|
70
|
+
*
|
|
71
|
+
* Silently. `format-annotations.ts` argues the opposite case at length: truncation "always says how
|
|
72
|
+
* much it withheld", because a listing that stopped without saying so "would be indistinguishable
|
|
73
|
+
* from a recording that simply had no more events". A listing that did NOT truncate when it was
|
|
74
|
+
* asked to is the same confusion from the other side, and on a scoring file with fifty thousand
|
|
75
|
+
* events it is fifty thousand lines where twenty were asked for.
|
|
76
|
+
*
|
|
77
|
+
* `null` and `undefined` still mean "no options", which is what they already meant.
|
|
78
|
+
*/
|
|
79
|
+
export function assertOptions(options, call, listed) {
|
|
80
|
+
if (options === undefined || typeof options === 'object')
|
|
81
|
+
return;
|
|
82
|
+
throw new RangeError(`${call}(): the options are ${describeValue(options)}, not an object — maxItems is a field ` +
|
|
83
|
+
`on one, so this call would have listed every ${listed} rather than that many. ` +
|
|
84
|
+
'Next: pass maxItems on an options object.');
|
|
85
|
+
}
|
|
63
86
|
export function requireItemLimit(value, total) {
|
|
64
87
|
if (value === undefined)
|
|
65
88
|
return total;
|
package/dist/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAyB,EACzB,IAAY,EACZ,QAAgB;IAEhB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IACzC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACzC;;;;;;;;;;;;OAYG;IACH,MAAM,IAAI,UAAU,CAClB,WAAW,IAAI,qCAAqC,aAAa,CAAC,KAAK,CAAC,oBAAoB;QAC1F,kFAAkF;QAClF,qCAAqC,CACxC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAyB,EAAE,KAAa;IACvE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACtC;;;;;;;;;;OAUG;IACH,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,UAAU,CAClB,oDAAoD,aAAa,CAAC,KAAK,CAAC,mBAAmB;YACzF,0FAA0F;YAC1F,mDAAmD,CACtD,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,UAAU,CAClB,2FAA2F;YACzF,wFAAwF;YACxF,gCAAgC,CACnC,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,C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B,aAAa,CAAC,OAAO,CAAC,wCAAwC;QAC1F,gDAAgD,MAAM,0BAA0B;QAChF,2CAA2C,CAC9C,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAyB,EAAE,KAAa;IACvE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACtC;;;;;;;;;;OAUG;IACH,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,UAAU,CAClB,oDAAoD,aAAa,CAAC,KAAK,CAAC,mBAAmB;YACzF,0FAA0F;YAC1F,mDAAmD,CACtD,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,UAAU,CAClB,2FAA2F;YACzF,wFAAwF;YACxF,gCAAgC,CACnC,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAyB;IAChE,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,CAAC,CAAC;IAChG,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IAC/B,MAAM,IAAI,UAAU,CAClB,6DAA6D,MAAM,0BAA0B;QAC3F,0DAA0D;QAC1D,GAAG,6BAA6B,gBAAgB,CACnD,CAAC;AACJ,CAAC"}
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,17 @@ 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.130
|
|
10
|
+
|
|
11
|
+
- **Fixed** `formatAnnotations`, `formatDiagnostics` and `formatValidationReport` silently ignoring
|
|
12
|
+
a bare number where their options belong. `formatAnnotations(annotations, 20)` — the call written
|
|
13
|
+
when the intent is twenty rows — printed every annotation instead, with no truncation line to
|
|
14
|
+
give it away.
|
|
15
|
+
- **Behaviour change**: a non-object `options` is now refused. `undefined` and `null` still mean
|
|
16
|
+
"no options", as they already did.
|
|
17
|
+
- `maxItems` is the one option a caller is likely to pass as the whole argument, and its absence is
|
|
18
|
+
indistinguishable from asking for no limit — which is the default these three already had.
|
|
19
|
+
|
|
9
20
|
## 0.6.129
|
|
10
21
|
|
|
11
22
|
- **Fixed** `toPhysicalEnvelope(signal, chunk)` — the envelope chunk passed where one of its
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import { trimEdfField } from '../bytes/latin1.js';
|
|
13
13
|
import { HEADER_FIELDS, SIGNAL_FIELD_WIDTHS } from '../constants.js';
|
|
14
|
-
import { requireItemLimit } from '../options.js';
|
|
14
|
+
import { assertOptions, requireItemLimit } from '../options.js';
|
|
15
15
|
import { describeValue } from '../text/describe.js';
|
|
16
16
|
import { printable } from '../text/printable.js';
|
|
17
17
|
import type { EdfDiagnostic, EdfSeverity } from '../types.js';
|
|
@@ -123,6 +123,7 @@ export function formatDiagnostics(
|
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
125
|
const color = options?.color === true;
|
|
126
|
+
assertOptions(options, 'formatDiagnostics', 'diagnostic');
|
|
126
127
|
const shown = requireItemLimit(options?.maxItems, diagnostics.length);
|
|
127
128
|
const lines: string[] = [];
|
|
128
129
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import { TICKS_PER_SECOND } from './constants.js';
|
|
19
|
-
import { requireItemLimit } from './options.js';
|
|
19
|
+
import { assertOptions, requireItemLimit } from './options.js';
|
|
20
20
|
import { floorDiv } from './tal/ticks.js';
|
|
21
21
|
import { describeValue } from './text/describe.js';
|
|
22
22
|
import { printable } from './text/printable.js';
|
|
@@ -104,6 +104,7 @@ export function formatAnnotations(
|
|
|
104
104
|
}
|
|
105
105
|
if (annotations.length === 0) return '';
|
|
106
106
|
|
|
107
|
+
assertOptions(options, 'formatAnnotations', 'annotation');
|
|
107
108
|
const limit = requireItemLimit(options?.maxItems, annotations.length);
|
|
108
109
|
|
|
109
110
|
/*
|
package/src/format-report.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
import { assertRedactableFields, formatDiagnostics } from './diagnostics/format.js';
|
|
17
17
|
import { summarizeDiagnostics } from './diagnostics/summary.js';
|
|
18
|
+
import { assertOptions } from './options.js';
|
|
18
19
|
import { plural, pluralise } from './text/counted.js';
|
|
19
20
|
import { printable } from './text/printable.js';
|
|
20
21
|
import type { EdfHeader, FormatReportOptions, ValidationReport } from './types.js';
|
|
@@ -57,6 +58,7 @@ export function formatValidationReport(
|
|
|
57
58
|
// Before anything is rendered, and outside the `diagnostics.length > 0` branch below. A report
|
|
58
59
|
// that passes still has to report a misspelled `redactFields`: the typo belongs to the call, and
|
|
59
60
|
// the clean file is the cheap place to find out about it.
|
|
61
|
+
assertOptions(options, 'formatValidationReport', 'diagnostic');
|
|
60
62
|
assertRedactableFields(options?.redactFields);
|
|
61
63
|
|
|
62
64
|
// One counting implementation, shared with the public `summarizeDiagnostics`.
|
package/src/options.ts
CHANGED
|
@@ -67,6 +67,31 @@ export function requireFiniteOption(
|
|
|
67
67
|
* it. `parseArgs` has refused a `NaN --limit` since the flag existed, and says why in a comment;
|
|
68
68
|
* the library function underneath it did the thing that comment describes.
|
|
69
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* The OPTIONS object, in the three formatters that take a `maxItems`.
|
|
72
|
+
*
|
|
73
|
+
* Every option in this package is a field on one, so the number a caller means IS the option:
|
|
74
|
+
* `formatAnnotations(annotations, 20)` is what gets written when the intent is twenty rows. A bare
|
|
75
|
+
* number has no `maxItems`, so `options?.maxItems` was `undefined`, `requireItemLimit` took that
|
|
76
|
+
* as "no limit given" — its documented default — and every annotation was printed.
|
|
77
|
+
*
|
|
78
|
+
* Silently. `format-annotations.ts` argues the opposite case at length: truncation "always says how
|
|
79
|
+
* much it withheld", because a listing that stopped without saying so "would be indistinguishable
|
|
80
|
+
* from a recording that simply had no more events". A listing that did NOT truncate when it was
|
|
81
|
+
* asked to is the same confusion from the other side, and on a scoring file with fifty thousand
|
|
82
|
+
* events it is fifty thousand lines where twenty were asked for.
|
|
83
|
+
*
|
|
84
|
+
* `null` and `undefined` still mean "no options", which is what they already meant.
|
|
85
|
+
*/
|
|
86
|
+
export function assertOptions(options: unknown, call: string, listed: string): void {
|
|
87
|
+
if (options === undefined || typeof options === 'object') return;
|
|
88
|
+
throw new RangeError(
|
|
89
|
+
`${call}(): the options are ${describeValue(options)}, not an object — maxItems is a field ` +
|
|
90
|
+
`on one, so this call would have listed every ${listed} rather than that many. ` +
|
|
91
|
+
'Next: pass maxItems on an options object.',
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
70
95
|
export function requireItemLimit(value: number | undefined, total: number): number {
|
|
71
96
|
if (value === undefined) return total;
|
|
72
97
|
/*
|