Skip to content

Commit

Permalink
fix(dsv): fix type of processRow option (#1581)
Browse files Browse the repository at this point in the history
* fix(typescript): fix sourcemap sourcecontent referencing non-existent files (#1571)

* test(typescript): add test case for incorrect `sourceContent`

* fix(typescript): fix .js.map files being treated as declarations

* fix(dsv): type of processRow

* test(dsv): update test for processRow types

---------

Co-authored-by: Ian Yong <ianyongyc@gmail.com>
  • Loading branch information
chika3742 and ianyong committed Sep 25, 2023
1 parent fb2a2ae commit 09bab88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion packages/dsv/test/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@ const config: RollupOptions = {
include: 'node_modules/**',
exclude: ['node_modules/foo/**', 'node_modules/bar/**'],
processRow(row) {
return row;
return {
foo: +row.foo,
bar: new Date(row.bar),
baz: row.baz === 'true',
...row
};
}
}),
dsv({
processRow() {
// void
}
})
]
Expand Down
2 changes: 1 addition & 1 deletion packages/dsv/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface RollupDsvOptions {
* The function can either manipulate the passed row, or return an entirely new row object.
* @default undefined
*/
processRow?: null | ((row: DSVRowString, id: string) => DSVRowString | undefined);
processRow?: null | ((row: DSVRowString, id: string) => object | void);
}

/**
Expand Down

0 comments on commit 09bab88

Please sign in to comment.