Skip to content

Commit

Permalink
test(dsv): fix test for processRow types
Browse files Browse the repository at this point in the history
  • Loading branch information
chika3742 committed Sep 13, 2023
1 parent edcdbb5 commit a501adc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/dsv/test/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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({
Expand Down

0 comments on commit a501adc

Please sign in to comment.