// 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<CSVNormalizerHeader> } */
+/** @type {Array<CSVNormalizerHeader>} */
const headers = [
{
name: 'index', // MUST match the input CSV column name in camelCase
/** @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<CSVNormalizerHeader> } */
+/** @type {Array<CSVNormalizerHeader>} */
const headers = [
{ name: 'columnA' },
{ name: 'columnB' },
* @returns {ReadableStream<Uint8Array<ArrayBufferLike>>}
*/
export function createFileStream(path) {
- /** @type FileHandle */
+ /** @type {FileHandle} */
let handle;
let position = 0;
rows: 0,
done: false
};
- /** @type FileHandle */
+ /** @type {FileHandle} */
let handle;
super({
async start() {
suite('CSVNormalizer and CSVDenormalizer end-to-end', { concurrency: true }, () => {
test('can normalize', { concurrency: true }, async () => {
- /** @type { Array<CSVNormalizerHeader> } */
+ /** @type {Array<CSVNormalizerHeader>} */
const headers = [
{ name: 'stringCol', displayName: 'String Column', type: 'string', defaultValue: 'N/A' },
{ name: 'numberCol', displayName: 'Number Column', type: 'number' },
]));
});
test('can normalize with transformation', { concurrency: true }, async () => {
- /** @type { Array<CSVNormalizerHeader> } */
+ /** @type {Array<CSVNormalizerHeader>} */
const headers = [
{ name: 'columnA' },
{ name: 'columnB' }