Skip to content

Commit

Permalink
refactor(csv): update reducer handling due to updates in thi.ng/trans…
Browse files Browse the repository at this point in the history
…ducers pkg
  • Loading branch information
postspectacular committed Apr 3, 2024
1 parent 2c7a18a commit 99871a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/csv/src/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function formatCSV(
): any {
return isIterable(src)
? iterator(formatCSV(opts), src)
: (rfn: Reducer<any, string>) => {
: (rfn: Reducer<string, any>) => {
let { cols = [], delim = ",", quote = '"', header } = opts;
let colTx: Nullable<Stringer<any>>[];
const reQuote = new RegExp(quote, "g");
Expand Down
4 changes: 2 additions & 2 deletions packages/csv/src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function parseCSV(
export function parseCSV(opts?: Partial<CSVOpts>, src?: Iterable<string>): any {
return isIterable(src)
? iterator1(parseCSV(opts), src)
: (rfn: Reducer<any, CSVRecord>) => {
: (rfn: Reducer<CSVRecord, any>) => {
const {
all = true,
cols,
Expand Down Expand Up @@ -221,7 +221,7 @@ export function parseCSVSimple(
): any {
return isIterable(src)
? iterator1(parseCSVSimple(opts), src)
: (rfn: Reducer<any, CSVRecord>) => {
: (rfn: Reducer<CSVRecord, any>) => {
const {
header = true,
cols,
Expand Down

0 comments on commit 99871a1

Please sign in to comment.