Skip to content

Commit

Permalink
chore(deps): upgrade typescript (#435)
Browse files Browse the repository at this point in the history
* refactor: fix typescript bc overlap

* chore(deps): upgrade typescript
  • Loading branch information
wellwelwel authored Jun 21, 2024
1 parent 5a7e09d commit b28cc96
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
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 @@ const eachCore = async (
): Promise<boolean> => {
if (typeof configs?.[type] !== 'function') return true;

const functionName = configs[type]?.name;
const cb = configs[type];
/* 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'}`))}`
);

try {
await configs[type]?.();
const resultCb = cb();
/* 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}`)}`)
)
);
write(
Expand Down

0 comments on commit b28cc96

Please sign in to comment.