edfcore 0.6.255 → 0.6.257
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/dist/format-header.d.ts.map +1 -1
- package/dist/format-header.js +19 -6
- package/dist/format-header.js.map +1 -1
- package/docs/CHANGELOG.md +40 -0
- package/package.json +1 -1
- package/src/biosemi.ts +13 -19
- package/src/constants.ts +1 -1
- package/src/format-header.ts +19 -6
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,OAA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AK,IAAI,cAAc;wBAAE,SAAS;oBAClE,IAAI,QAAQ,IAAI,CAAC,OAAO;wBAAE,SAAS;oBACnC,MAAM,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.257";
|
|
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;AAUH,OAAO,KAAK,EAAmB,SAAS,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAsElF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"format-header.d.ts","sourceRoot":"","sources":["../src/format-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH,OAAO,KAAK,EAAmB,SAAS,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAsElF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAyQrF"}
|
package/dist/format-header.js
CHANGED
|
@@ -147,14 +147,27 @@ export function formatHeader(header, options) {
|
|
|
147
147
|
*/
|
|
148
148
|
/*
|
|
149
149
|
* An ARRAY, which is an object, so the check below cannot see it. Same argument as `assertOptions`
|
|
150
|
-
* makes for the three listing formatters
|
|
151
|
-
*
|
|
152
|
-
*
|
|
150
|
+
* makes for the three listing formatters.
|
|
151
|
+
*
|
|
152
|
+
* NOT the same cost, and 0.6.247 wrote theirs in here. `redactFields` is the array-valued option
|
|
153
|
+
* that argument turns on, and it is not an option of this call — `FormatHeaderOptions` is
|
|
154
|
+
* `includePatientId` and `diagnosticsHint`. So the message named a field to pass on an object,
|
|
155
|
+
* and a reader who passed it got the silent failure `format.ts` reserves its strongest wording
|
|
156
|
+
* for: "the one option in this package whose silent failure sends a person's name somewhere it
|
|
157
|
+
* should not go", here spelled as an option that does nothing at all.
|
|
158
|
+
*
|
|
159
|
+
* And "nothing was withheld" is backwards for this formatter, which withholds by DEFAULT:
|
|
160
|
+
* `includePatientId` is opt-in and read as `=== true`, so an array left the identification OUT.
|
|
161
|
+
* The guard below says so correctly for a bare value, three lines away, and this one said the
|
|
162
|
+
* opposite of it.
|
|
153
163
|
*/
|
|
154
164
|
if (Array.isArray(options)) {
|
|
155
|
-
throw new RangeError('formatHeader(): the options are an array, and includePatientId and
|
|
156
|
-
'fields on the options rather than entries in a list — so
|
|
157
|
-
'
|
|
165
|
+
throw new RangeError('formatHeader(): the options are an array, and includePatientId and diagnosticsHint are ' +
|
|
166
|
+
'fields on the options rather than entries in a list — so the identification lines were ' +
|
|
167
|
+
'left out and the summary looks exactly like one that never asked for them. ' +
|
|
168
|
+
'Next: pass them on an object. Redaction is not an option here: this formatter omits the ' +
|
|
169
|
+
'identification unless includePatientId asks for it, and redactFields belongs to ' +
|
|
170
|
+
'formatDiagnostics(), which prints the raw bytes of a field it reports on.');
|
|
158
171
|
}
|
|
159
172
|
if (options !== undefined && typeof options !== 'object') {
|
|
160
173
|
throw new RangeError(`formatHeader(): the options are ${describeValue(options)}, not an object — ` +
|
|
@@ -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,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,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,mBAAmB,CAAC,KAAa;IACxC,IAAI,KAAK,GAAG,EAAE;QAAE,OAAO,SAAS,CAAC;IACjC,MAAM,KAAK,GAAG,MAAM,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AAC,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,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;QAChF,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"}
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,46 @@ 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.257
|
|
10
|
+
|
|
11
|
+
- **Fixed** `formatHeader`'s array refusal naming `redactFields`, which is not an option of this call.
|
|
12
|
+
`FormatHeaderOptions` is `includePatientId` and `diagnosticsHint`, and nothing here reads a
|
|
13
|
+
`redactFields` at all — so the message told a reader to pass it on an object, and passing it does
|
|
14
|
+
nothing. That is the failure `format.ts` reserves its strongest wording for, "the one option in this
|
|
15
|
+
package whose silent failure sends a person's name somewhere it should not go", reached by following
|
|
16
|
+
edfcore's own advice and around `assertRedactableFields`, which exists so a name outside the
|
|
17
|
+
vocabulary "is refused rather than ignored".
|
|
18
|
+
- 0.6.247 wrote `assertOptions`' argument into this guard when it gave the four formatters an array
|
|
19
|
+
branch. It holds for the three listing formatters, whose `redactFields` really is the array-valued
|
|
20
|
+
option that makes the mistake likely. It does not hold here.
|
|
21
|
+
- **Fixed** the same message stating the consequence backwards. This formatter withholds by default —
|
|
22
|
+
`includePatientId` is opt-in and read as `=== true` — so an array leaves the identification OUT, not
|
|
23
|
+
in. "Nothing was withheld" was the opposite of the bare-value guard three lines below it, which has
|
|
24
|
+
always said "the identification lines would have been left out and the summary would look exactly
|
|
25
|
+
like one that never asked for them". Two copies of one fact, in one function, disagreeing about
|
|
26
|
+
which way a person's name leaks.
|
|
27
|
+
- The refusal now names the two real options, states the direction both guards agree on, and says
|
|
28
|
+
where redaction lives: `formatDiagnostics()`, which prints the raw bytes of a field it reports on.
|
|
29
|
+
|
|
30
|
+
## 0.6.256
|
|
31
|
+
|
|
32
|
+
- **Fixed** `decodeStatusWord(digital)` — the whole Status channel where one sample of it belongs —
|
|
33
|
+
being refused as "an object". Two shapes reach this guard and its own note named both: "the signal
|
|
34
|
+
rather than one sample of its `digital` — is an object, and so is the typed array one field along".
|
|
35
|
+
The typed array is the nearer miss, one field and one index from correct, and it is the `Int32Array`
|
|
36
|
+
the same message goes on to tell the reader to take an element of.
|
|
37
|
+
- The describer now delegates to `describeValue`, which already owns the answer and the reason: a
|
|
38
|
+
binary value is named by its built-in tag "because that IS the mistake wherever one turns up", and
|
|
39
|
+
"an object" there "says nothing a reader can act on". It also states the rule this module was
|
|
40
|
+
breaking by keeping its own list — "two copies of a rule have to be kept in agreement, and one does
|
|
41
|
+
not". This was the fifth and last of those copies.
|
|
42
|
+
- Three values gain by it. A pending Promise is named as one, which matters in this module because
|
|
43
|
+
`readTriggers` is its async sibling. A string and a BigInt are named with their values rather than
|
|
44
|
+
only their kind, on the two types `describe.ts` exists for.
|
|
45
|
+
- Nothing else moves: numbers keep their bare spelling, so `NaN`, `1.5` and an out-of-range integer
|
|
46
|
+
read as before; `null` and `undefined` keep theirs; and a plain object, an array and a `Map` are
|
|
47
|
+
still "an object", which is the article 0.6.244 was spent on.
|
|
48
|
+
|
|
9
49
|
## 0.6.255
|
|
10
50
|
|
|
11
51
|
- **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
package/src/format-header.ts
CHANGED
|
@@ -157,15 +157,28 @@ export function formatHeader(header: EdfHeader, options?: FormatHeaderOptions):
|
|
|
157
157
|
*/
|
|
158
158
|
/*
|
|
159
159
|
* An ARRAY, which is an object, so the check below cannot see it. Same argument as `assertOptions`
|
|
160
|
-
* makes for the three listing formatters
|
|
161
|
-
*
|
|
162
|
-
*
|
|
160
|
+
* makes for the three listing formatters.
|
|
161
|
+
*
|
|
162
|
+
* NOT the same cost, and 0.6.247 wrote theirs in here. `redactFields` is the array-valued option
|
|
163
|
+
* that argument turns on, and it is not an option of this call — `FormatHeaderOptions` is
|
|
164
|
+
* `includePatientId` and `diagnosticsHint`. So the message named a field to pass on an object,
|
|
165
|
+
* and a reader who passed it got the silent failure `format.ts` reserves its strongest wording
|
|
166
|
+
* for: "the one option in this package whose silent failure sends a person's name somewhere it
|
|
167
|
+
* should not go", here spelled as an option that does nothing at all.
|
|
168
|
+
*
|
|
169
|
+
* And "nothing was withheld" is backwards for this formatter, which withholds by DEFAULT:
|
|
170
|
+
* `includePatientId` is opt-in and read as `=== true`, so an array left the identification OUT.
|
|
171
|
+
* The guard below says so correctly for a bare value, three lines away, and this one said the
|
|
172
|
+
* opposite of it.
|
|
163
173
|
*/
|
|
164
174
|
if (Array.isArray(options)) {
|
|
165
175
|
throw new RangeError(
|
|
166
|
-
'formatHeader(): the options are an array, and includePatientId and
|
|
167
|
-
'fields on the options rather than entries in a list — so
|
|
168
|
-
'
|
|
176
|
+
'formatHeader(): the options are an array, and includePatientId and diagnosticsHint are ' +
|
|
177
|
+
'fields on the options rather than entries in a list — so the identification lines were ' +
|
|
178
|
+
'left out and the summary looks exactly like one that never asked for them. ' +
|
|
179
|
+
'Next: pass them on an object. Redaction is not an option here: this formatter omits the ' +
|
|
180
|
+
'identification unless includePatientId asks for it, and redactFields belongs to ' +
|
|
181
|
+
'formatDiagnostics(), which prints the raw bytes of a field it reports on.',
|
|
169
182
|
);
|
|
170
183
|
}
|
|
171
184
|
if (options !== undefined && typeof options !== 'object') {
|