edf2csv 0.9.42 → 0.9.44
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/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/convert/plan.d.ts +9 -0
- package/dist/convert/plan.js +71 -13
- package/dist/convert/plan.js.map +1 -1
- package/dist/convert/run.d.ts +16 -1
- package/dist/convert/run.js +42 -7
- package/dist/convert/run.js.map +1 -1
- package/dist/edf/errors.d.ts +1 -1
- package/dist/edf/errors.js.map +1 -1
- package/package.json +1 -1
package/dist/edf/errors.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* we can continue, but the user needs to know something about their data that
|
|
7
7
|
* they would not otherwise see.
|
|
8
8
|
*/
|
|
9
|
-
export type DiagnosticCode = 'MIXED_SAMPLING_RATES' | 'DISCONTINUOUS' | 'RECORD_COUNT_UNKNOWN' | 'RECORD_COUNT_MISMATCH' | 'TRAILING_BYTES' | 'DEGENERATE_DIGITAL_RANGE' | 'DEGENERATE_PHYSICAL_RANGE' | 'UNUSABLE_PHYSICAL_RANGE' | 'INVERTED_PHYSICAL_RANGE' | 'DUPLICATE_LABEL' | 'EMPTY_LABEL' | 'NO_ANNOTATIONS' | 'ANNOTATION_DECODE_FAILED' | 'COMMA_DECIMAL' | 'LARGE_OUTPUT' | 'NO_SIGNAL_CHANNELS' | 'NO_SAMPLES' | 'STALE_OUTPUT' | 'INPUT_CHANGED' | 'EMPTY_WINDOW' | 'TIME_RESOLUTION' | 'VALUE_RESOLUTION' | 'HEADER_BYTES_MISMATCH' | 'NONPRINTABLE_LABEL'
|
|
9
|
+
export type DiagnosticCode = 'MIXED_SAMPLING_RATES' | 'DISCONTINUOUS' | 'RECORD_COUNT_UNKNOWN' | 'RECORD_COUNT_MISMATCH' | 'TRAILING_BYTES' | 'DEGENERATE_DIGITAL_RANGE' | 'DEGENERATE_PHYSICAL_RANGE' | 'UNUSABLE_PHYSICAL_RANGE' | 'INVERTED_PHYSICAL_RANGE' | 'DUPLICATE_LABEL' | 'EMPTY_LABEL' | 'NO_ANNOTATIONS' | 'ANNOTATION_DECODE_FAILED' | 'COMMA_DECIMAL' | 'LARGE_OUTPUT' | 'NO_SIGNAL_CHANNELS' | 'NO_SAMPLES' | 'STALE_OUTPUT' | 'INPUT_CHANGED' | 'EMPTY_WINDOW' | 'EMPTY_RATE_WINDOW' | 'TIME_RESOLUTION' | 'VALUE_RESOLUTION' | 'HEADER_BYTES_MISMATCH' | 'NONPRINTABLE_LABEL'
|
|
10
10
|
/**
|
|
11
11
|
* Header text that a spreadsheet will run instead of read.
|
|
12
12
|
*
|
package/dist/edf/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/edf/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/edf/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgIH;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACxB,IAAI,CAAe;IACnB,IAAI,CAAqB;IAElC,YAAY,IAAkB,EAAE,OAAe,EAAE,IAAa;QAC5D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF","sourcesContent":["/**\n * Error and diagnostic types.\n *\n * The distinction that matters here: an EdfError means we cannot produce\n * trustworthy output and must stop. A Diagnostic with severity 'warning' means\n * we can continue, but the user needs to know something about their data that\n * they would not otherwise see.\n */\n\nexport type DiagnosticCode =\n | 'MIXED_SAMPLING_RATES'\n | 'DISCONTINUOUS'\n | 'RECORD_COUNT_UNKNOWN'\n | 'RECORD_COUNT_MISMATCH'\n | 'TRAILING_BYTES'\n | 'DEGENERATE_DIGITAL_RANGE'\n | 'DEGENERATE_PHYSICAL_RANGE'\n | 'UNUSABLE_PHYSICAL_RANGE'\n | 'INVERTED_PHYSICAL_RANGE'\n | 'DUPLICATE_LABEL'\n | 'EMPTY_LABEL'\n | 'NO_ANNOTATIONS'\n | 'ANNOTATION_DECODE_FAILED'\n | 'COMMA_DECIMAL'\n | 'LARGE_OUTPUT'\n | 'NO_SIGNAL_CHANNELS'\n | 'NO_SAMPLES'\n | 'STALE_OUTPUT'\n | 'INPUT_CHANGED'\n | 'EMPTY_WINDOW'\n /*\n One rate's file empty while the run has rows, which `EMPTY_WINDOW` cannot say.\n\n A rate group is what gets a file, and a window can hold samples of one rate and none of\n another. `EMPTY_WINDOW` means the run produced nothing, which is what a script watching\n for a useless conversion matches on; this one means the run produced something and one of\n its files came out with a header and no rows. Coding them the same would have that script\n quarantine a conversion that worked.\n */\n | 'EMPTY_RATE_WINDOW'\n | 'TIME_RESOLUTION'\n | 'VALUE_RESOLUTION'\n | 'HEADER_BYTES_MISMATCH'\n | 'NONPRINTABLE_LABEL'\n /**\n * Header text that a spreadsheet will run instead of read.\n *\n * Excel, LibreOffice and Google Sheets treat a cell beginning `=`, `+` or `@` as a formula,\n * whatever file it arrived in. EDF labels, units, transducer and prefiltering fields are\n * free text out of the header, and this tool writes them through unchanged on purpose — so\n * a channel labelled `=1+1` becomes a column header that computes 2, and one labelled\n * `=HYPERLINK(...)` becomes a link the reader did not write. The README says the output\n * opens in Excel and SECURITY.md already treats these fields as attacker-controlled; this\n * is the one place they reach a program that executes text.\n *\n * A warning rather than a rewrite. Prefixing the cell with a quote is the usual mitigation\n * and it would mean writing something the header does not say, which is the one thing this\n * tool does not do — the same answer NONPRINTABLE_LABEL gives for control bytes.\n */\n | 'FORMULA_LABEL'\n /**\n * The header's start date or time is not a date or a time.\n *\n * Every other unusable header field reports itself. This one did not, so a recording whose\n * timestamp cannot be read converted in silence, passed `--strict`, and left\n * `start_datetime_local` null in metadata.json with nothing saying why — on the field the\n * documented recipe for an absolute instant depends on.\n */\n | 'START_TIME_UNREADABLE'\n /**\n * The header's start time names the sixtieth second of a minute.\n *\n * A leap second is a real instant and `23.59.60` is how UTC writes it, but no calendar date\n * has a sixtieth second and `Date` has no way to hold one: asking for it rolls over into the\n * next minute. So the instant is kept as `:59`, one second earlier — which was done silently,\n * and `start_datetime_local` then named a moment the header does not, on the field the\n * documented recipe for an absolute instant depends on.\n */\n | 'LEAP_SECOND_START'\n /**\n * An EDF+ recording identification field whose `Startdate` is not the header's start date.\n *\n * EDF+ requires the two to be the same date, and the four-digit year in the recording ID is\n * what lets a file say which century it belongs to. When they disagree about the day or the\n * month, or about a year that is not the same year at all, neither is corroborated and the\n * one number naming when the recording happened cannot be trusted — which nothing said.\n */\n | 'START_DATE_MISMATCH'\n /**\n * An annotation channel with a non-zero origin, in a file marked neither EDF+C nor EDF+D.\n *\n * The marker decides whether the origin is applied, and the annotation channel is found by\n * label instead. So a file carrying one without the marker got samples timed from zero and events\n * timed from the origin, and the two CSVs came out on clocks seconds apart.\n */\n | 'MISSING_EDF_PLUS_MARKER'\n /**\n * `--info --stdout` on a recording `--stdout` would refuse.\n *\n * Only `--info` raises it. A conversion refuses outright instead, with the same words —\n * this is that refusal shown ahead of time, which is what `--info` is for.\n */\n | 'STDOUT_UNSUPPORTED';\n\nexport interface Diagnostic {\n code: DiagnosticCode;\n /**\n * Always `'warning'`. One field, one value, because there has only ever been one.\n *\n * It was `'warning' | 'info'`, and nothing in this codebase has ever built an `'info'`.\n * A published union is a promise about what a caller may receive, so the two pages that\n * print this interface told them to expect a second value and handle it — a branch that\n * cannot run, in the type a `--json` consumer reads `severity` out of. The terminal was\n * worse: `formatDiagnostics` labelled anything that was not `'warning'` as `note:`, so the\n * one thing the type said could arrive would have arrived under a third name again.\n *\n * Kept as a field rather than dropped: `metadata.json`, both JSON streams and this\n * interface all carry it, and removing it from a document people have archived is a\n * different and worse change than narrowing what it can say.\n */\n severity: 'warning';\n message: string;\n /** What the user can do about it. Omitted when there is nothing useful to say. */\n hint?: string;\n}\n\nexport type EdfErrorCode =\n | 'FILE_TOO_SMALL'\n | 'BAD_HEADER_FIELD'\n | 'NO_DATA_RECORDS'\n | 'INVALID_SIGNAL_COUNT'\n | 'INVALID_RECORD_DURATION'\n | 'NO_SAMPLES'\n | 'UNREADABLE';\n\n/**\n * A fatal problem with the recording itself. Carries a stable `code` so the CLI\n * can map it to an exit status, and a `hint` so the user is not left guessing.\n */\nexport class EdfError extends Error {\n readonly code: EdfErrorCode;\n readonly hint: string | undefined;\n\n constructor(code: EdfErrorCode, message: string, hint?: string) {\n super(message);\n this.name = 'EdfError';\n this.code = code;\n this.hint = hint;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edf2csv",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.44",
|
|
4
4
|
"description": "Convert EDF, EDF+ and BDF biosignal recordings (European Data Format) to CSV from the command line. Local, streaming, and never resamples or alters units.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"edf",
|