Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): upgrade typescript #435

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
],
"type": "commonjs",
"devDependencies": {
"@types/node": "^20.14.6",
"@types/node": "^20.14.7",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"c8": "^10.1.2",
Expand All @@ -137,7 +137,7 @@
"packages-update": "^2.0.0",
"prettier": "^3.3.2",
"shx": "^0.3.4",
"tsx": "4.15.6",
"typescript": "^5.4.5"
"tsx": "4.15.7",
"typescript": "^5.5.2"
}
}
14 changes: 8 additions & 6 deletions src/services/each.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@
): Promise<boolean> => {
if (typeof configs?.[type] !== 'function') return true;

const functionName = configs[type]?.name;
const cb = configs[type];

Check warning on line 14 in src/services/each.ts

View check run for this annotation

Codecov / codecov/patch

src/services/each.ts#L14

Added line #L14 was not covered by tests
/* c8 ignore next */
if (typeof cb !== 'function') return true;

write(
` ${format.dim(format.info('◯'))} ${format.dim(format.italic(`${configs[type]}: ${functionName !== configs[type] ? functionName : 'anonymous function'}`))}`
` ${format.dim(format.info('◯'))} ${format.dim(format.italic(`${cb}: ${cb.name || 'anonymous function'}`))}`

Check warning on line 19 in src/services/each.ts

View check run for this annotation

Codecov / codecov/patch

src/services/each.ts#L19

Added line #L19 was not covered by tests
);

try {
await configs[type]?.();
const resultCb = cb();

Check warning on line 23 in src/services/each.ts

View check run for this annotation

Codecov / codecov/patch

src/services/each.ts#L23

Added line #L23 was not covered by tests
/* c8 ignore next */
if (resultCb instanceof Promise) await resultCb;
return true;
} catch (error) {
write(
format.bold(
format.fail(
` ✘ ${type} callback failed ${format.dim(`› ${configs[type]}`)}`
)
format.fail(` ✘ ${type} callback failed ${format.dim(`› ${cb}`)}`)

Check warning on line 30 in src/services/each.ts

View check run for this annotation

Codecov / codecov/patch

src/services/each.ts#L30

Added line #L30 was not covered by tests
)
);
write(
Expand Down
Loading