edfcore 0.6.255 → 0.6.256
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/biosemi.d.ts.map +1 -1
- package/dist/biosemi.js +13 -23
- package/dist/biosemi.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/docs/CHANGELOG.md +19 -0
- package/package.json +1 -1
- package/src/biosemi.ts +13 -19
- package/src/constants.ts +1 -1
package/dist/biosemi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biosemi.d.ts","sourceRoot":"","sources":["../src/biosemi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"biosemi.d.ts","sourceRoot":"","sources":["../src/biosemi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAYH,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EAEZ,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EAEX,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAoDpB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CA6FxE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAgC9D;AAqBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAsB,YAAY,CAChC,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,gBAAgB,EAC3B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CA+KrC"}
|
package/dist/biosemi.js
CHANGED
|
@@ -23,36 +23,26 @@ import { assertReadOptions } from './io/source.js';
|
|
|
23
23
|
import { scanChunkRecords } from './record-index.js';
|
|
24
24
|
import { assertRecording, assertSelection, gapBefore } from './recording.js';
|
|
25
25
|
import { ceilDiv, secondsToTicks, ticksToSeconds } from './tal/ticks.js';
|
|
26
|
+
import { describeValue } from './text/describe.js';
|
|
26
27
|
import { resolveTimeWindow } from './time/window.js';
|
|
27
28
|
/** BioSemi's own label for the channel. Matched case-insensitively after trimming. */
|
|
28
29
|
const STATUS_LABEL = 'status';
|
|
29
30
|
/**
|
|
30
|
-
* `undefined`, `
|
|
31
|
+
* `undefined`, `Int32Array`, `NaN`, `1.5` — named as itself, since `&` would have taken them all.
|
|
31
32
|
*
|
|
32
|
-
*
|
|
33
|
-
* that does not take "a"
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
33
|
+
* `describeValue` rather than a sixth copy of the same list. This one was written for the article —
|
|
34
|
+
* `object` is the one `typeof` answer that does not take "a" — and it answered the two shapes the
|
|
35
|
+
* guard exists for identically. Its own note named them both: "`decodeStatusWord(chunk.signals[0])`
|
|
36
|
+
* — the signal rather than one sample of its `digital` — is an object, and so is the typed array one
|
|
37
|
+
* field along". The typed array is the nearer miss of the two, one field from correct, and "an
|
|
38
|
+
* object" is what it heard.
|
|
37
39
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* `null` and `undefined` are answered above the article, so of the six that can still arrive
|
|
43
|
-
* exactly one begins with a vowel.
|
|
40
|
+
* `describe.ts` names a binary value by its built-in tag "because that IS the mistake wherever one
|
|
41
|
+
* turns up", and gives the rule this module was reproducing: "two copies of a rule have to be kept
|
|
42
|
+
* in agreement, and one does not". Numbers keep their bare spelling there, which is what every
|
|
43
|
+
* numeric refusal here prints.
|
|
44
44
|
*/
|
|
45
|
-
|
|
46
|
-
if (sample === null)
|
|
47
|
-
return 'null';
|
|
48
|
-
if (sample === undefined)
|
|
49
|
-
return 'undefined';
|
|
50
|
-
if (typeof sample === 'object')
|
|
51
|
-
return 'an object';
|
|
52
|
-
if (typeof sample !== 'number')
|
|
53
|
-
return `a ${typeof sample}`;
|
|
54
|
-
return String(sample);
|
|
55
|
-
}
|
|
45
|
+
const describeSample = describeValue;
|
|
56
46
|
/*
|
|
57
47
|
* The Status word, as BioSemi assigns it ("Trigger signals", biosemi.com; the same table is in
|
|
58
48
|
* BIOSIG/FieldTrip's `read_biosemi_bdf`):
|
package/dist/biosemi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biosemi.js","sourceRoot":"","sources":["../src/biosemi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAarD,sFAAsF;AACtF,MAAM,YAAY,GAAG,QAAQ,CAAC;AAE9B
|
|
1
|
+
{"version":3,"file":"biosemi.js","sourceRoot":"","sources":["../src/biosemi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;A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AM,UAAU,GAAG,CAAC,QAAQ,CAAC;oBAC7B,QAAQ,GAAG,IAAI,CAAC;oBAEhB,MAAM,CAAC,IAAI,CAAC;wBACV,WAAW,EAAE,WAAW,GAAG,gBAAgB,GAAG,CAAC;wBAC/C,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC;wBAC9B,KAAK;wBACL,OAAO,EAAE,IAAI,CAAC,OAAO;wBACrB,MAAM,EAAE,IAAI;wBACZ,qFAAqF;wBACrF,2EAA2E;wBAC3E,aAAa,EACX,UAAU,IAAI,CAAC,WAAW,KAAK,SAAS,IAAI,KAAK,KAAK,WAAW,CAAC;4BAChE,CAAC,CAAC,aAAa;4BACf,CAAC,CAAC,SAAS;qBAChB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAED,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
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.256";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,25 @@ 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.256
|
|
10
|
+
|
|
11
|
+
- **Fixed** `decodeStatusWord(digital)` — the whole Status channel where one sample of it belongs —
|
|
12
|
+
being refused as "an object". Two shapes reach this guard and its own note named both: "the signal
|
|
13
|
+
rather than one sample of its `digital` — is an object, and so is the typed array one field along".
|
|
14
|
+
The typed array is the nearer miss, one field and one index from correct, and it is the `Int32Array`
|
|
15
|
+
the same message goes on to tell the reader to take an element of.
|
|
16
|
+
- The describer now delegates to `describeValue`, which already owns the answer and the reason: a
|
|
17
|
+
binary value is named by its built-in tag "because that IS the mistake wherever one turns up", and
|
|
18
|
+
"an object" there "says nothing a reader can act on". It also states the rule this module was
|
|
19
|
+
breaking by keeping its own list — "two copies of a rule have to be kept in agreement, and one does
|
|
20
|
+
not". This was the fifth and last of those copies.
|
|
21
|
+
- Three values gain by it. A pending Promise is named as one, which matters in this module because
|
|
22
|
+
`readTriggers` is its async sibling. A string and a BigInt are named with their values rather than
|
|
23
|
+
only their kind, on the two types `describe.ts` exists for.
|
|
24
|
+
- Nothing else moves: numbers keep their bare spelling, so `NaN`, `1.5` and an out-of-range integer
|
|
25
|
+
read as before; `null` and `undefined` keep theirs; and a plain object, an array and a `Map` are
|
|
26
|
+
still "an object", which is the article 0.6.244 was spent on.
|
|
27
|
+
|
|
9
28
|
## 0.6.255
|
|
10
29
|
|
|
11
30
|
- **Fixed** `edfcore events file.edf --limit` — the flag last on the line — being refused with
|
package/package.json
CHANGED
package/src/biosemi.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { assertReadOptions } from './io/source.js';
|
|
|
24
24
|
import { scanChunkRecords } from './record-index.js';
|
|
25
25
|
import { assertRecording, assertSelection, gapBefore } from './recording.js';
|
|
26
26
|
import { ceilDiv, secondsToTicks, ticksToSeconds } from './tal/ticks.js';
|
|
27
|
+
import { describeValue } from './text/describe.js';
|
|
27
28
|
import { resolveTimeWindow } from './time/window.js';
|
|
28
29
|
import type {
|
|
29
30
|
EdfHeader,
|
|
@@ -41,28 +42,21 @@ import type {
|
|
|
41
42
|
const STATUS_LABEL = 'status';
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
|
-
* `undefined`, `
|
|
45
|
+
* `undefined`, `Int32Array`, `NaN`, `1.5` — named as itself, since `&` would have taken them all.
|
|
45
46
|
*
|
|
46
|
-
*
|
|
47
|
-
* that does not take "a"
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
47
|
+
* `describeValue` rather than a sixth copy of the same list. This one was written for the article —
|
|
48
|
+
* `object` is the one `typeof` answer that does not take "a" — and it answered the two shapes the
|
|
49
|
+
* guard exists for identically. Its own note named them both: "`decodeStatusWord(chunk.signals[0])`
|
|
50
|
+
* — the signal rather than one sample of its `digital` — is an object, and so is the typed array one
|
|
51
|
+
* field along". The typed array is the nearer miss of the two, one field from correct, and "an
|
|
52
|
+
* object" is what it heard.
|
|
51
53
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* `null` and `undefined` are answered above the article, so of the six that can still arrive
|
|
57
|
-
* exactly one begins with a vowel.
|
|
54
|
+
* `describe.ts` names a binary value by its built-in tag "because that IS the mistake wherever one
|
|
55
|
+
* turns up", and gives the rule this module was reproducing: "two copies of a rule have to be kept
|
|
56
|
+
* in agreement, and one does not". Numbers keep their bare spelling there, which is what every
|
|
57
|
+
* numeric refusal here prints.
|
|
58
58
|
*/
|
|
59
|
-
|
|
60
|
-
if (sample === null) return 'null';
|
|
61
|
-
if (sample === undefined) return 'undefined';
|
|
62
|
-
if (typeof sample === 'object') return 'an object';
|
|
63
|
-
if (typeof sample !== 'number') return `a ${typeof sample}`;
|
|
64
|
-
return String(sample);
|
|
65
|
-
}
|
|
59
|
+
const describeSample = describeValue;
|
|
66
60
|
|
|
67
61
|
/*
|
|
68
62
|
* The Status word, as BioSemi assigns it ("Trigger signals", biosemi.com; the same table is in
|
package/src/constants.ts
CHANGED