Skip to content

Commit 7ee475a

Browse files
torosentCopilot
andcommitted
chore: upgrade TypeScript target from ES2020 to ES2022
Node.js >=22 is required, so ES2022 features like Error cause, top-level await, and Array.at() are safe to use. This also restores the { cause: err } option in parseJsonField() that was previously removed due to the old target. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 45cbc56 commit 7ee475a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

packages/durabletask-js/src/utils/pb-helper.util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ export function parseJsonField(v?: StringValue | null): any {
431431
return JSON.parse(v.getValue());
432432
} catch (err) {
433433
// Wrap JSON.parse errors to provide clearer context to callers while preserving the original error
434-
throw new Error(`Failed to parse JSON from StringValue: ${(err as Error).message}`);
434+
throw new Error(`Failed to parse JSON from StringValue: ${(err as Error).message}`, { cause: err });
435435
}
436436
}
437437

tsconfig.base.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2020",
3+
"target": "ES2022",
4+
"lib": ["ES2022"],
45
"module": "commonjs",
56
"declaration": true,
67
"strict": true,

0 commit comments

Comments
 (0)