edfcore 0.6.253 → 0.6.254
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/summary.d.ts.map +1 -1
- package/dist/diagnostics/summary.js +25 -0
- package/dist/diagnostics/summary.js.map +1 -1
- package/docs/CHANGELOG.md +16 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/diagnostics/summary.ts +27 -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.254";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/diagnostics/summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEjF;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;CAC1C;AA+BD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,SAAS,aAAa,EAAE,GAAG,oBAAoB,
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/diagnostics/summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEjF;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;CAC1C;AA+BD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,SAAS,aAAa,EAAE,GAAG,oBAAoB,CA0EhG"}
|
|
@@ -59,6 +59,31 @@ export function summarizeDiagnostics(diagnostics) {
|
|
|
59
59
|
// no mention of the three places a caller gets a list (fixed in 0.6.107).
|
|
60
60
|
// Cast in the test, not on the value: `Array.isArray` over a `readonly T[]` narrows the whole
|
|
61
61
|
// parameter to `any[]` and the element type is lost for the rest of the function.
|
|
62
|
+
/*
|
|
63
|
+
* A FORGOTTEN AWAIT, ahead of it, because "not an array" is true of a pending Promise and the
|
|
64
|
+
* advice below names three fields the caller does not have yet.
|
|
65
|
+
*
|
|
66
|
+
* `formatDiagnostics` names the keyword one directory over — it reads its subject out of
|
|
67
|
+
* `describeValue`, whose own note lists the five async calls whose resolved values other guards
|
|
68
|
+
* take and says a message about "an object" is "true of the thing they meant to pass too". This
|
|
69
|
+
* function is that note's twin and was left out of it: it takes the same array, `format.ts`
|
|
70
|
+
* says so in its own `Next:` clause, and a reader who follows that clause from there arrives
|
|
71
|
+
* here with the same Promise.
|
|
72
|
+
*
|
|
73
|
+
* The keyword is half of it, the way it is for `resolveTimeWindow` and `buildTimeline` (0.6.253):
|
|
74
|
+
* none of these calls resolves to a diagnostics array. Each resolves to the header, the report,
|
|
75
|
+
* the chunk or the recording that CARRIES one, so the fix is a field as well as a keyword.
|
|
76
|
+
*
|
|
77
|
+
* A property read and said in words, for the two reasons this module already gives: nothing here
|
|
78
|
+
* awaits or subscribes to anything, and the check below is "described in words rather than by
|
|
79
|
+
* type" so that any layer can summarise without taking on a dependency.
|
|
80
|
+
*/
|
|
81
|
+
if (typeof diagnostics?.then === 'function') {
|
|
82
|
+
throw new RangeError('summarizeDiagnostics(): the diagnostics are a pending Promise, so there is nothing to ' +
|
|
83
|
+
'summarise yet — and no call in this package resolves to a diagnostics array, so the ' +
|
|
84
|
+
'keyword is half of the fix. Next: pass (await readHeader(source)).diagnostics, or the ' +
|
|
85
|
+
'diagnostics on the recording, chunk or report you already have.');
|
|
86
|
+
}
|
|
62
87
|
if (!Array.isArray(diagnostics)) {
|
|
63
88
|
throw new RangeError('summarizeDiagnostics(): the diagnostics are not an array, so there is nothing to ' +
|
|
64
89
|
'summarise. Next: pass header.diagnostics, or the diagnostics on the chunk or the ' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.js","source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Q,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;YACrF,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC;QAC9B,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE;YAC1B,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,qFAAqF;YACrF,QAAQ,EAAE,QAAQ,EAAE,QAAQ,IAAI,UAAU,CAAC,QAAQ;YACnD,KAAK,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC;SAClC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,KAAK,EAAE,WAAW,CAAC,MAAM;QACzB,MAAM;QACN,QAAQ;QACR,KAAK;QACL,KAAK;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;KAC9E,CAAC;AACJ,CAAC"}
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,22 @@ 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.254
|
|
10
|
+
|
|
11
|
+
- **Fixed** `summarizeDiagnostics` telling a pending Promise only that "the diagnostics are not an
|
|
12
|
+
array" — true of a Promise, and of a header, a report, a chunk, a recording, a string and a number.
|
|
13
|
+
It and `formatDiagnostics` are the two calls that take a diagnostics array, `format.ts` sends
|
|
14
|
+
readers across in its own `Next:` clause, and one of the two named the keyword.
|
|
15
|
+
- The keyword is half of the fix, as it is for `resolveTimeWindow` in 0.6.253: no call in this
|
|
16
|
+
package resolves to a diagnostics array. `readHeader` resolves to the header carrying one,
|
|
17
|
+
`validateRecording` to the report, `readWindow` to the chunks — so the message names a field too.
|
|
18
|
+
- `one-keyword-short.test.ts` recorded the old wording as a consequence of this module importing "one
|
|
19
|
+
type module and nothing else", which is what lets any layer summarise without taking on a
|
|
20
|
+
dependency. That constraint is about the import and not about the sentence: the new branch is a
|
|
21
|
+
property read written out in words and adds no import, so both hold.
|
|
22
|
+
- The existing refusal is unchanged for the values it was written for, and an empty array is still a
|
|
23
|
+
summary of nothing.
|
|
24
|
+
|
|
9
25
|
## 0.6.253
|
|
10
26
|
|
|
11
27
|
- **Fixed** `resolveTimeWindow` telling a pending `buildTimeline(source, header)` that it "has no
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -92,6 +92,33 @@ export function summarizeDiagnostics(diagnostics: readonly EdfDiagnostic[]): Edf
|
|
|
92
92
|
// no mention of the three places a caller gets a list (fixed in 0.6.107).
|
|
93
93
|
// Cast in the test, not on the value: `Array.isArray` over a `readonly T[]` narrows the whole
|
|
94
94
|
// parameter to `any[]` and the element type is lost for the rest of the function.
|
|
95
|
+
/*
|
|
96
|
+
* A FORGOTTEN AWAIT, ahead of it, because "not an array" is true of a pending Promise and the
|
|
97
|
+
* advice below names three fields the caller does not have yet.
|
|
98
|
+
*
|
|
99
|
+
* `formatDiagnostics` names the keyword one directory over — it reads its subject out of
|
|
100
|
+
* `describeValue`, whose own note lists the five async calls whose resolved values other guards
|
|
101
|
+
* take and says a message about "an object" is "true of the thing they meant to pass too". This
|
|
102
|
+
* function is that note's twin and was left out of it: it takes the same array, `format.ts`
|
|
103
|
+
* says so in its own `Next:` clause, and a reader who follows that clause from there arrives
|
|
104
|
+
* here with the same Promise.
|
|
105
|
+
*
|
|
106
|
+
* The keyword is half of it, the way it is for `resolveTimeWindow` and `buildTimeline` (0.6.253):
|
|
107
|
+
* none of these calls resolves to a diagnostics array. Each resolves to the header, the report,
|
|
108
|
+
* the chunk or the recording that CARRIES one, so the fix is a field as well as a keyword.
|
|
109
|
+
*
|
|
110
|
+
* A property read and said in words, for the two reasons this module already gives: nothing here
|
|
111
|
+
* awaits or subscribes to anything, and the check below is "described in words rather than by
|
|
112
|
+
* type" so that any layer can summarise without taking on a dependency.
|
|
113
|
+
*/
|
|
114
|
+
if (typeof (diagnostics as { then?: unknown } | null | undefined)?.then === 'function') {
|
|
115
|
+
throw new RangeError(
|
|
116
|
+
'summarizeDiagnostics(): the diagnostics are a pending Promise, so there is nothing to ' +
|
|
117
|
+
'summarise yet — and no call in this package resolves to a diagnostics array, so the ' +
|
|
118
|
+
'keyword is half of the fix. Next: pass (await readHeader(source)).diagnostics, or the ' +
|
|
119
|
+
'diagnostics on the recording, chunk or report you already have.',
|
|
120
|
+
);
|
|
121
|
+
}
|
|
95
122
|
if (!Array.isArray(diagnostics as unknown)) {
|
|
96
123
|
throw new RangeError(
|
|
97
124
|
'summarizeDiagnostics(): the diagnostics are not an array, so there is nothing to ' +
|