web
9 小时以前 49fa0d82a40345342966e810b44429aec0480ef3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// @ts-nocheck
/**
 * 检查一个值是否为字符串类型
 * @param str 要检查的值
 * @returns 如果值的类型是字符串类型,则返回 true;否则返回 false
 */
// #ifndef UNI-APP-X && APP
// export const isString = (str: unknown): str is string => typeof str === 'string';
export function isString (str: unknown): str is string {
    return typeof str == 'string'
}
// #endif
 
 
// #ifdef UNI-APP-X && APP
export function isString (str: any|null): boolean {
    return typeof str == 'string'
}
// #endif