From a501adc55c79f6a305c104fe681d1805781163ac Mon Sep 17 00:00:00 2001 From: chika3742 Date: Wed, 13 Sep 2023 22:12:14 +0900 Subject: [PATCH] test(dsv): fix test for processRow types --- packages/dsv/test/types.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/dsv/test/types.ts b/packages/dsv/test/types.ts index a632ed3ca..54528eef5 100644 --- a/packages/dsv/test/types.ts +++ b/packages/dsv/test/types.ts @@ -2,8 +2,6 @@ import type { RollupOptions } from 'rollup'; import dsv from '..'; -const parse = (value: string) => (isNaN(+value) ? value : +value); - const config: RollupOptions = { input: 'main.js', output: { @@ -15,7 +13,12 @@ const config: RollupOptions = { include: 'node_modules/**', exclude: ['node_modules/foo/**', 'node_modules/bar/**'], processRow(row) { - return Object.entries(row).map(([key, value]) => [key, parse(value)]); + return { + foo: +row.foo, + bar: new Date(row.bar), + baz: row.baz === 'true', + ...row + }; } }), dsv({