mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-20 10:59:21 +08:00
types: 优化调用 isString 方法后对参数类型的推导
This commit is contained in:
parent
9acc5f156e
commit
2b081e4eb4
@ -4,7 +4,7 @@ export function isArray<T>(arg: T) {
|
||||
}
|
||||
|
||||
/** 判断是否为字符串 */
|
||||
export function isString<T>(str: T) {
|
||||
export function isString(str: unknown) {
|
||||
return typeof str === "string" || str instanceof String
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user