Skip to content

Commit b28cc96

Browse files
authored
chore(deps): upgrade typescript (#435)
* refactor: fix typescript bc overlap * chore(deps): upgrade typescript
1 parent 5a7e09d commit b28cc96

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

package-lock.json

Lines changed: 13 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
],
125125
"type": "commonjs",
126126
"devDependencies": {
127-
"@types/node": "^20.14.6",
127+
"@types/node": "^20.14.7",
128128
"@typescript-eslint/eslint-plugin": "^7.13.1",
129129
"@typescript-eslint/parser": "^7.13.1",
130130
"c8": "^10.1.2",
@@ -137,7 +137,7 @@
137137
"packages-update": "^2.0.0",
138138
"prettier": "^3.3.2",
139139
"shx": "^0.3.4",
140-
"tsx": "4.15.6",
141-
"typescript": "^5.4.5"
140+
"tsx": "4.15.7",
141+
"typescript": "^5.5.2"
142142
}
143143
}

src/services/each.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,23 @@ const eachCore = async (
1111
): Promise<boolean> => {
1212
if (typeof configs?.[type] !== 'function') return true;
1313

14-
const functionName = configs[type]?.name;
14+
const cb = configs[type];
15+
/* c8 ignore next */
16+
if (typeof cb !== 'function') return true;
1517

1618
write(
17-
` ${format.dim(format.info('◯'))} ${format.dim(format.italic(`${configs[type]}: ${functionName !== configs[type] ? functionName : 'anonymous function'}`))}`
19+
` ${format.dim(format.info('◯'))} ${format.dim(format.italic(`${cb}: ${cb.name || 'anonymous function'}`))}`
1820
);
1921

2022
try {
21-
await configs[type]?.();
23+
const resultCb = cb();
24+
/* c8 ignore next */
25+
if (resultCb instanceof Promise) await resultCb;
2226
return true;
2327
} catch (error) {
2428
write(
2529
format.bold(
26-
format.fail(
27-
` ✘ ${type} callback failed ${format.dim(`› ${configs[type]}`)}`
28-
)
30+
format.fail(` ✘ ${type} callback failed ${format.dim(`› ${cb}`)}`)
2931
)
3032
);
3133
write(

0 commit comments

Comments
 (0)