is
判断类型
使用方法
vue
<script setup lang="ts">
import { isNullOrUndef } from "@witlink/components";
const xxx = null;
if (isNullOrUndef(xxx)) {
console.log("yes");
}
</script>API
| 方法 | 参数 | 说明 |
|---|---|---|
| isNullOrUndef | val | 是否为 null 或者 undefined |
| isObject | val | 是否为对象 |
| isFunction | val | 是否为方法 |
| isArray | val | 是否为数组 |
| isBoolean | val | 是否为布尔 |
| isString | val | 是否为字符串 |
| isNumber | val | 是否为数字 |
| isPromise | val | 是否为 Promise |