Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjoDiaz committed Nov 12, 2024
1 parent e81cd60 commit a2f481e
Show file tree
Hide file tree
Showing 17 changed files with 1,620 additions and 1,417 deletions.
2,919 changes: 1,579 additions & 1,340 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@
},
"devDependencies": {
"@types/tape": "^5.6.0",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"c8": "^7.14.0",
"conventional-changelog-cli": "^4.1.0",
"@typescript-eslint/eslint-plugin": "^8.14.0",
"@typescript-eslint/parser": "^8.14.0",
"c8": "^10.1.2",
"conventional-changelog-cli": "^5.0.0",
"docsify-cli": "^4.4.4",
"esbuild": "^0.20.0",
"eslint": "^8.30.0",
"esbuild": "^0.24.0",
"eslint": "^8.2.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.26.0",
Expand Down
8 changes: 5 additions & 3 deletions packages/cli/src/json2csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,11 @@ async function processOutput(
config: OutputOptions,
): Promise<void> {
if (!outputPath) {
config.pretty
? new TablePrinter(config).printCSV(csv)
: process.stdout.write(csv);
if (config.pretty) {
new TablePrinter(config).printCSV(csv);
} else {
process.stdout.write(csv);
}
return;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/parseNdjson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function parseNdJson<T>(input: string, eol: string): Array<T> {
.map((line) => line.trim())
.filter((line) => line !== '')
.map((line) => JSON.parse(line));
} catch (err: unknown) {
} catch {
throw new Error("Invalid ND-JSON couldn't be parsed");
}
}
9 changes: 1 addition & 8 deletions packages/cli/test/CLI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,7 @@ export default function (

t.fail('Exception expected.');
} catch (err: any) {

Check warning on line 75 in packages/cli/test/CLI.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 20.x)

Unexpected any. Specify a different type

Check warning on line 75 in packages/cli/test/CLI.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 18.x)

Unexpected any. Specify a different type
t.ok(
err.message.includes(
`Unexpected SEPARATOR ("${os.EOL.replace('\r', '\\r').replace(
'\n',
'\\n',
)}") in state COMMA`,
),
);
t.ok(err.message.includes('Unexpected LEFT_BRACE ("{") in state COMMA'));
}
});

Expand Down
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"prepublishOnly": "npm run build"
},
"devDependencies": {
"@types/node": "^20.1.7"
"@types/node": "^22.9.0"
},
"dependencies": {
"@json2csv/plainjs": "^7.0.6"
Expand Down
17 changes: 2 additions & 15 deletions packages/node/test/AsyncParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.equal(
err.message,
`Unexpected SEPARATOR ("${os.EOL.replace('\r', '\\r').replace(
'\n',
'\\n',
)}") in state COMMA`,
);
t.equal(err.message, 'Unexpected LEFT_BRACE ("{") in state COMMA');
}
});

Expand All @@ -131,14 +125,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.ok(
err.message.includes(
`Unexpected SEPARATOR ("${os.EOL.replace('\r', '\\r').replace(
'\n',
'\\n',
)}") in state COMMA`,
),
);
t.ok(err.message.includes('Unexpected LEFT_BRACE ("{") in state COMMA'));
}
});

Expand Down
17 changes: 2 additions & 15 deletions packages/node/test/AsyncParserInMemory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.equal(
err.message,
`Unexpected SEPARATOR ("${os.EOL.replace('\r', '\\r').replace(
'\n',
'\\n',
)}") in state COMMA`,
);
t.equal(err.message, 'Unexpected LEFT_BRACE ("{") in state COMMA');
}
});

Expand All @@ -131,14 +125,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.ok(
err.message.includes(
`Unexpected SEPARATOR ("${os.EOL.replace('\r', '\\r').replace(
'\n',
'\\n',
)}") in state COMMA`,
),
);
t.ok(err.message.includes('Unexpected LEFT_BRACE ("{") in state COMMA'));
}
});

Expand Down
17 changes: 2 additions & 15 deletions packages/node/test/Transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.equal(
err.message,
`Unexpected SEPARATOR ("${os.EOL.replace('\r', '\\r').replace(
'\n',
'\\n',
)}") in state COMMA`,
);
t.equal(err.message, 'Unexpected LEFT_BRACE ("{") in state COMMA');
}
});

Expand All @@ -117,14 +111,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.ok(
err.message.includes(
`Unexpected SEPARATOR ("${os.EOL.replace('\r', '\\r').replace(
'\n',
'\\n',
)}") in state COMMA`,
),
);
t.ok(err.message.includes('Unexpected LEFT_BRACE ("{") in state COMMA'));
}
});

Expand Down
2 changes: 1 addition & 1 deletion packages/plainjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
},
"dependencies": {
"@json2csv/formatters": "^7.0.6",
"@streamparser/json": "^0.0.20"
"@streamparser/json": "^0.0.21"
}
}
2 changes: 1 addition & 1 deletion packages/plainjs/src/BaseParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface FormattersOptions {
[FormatterTypes.bigint]?: Formatter<bigint>;
[FormatterTypes.string]?: Formatter<string>;
[FormatterTypes.symbol]?: Formatter<symbol>;
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
[FormatterTypes.function]?: Formatter<Function>;
[FormatterTypes.object]?: Formatter<object>;
}
Expand Down
8 changes: 6 additions & 2 deletions packages/plainjs/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,13 @@ export function getProp<T>(
export function flattenReducer<T>(acc: Array<T>, arr: Array<T> | T): Array<T> {
try {
// This is faster but susceptible to `RangeError: Maximum call stack size exceeded`
Array.isArray(arr) ? acc.push(...arr) : acc.push(arr);
if (Array.isArray(arr)) {
acc.push(...arr);
} else {
acc.push(arr);
}
return acc;
} catch (err: unknown) {
} catch {
// Fallback to a slower but safer option
return acc.concat(arr);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/plainjs/test/StreamParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.ok(err.message.includes('Unexpected SEPARATOR ("\\n") in state COMMA'));
t.ok(err.message.includes('Unexpected LEFT_BRACE ("{") in state COMMA'));
}
});

Expand Down
8 changes: 6 additions & 2 deletions packages/transforms/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,13 @@ export function unsetProp<T extends object>(obj: T, path: PropertyPath): T {
export function flattenReducer<T>(acc: Array<T>, arr: Array<T> | T): Array<T> {
try {
// This is faster but susceptible to `RangeError: Maximum call stack size exceeded`
Array.isArray(arr) ? acc.push(...arr) : acc.push(arr);
if (Array.isArray(arr)) {
acc.push(...arr);
} else {
acc.push(arr);
}
return acc;
} catch (err: unknown) {
} catch {
// Fallback to a slower but safer option
return acc.concat(arr);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/whatwg/test/AsyncParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.equal(err.message, 'Unexpected SEPARATOR ("\\n") in state COMMA');
t.equal(err.message, 'Unexpected LEFT_BRACE ("{") in state COMMA');
}
});

Expand All @@ -128,7 +128,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.ok(err.message.includes('Unexpected SEPARATOR ("\\n") in state COMMA'));
t.ok(err.message.includes('Unexpected LEFT_BRACE ("{") in state COMMA'));
}
});

Expand Down
4 changes: 2 additions & 2 deletions packages/whatwg/test/AsyncParserInMemory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.equal(err.message, 'Unexpected SEPARATOR ("\\n") in state COMMA');
t.equal(err.message, 'Unexpected LEFT_BRACE ("{") in state COMMA');
}
});

Expand All @@ -128,7 +128,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.ok(err.message.includes('Unexpected SEPARATOR ("\\n") in state COMMA'));
t.ok(err.message.includes('Unexpected LEFT_BRACE ("{") in state COMMA'));
}
});

Expand Down
4 changes: 2 additions & 2 deletions packages/whatwg/test/TransformStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.equal(err.message, 'Unexpected SEPARATOR ("\\n") in state COMMA');
t.equal(err.message, 'Unexpected LEFT_BRACE ("{") in state COMMA');
}
});

Expand All @@ -107,7 +107,7 @@ export default function (

t.fail('Exception expected');
} catch (err: any) {
t.ok(err.message.includes('Unexpected SEPARATOR ("\\n") in state COMMA'));
t.ok(err.message.includes('Unexpected LEFT_BRACE ("{") in state COMMA'));
}
});

Expand Down

0 comments on commit a2f481e

Please sign in to comment.