is-empty-iterable:检查Iterable是否为空

时间:2021-05-01 07:35:21
【文件属性】:
文件名称:is-empty-iterable:检查Iterable是否为空
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-01 07:35:21
JavaScript 是空的 检查Iterable是否为空 比Array.from(iterable).length效率更高,因为它仅迭代第一项,这对于动态迭代器可能会产生很大的影响,例如Generator执行昂贵的操作。 安装 $ npm install is-empty-iterable 用法 import isEmptyIterable from 'is-empty-iterable' ; isEmptyIterable ( [ ] ) ; //=> true isEmptyIterable ( new Set ( [ 1 , 2 ] ) ) ; //=> false 原料药 isEmptyIterable(iterable) 返回一个boolean 。 可迭代的 类型:可Iterable
【文件预览】:
is-empty-iterable-main
----index.js(176B)
----test.js(480B)
----package.json(720B)
----index.test-d.ts(172B)
----readme.md(542B)
----.github()
--------workflows()
----license(1KB)
----index.d.ts(264B)
----.gitignore(23B)
----.npmrc(19B)
----.editorconfig(175B)
----.gitattributes(19B)

网友评论