Skip to content

Commit

Permalink
test(dsv): update 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 19ad8c5 commit da06f9d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/dsv/test/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ 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 @@ -13,7 +15,12 @@ const config: RollupOptions = {
include: 'node_modules/**',
exclude: ['node_modules/foo/**', 'node_modules/bar/**'],
processRow(row) {
return row;
return Object.entries(row).map(([key, value]) => [key, parse(value)]);
}
}),
dsv({
processRow() {
// void
}
})
]
Expand Down

0 comments on commit da06f9d

Please sign in to comment.