Template
1
0
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:
pany 2025-02-17 18:19:01 +08:00
parent 9acc5f156e
commit 2b081e4eb4

View File

@ -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
}