wangxinhui
2025-04-29 95e39ae7aecd6e1016c71cf5ae70a680d8f569bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * @Author: daidai
 * @Date: 2021-12-14 09:15:11
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-04-25 10:11:04
 * @FilePath: \web-pc\src\lib\types.js
 */
 
export function hasOwn(obj, key) {
    return hasOwnProperty.call(obj, key);
  };
  export function isVNode(node) {
    return node !== null && typeof node === 'object' && hasOwn(node, 'componentOptions');
  };
  
// 是否字符串
export function isString2(str) {
    return (typeof str == 'string') && str.constructor == String;
}
export function isString(obj) {
    return Object.prototype.toString.call(obj) === '[object String]';
}
export function isObject(obj) {
    return Object.prototype.toString.call(obj) === '[object Object]';
}
export function isNumber(obj) {
    return Object.prototype.toString.call(obj) === '[object Number]';
}
// 是否完整的
export function isDef(val) {
    return val !== undefined && val !== null;
}
//
export function isKorean(text) {
    const reg = /([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi;
    return reg.test(text);
}
 
export function isHtmlElement(node) {
    return node && node.nodeType === Node.ELEMENT_NODE;
}
export const isUndefined = (val) => {
    return val === void 0;
};