$ npm install --save tobe-utils
# or
$ yarn add tobe-utils
# or
$ pnpm add tobe-utils
# or
$ bun add tobe-utils
import { isEmpty } from '@tobe-utils';
console.log(isEmpty([])) // 输出 true
console.log(isEmpty([1])) // 输出 false
const { isEmpty } from require('@tobe-utils');
console.log(isEmpty([])) // 输出 true
console.log(isEmpty([1])) // 输出 false
如果直接在浏览器中使用,则不需要包管理。直接下载 tag 中的最新版本 index.umd.js
,使用的是 UMD 通用模块规范。
然后在浏览器中引用:
<script src="./index.umd.js"></script>
<script>
$utils.isNull(null) // output: true
</script>