Skip to content

Commit

Permalink
refa: replace <T> with <T, > to workaround JSX ambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Jan 21, 2024
1 parent 0efd20b commit 995a2bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/registry/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@koishijs/registry",
"description": "Scan Package Manager for Koishi Plugins",
"version": "7.0.0",
"version": "7.0.1",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down
3 changes: 2 additions & 1 deletion packages/registry/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export namespace Ensure {
}, {})
}

const primitive = <T>(type: string): Ensure<T> => (value: any, fallback?: T) => {
// https://github.com/microsoft/TypeScript/issues/15713#issuecomment-499474386
const primitive = <T, >(type: string): Ensure<T> => (value: any, fallback?: T) => {
if (typeof value !== type) return fallback
return value
}
Expand Down

0 comments on commit 995a2bd

Please sign in to comment.