From aabff00dc5ab52de14a96961fc351cab218e0017 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Sat, 12 Jul 2025 22:04:31 -0700 Subject: [PATCH] Use consistent JSDoc typecasting formatting --- examples/ex4_1.js | 2 +- examples/ex4_2.js | 2 +- src/core.js | 4 ++-- test/normalization.test.js | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/ex4_1.js b/examples/ex4_1.js index 5e91bf1..a613f7b 100644 --- a/examples/ex4_1.js +++ b/examples/ex4_1.js @@ -13,7 +13,7 @@ import { CSVReader, CSVWriter, CSVNormalizer, CSVDenormalizer } from '../src/ind // The order of items in `headers` is significant, it determines the order of the output CSV columns. // If an input column is not provided in `headers`, the column is removed from the output CSV. -/** @type { Array } */ +/** @type {Array} */ const headers = [ { name: 'index', // MUST match the input CSV column name in camelCase diff --git a/examples/ex4_2.js b/examples/ex4_2.js index cfbe256..499d85d 100644 --- a/examples/ex4_2.js +++ b/examples/ex4_2.js @@ -8,7 +8,7 @@ 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' }, diff --git a/src/core.js b/src/core.js index 7d98291..cfd4114 100644 --- a/src/core.js +++ b/src/core.js @@ -43,7 +43,7 @@ export function parsePathLike(path) { * @returns {ReadableStream>} */ export function createFileStream(path) { - /** @type FileHandle */ + /** @type {FileHandle} */ let handle; let position = 0; @@ -509,7 +509,7 @@ export class CSVWriter extends WritableStream { rows: 0, done: false }; - /** @type FileHandle */ + /** @type {FileHandle} */ let handle; super({ async start() { diff --git a/test/normalization.test.js b/test/normalization.test.js index fb4805f..620b4cf 100644 --- a/test/normalization.test.js +++ b/test/normalization.test.js @@ -492,7 +492,7 @@ suite('CSVDenormalizer', { concurrency: true }, () => { suite('CSVNormalizer and CSVDenormalizer end-to-end', { concurrency: true }, () => { test('can normalize', { concurrency: true }, async () => { - /** @type { Array } */ + /** @type {Array} */ const headers = [ { name: 'stringCol', displayName: 'String Column', type: 'string', defaultValue: 'N/A' }, { name: 'numberCol', displayName: 'Number Column', type: 'number' }, @@ -510,7 +510,7 @@ suite('CSVNormalizer and CSVDenormalizer end-to-end', { concurrency: true }, () ])); }); test('can normalize with transformation', { concurrency: true }, async () => { - /** @type { Array } */ + /** @type {Array} */ const headers = [ { name: 'columnA' }, { name: 'columnB' } -- 2.47.3