weak-merge::link:用于合并WeakSet和WeakMaps的模块

时间:2024-05-24 21:40:08
【文件属性】:

文件名称:weak-merge::link:用于合并WeakSet和WeakMaps的模块

文件大小:65KB

文件格式:ZIP

更新时间:2024-05-24 21:40:08

javascript npm-package union weakmap sets

弱合并 合并WeakSets和WeakMaps的模块。 安装 $ npm i weak-merge 用法 import { mergeWeakSets , mergeWeakMaps } from 'weak-merge' const [ a , b , c , d ] = [ { } , { } , { } , { } ] const weakSet1 = new WeakSet ( [ a , b ] ) const weakSet2 = new WeakSet ( [ c ] ) const mergedWeakSet = mergeWeakSets ( weakSet1 , weakSet2 ) console . log ( [ a , b , c ] . map ( key => mergedWeakSet . has ( key ) ) ) //=> [ true, tru


【文件预览】:
weak-merge-main
----package.json(2KB)
----pnpm-lock.yaml(130KB)
----readme.md(3KB)
----.github()
--------workflows()
----test()
--------merge-weak-maps.js(4KB)
--------merge-weak-sets.js(4KB)
--------helpers()
----license(11KB)
----src()
--------merge-weak-maps.js(2KB)
--------index.js(703B)
--------merge-weak-sets.js(1KB)
--------index.d.ts(3KB)
----tsconfig.json(53B)
----.gitignore(35B)
----.npmrc(18B)
----.gitattributes(19B)
----contributing.md(1KB)

网友评论