edfcore 0.6.268 → 0.6.269
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/text/describe.d.ts.map +1 -1
- package/dist/text/describe.js +19 -0
- package/dist/text/describe.js.map +1 -1
- package/docs/CHANGELOG.md +18 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/text/describe.ts +19 -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.269";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/text/describe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/text/describe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CA2DpD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAC/E,MAAM,CAER"}
|
package/dist/text/describe.js
CHANGED
|
@@ -38,6 +38,25 @@ export function describeValue(value) {
|
|
|
38
38
|
if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) {
|
|
39
39
|
return Object.prototype.toString.call(value).slice(8, -1);
|
|
40
40
|
}
|
|
41
|
+
/*
|
|
42
|
+
* A REGEXP, by the same tag, for the same reason, in the place it is likeliest to turn up.
|
|
43
|
+
*
|
|
44
|
+
* `a-pattern-where-a-label-belongs.test.ts` makes the argument: `matchSignals` takes a pattern and
|
|
45
|
+
* `findSignals` takes a label, and "a montage selector is more often a pattern than an exact
|
|
46
|
+
* label" — so a RegExp handed to the label-matching half is the commoner of the two spellings of
|
|
47
|
+
* that confusion. The guard's advice already names the kind, "matchSignals(header, pattern) for a
|
|
48
|
+
* RegExp or a predicate", while the subject called it "an object" and left the reader to work out
|
|
49
|
+
* that the object they passed was one.
|
|
50
|
+
*
|
|
51
|
+
* A predicate needs nothing here: `typeof` answers `function` and the message says so. A RegExp is
|
|
52
|
+
* the only matcher `typeof` flattens into `object`.
|
|
53
|
+
*
|
|
54
|
+
* `String(value)` is the source as written — `/EEG/i` — which is the whole of what a reader needs
|
|
55
|
+
* to recognise it, and it is a pattern they typed rather than data read out of a file.
|
|
56
|
+
*/
|
|
57
|
+
if (Object.prototype.toString.call(value) === '[object RegExp]') {
|
|
58
|
+
return `the RegExp ${String(value)}`;
|
|
59
|
+
}
|
|
41
60
|
/*
|
|
42
61
|
* A PENDING PROMISE, which is the one object worth naming.
|
|
43
62
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/text/describe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iGAAiG;AACjG,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,cAAc,KAAK,GAAG,CAA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,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,cAAc,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;IAC5E,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAC5C;;;;;;OAMG;IACH,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;QAC9D,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IACD;;;;;;;;;;;;;;;OAeG;IACH,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,iBAAiB,EAAE,CAAC;QAChE,OAAO,cAAc,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IACvC,CAAC;IACD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,OAAQ,KAA4B,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,mBAAmB,CAAC;IACzF,iGAAiG;IACjG,qFAAqF;IACrF,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,OAAO,KAAK,EAAE,CAAC;AACvE,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAgF;IAEhF,OAAO,YAAY,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC;AAC5F,CAAC"}
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,24 @@ 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.269
|
|
10
|
+
|
|
11
|
+
- **Fixed** a RegExp being described as "an object" by the guards that refuse one. `typeof` answers
|
|
12
|
+
`object` for a RegExp and `function` for a predicate, so of the two kinds of matcher this package
|
|
13
|
+
accepts, exactly one was flattened into the word every wrong value shares — while the same
|
|
14
|
+
sentence's advice already named the kind: "matchSignals(header, pattern) for a RegExp or a
|
|
15
|
+
predicate".
|
|
16
|
+
- It is the spelling worth naming. `a-pattern-where-a-label-belongs.test.ts` states why: `matchSignals`
|
|
17
|
+
takes a pattern and `findSignals` takes a label, and "a montage selector is more often a pattern
|
|
18
|
+
than an exact label" — so the RegExp handed to the label-matching half is the commoner of the two,
|
|
19
|
+
and it was the one whose message could not say what had arrived.
|
|
20
|
+
- Named by its built-in tag, which `describe.ts` already uses for a binary value "because that IS the
|
|
21
|
+
mistake wherever one turns up", and 0.6.256 applied to a typed array. The tag rather than
|
|
22
|
+
`instanceof`, because it is the same across realms.
|
|
23
|
+
- The pattern is printed as written, flags and all — `the RegExp /EEG Fp1/i` — which is what a reader
|
|
24
|
+
needs to recognise something they typed. Every other spelling is unchanged, including a plain
|
|
25
|
+
object, an array and a `Map`, and the calls that genuinely take a pattern still take one.
|
|
26
|
+
|
|
9
27
|
## 0.6.268
|
|
10
28
|
|
|
11
29
|
- **Fixed** an array of Promises where a diagnostics array belongs being refused as a by-code summary.
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
package/src/text/describe.ts
CHANGED
|
@@ -34,6 +34,25 @@ export function describeValue(value: unknown): string {
|
|
|
34
34
|
if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) {
|
|
35
35
|
return Object.prototype.toString.call(value).slice(8, -1);
|
|
36
36
|
}
|
|
37
|
+
/*
|
|
38
|
+
* A REGEXP, by the same tag, for the same reason, in the place it is likeliest to turn up.
|
|
39
|
+
*
|
|
40
|
+
* `a-pattern-where-a-label-belongs.test.ts` makes the argument: `matchSignals` takes a pattern and
|
|
41
|
+
* `findSignals` takes a label, and "a montage selector is more often a pattern than an exact
|
|
42
|
+
* label" — so a RegExp handed to the label-matching half is the commoner of the two spellings of
|
|
43
|
+
* that confusion. The guard's advice already names the kind, "matchSignals(header, pattern) for a
|
|
44
|
+
* RegExp or a predicate", while the subject called it "an object" and left the reader to work out
|
|
45
|
+
* that the object they passed was one.
|
|
46
|
+
*
|
|
47
|
+
* A predicate needs nothing here: `typeof` answers `function` and the message says so. A RegExp is
|
|
48
|
+
* the only matcher `typeof` flattens into `object`.
|
|
49
|
+
*
|
|
50
|
+
* `String(value)` is the source as written — `/EEG/i` — which is the whole of what a reader needs
|
|
51
|
+
* to recognise it, and it is a pattern they typed rather than data read out of a file.
|
|
52
|
+
*/
|
|
53
|
+
if (Object.prototype.toString.call(value) === '[object RegExp]') {
|
|
54
|
+
return `the RegExp ${String(value)}`;
|
|
55
|
+
}
|
|
37
56
|
/*
|
|
38
57
|
* A PENDING PROMISE, which is the one object worth naming.
|
|
39
58
|
*
|