edf2csv 0.8.67 → 0.8.69

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.
@@ -98,10 +98,10 @@ export async function convert(inputPath, options = {}) {
98
98
  readerHungUp,
99
99
  annotationCount: 0,
100
100
  // Over both lists, because the timing warnings are pushed onto the plan's.
101
- diagnostics: withSignalTableUnwritten(withSidecarsNamed([
101
+ diagnostics: withSidecarsNamed(withSignalTableUnwritten([
102
102
  ...withTimingPromiseKept(withoutFileRateWarning(file.diagnostics), timing.starts !== null),
103
103
  ...plan.diagnostics,
104
- ], { toStdout: true, gzip: plan.gzip }), plan.writeSignals),
104
+ ], plan.writeSignals), { toStdout: true, gzip: plan.gzip }),
105
105
  plan,
106
106
  file,
107
107
  elapsedMs: Date.now() - startedAt,
@@ -199,11 +199,11 @@ export async function convert(inputPath, options = {}) {
199
199
  annotationCount: annotationsWritten,
200
200
  // The directory path needs it too: `--gzip` changes the names, and two of these
201
201
  // sentences are a file name and nothing else. See withSidecarsNamed.
202
- diagnostics: withSignalTableUnwritten(withSidecarsNamed([
202
+ diagnostics: withSidecarsNamed(withSignalTableUnwritten([
203
203
  ...withTimingPromiseKept(withoutFileRateWarning(file.diagnostics), timing.starts !== null),
204
204
  ...plan.diagnostics,
205
205
  ...stale,
206
- ], { toStdout: false, gzip: plan.gzip }), plan.writeSignals),
206
+ ], plan.writeSignals), { toStdout: false, gzip: plan.gzip }),
207
207
  plan,
208
208
  file,
209
209
  elapsedMs: Date.now() - startedAt,
@@ -1699,6 +1699,25 @@ export function withSidecarsNamed(diagnostics, { toStdout, gzip }) {
1699
1699
  const channels = outputCsvName('channels', gzip);
1700
1700
  const annotations = outputCsvName('annotations', gzip);
1701
1701
  return diagnostics.map((diagnostic) => {
1702
+ /*
1703
+ The last message of this kind, and the one that names its files mid-sentence.
1704
+
1705
+ `NONPRINTABLE_LABEL` says where an invisible byte lands — the channel's name in
1706
+ signals.csv, a cell of channels.csv — and `--gzip` writes neither of those names. It was
1707
+ left out of 0.8.48 because the file is named inside a sentence assembled from which of
1708
+ the four header fields carry bytes, and out of 0.8.54 for the same reason. Renaming is
1709
+ all it needs, once the sentence is settled: this runs after `withSignalTableUnwritten`
1710
+ has had its say about the layout, so whichever file the sentence ended up naming is the
1711
+ one that gets the suffix.
1712
+ */
1713
+ if (gzip && diagnostic.code === 'NONPRINTABLE_LABEL') {
1714
+ return {
1715
+ ...diagnostic,
1716
+ message: diagnostic.message
1717
+ .replace(/\bsignals\.csv\b/gu, outputCsvName('signals', true))
1718
+ .replace(/\bchannels\.csv\b/gu, channels),
1719
+ };
1720
+ }
1702
1721
  /*
1703
1722
  The header's own `NO_SAMPLES`, which names the file that describes the channel it is
1704
1723
  about — and under `--stdout` there is no such file, so the reassurance is empty:
@@ -1916,12 +1935,12 @@ bom) {
1916
1935
  decimals: g.channels.map((c) => c.decimals),
1917
1936
  })),
1918
1937
  },
1919
- notes: withSignalTableUnwritten(withSidecarsNamed([
1938
+ notes: withSidecarsNamed(withSignalTableUnwritten([
1920
1939
  ...withTimingPromiseKept(withoutFileRateWarning(file.diagnostics), timedFromRecords),
1921
1940
  ...plan.diagnostics,
1922
- ],
1941
+ ], plan.writeSignals),
1923
1942
  // metadata.json is only written into a directory, so this is never the stdout case.
1924
- { toStdout: false, gzip: plan.gzip }), plan.writeSignals).map((d) => ({
1943
+ { toStdout: false, gzip: plan.gzip }).map((d) => ({
1925
1944
  code: d.code,
1926
1945
  severity: d.severity,
1927
1946
  message: d.message,