From 08a785461e15c91b03147569322983af9be70fde Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Sat, 18 Oct 2025 23:39:23 -0700 Subject: [PATCH] Demonstrate string shorthand --- examples/ex4_2.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/ex4_2.js b/examples/ex4_2.js index 499d85d..7764201 100644 --- a/examples/ex4_2.js +++ b/examples/ex4_2.js @@ -8,14 +8,14 @@ import { CSVReader, CSVWriter, CSVNormalizer, CSVDenormalizer, CSVTransformer } /** @import { CSVNormalizerHeader } from '../src/normalization.js'; */ // A minimal declaration to tell `CSVNormalizer` to trim empty rows and columns but otherwise don't touch the data -/** @type {Array} */ +/** @type {Array} */ const headers = [ - { name: 'columnA' }, - { name: 'columnB' }, - { name: 'columnC' }, - { name: 'sparse1' }, - { name: 'sparse2' }, - { name: 'sparse3' } + 'columnA', // Same as { name: 'columnA' } which is the same as { name: 'columnA', type: 'string' } + { name: 'columnB' }, // You can mix string and CSVNormalizerHeader in the same array + 'columnC', + 'sparse1', + 'sparse2', + 'sparse3' ]; function transform(row) { -- 2.47.3