From 914b0fb37388b92761f6453635f9179da57c60ae Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Fri, 15 Aug 2025 23:13:09 -0700 Subject: [PATCH] Loosen `CSVNormalizerRow` type to match `CSVDenormalizer` usage --- src/normalization.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/normalization.js b/src/normalization.js index 0432288..519d3f9 100644 --- a/src/normalization.js +++ b/src/normalization.js @@ -93,10 +93,10 @@ export function expandScientificNotation(str, truncate = false) { * The output of `CSVNormalizer`. * @typedef {Object} CSVNormalizerRow * @property {string} name The column name after normalization to camelCase. - * @property {string} displayName The desired column name in the output CSV. + * @property {string} [displayName] The desired column name in the output CSV. * @property {string|number} value The value of the field after attempted data casting. If the original field was empty, this value * is set to the provided `defaultValue` or `''` (empty string) if no `defaultValue` was provided. - * @property {boolean} emptyField Boolean to indicate whether the original field was empty. + * @property {boolean} [emptyField] Boolean to indicate whether the original field was empty. */ /** @@ -143,7 +143,7 @@ export class CSVNormalizer extends TransformStream { } } - /** @type {import('node:stream/web').TransformerTransformCallback,Array>} */ + /** @type {import('node:stream/web').TransformerTransformCallback,Array>>} */ #transform(chunk, controller) { // Assume first row is headers and use it to prepare the columns object // Note: the headers row is NOT forwarded downstream @@ -162,7 +162,7 @@ export class CSVNormalizer extends TransformStream { return; } - /** @type {Array} */ + /** @type {Array>} */ const out = []; for (const { name, type, displayName, defaultValue, index } of this.#columns) { let value = chunk[index] ?? ''; -- 2.47.3