UNPKG

foxts

Version:

Opinionated collection of common TypeScript utils by @SukkaW

2 lines (1 loc) 478 B
Object.defineProperty(exports,"__esModule",{value:!0});const e=new Map;function t(e){return Array.from(Array(e).keys())}function r(r){if(e.has(r))return e.get(r);let n=t(r);return e.set(r,n),n}const n=new Map;function o(e){let r,o;return n.has(e)&&(o=(r=n.get(e)).deref()),o||(r=new WeakRef(o=t(e)),n.set(e,r)),o}const a="function"==typeof WeakRef?o:r,s=a(0);exports.EMPTY_ARRAY=s,exports.createFixedArray=a,exports.createFixedArrayWithGC=o,exports.createFixedArrayWithoutGC=r;