UNPKG

tc39-weakrefs-shim

Version:
15 lines 464 B
export default function makePrivates() { const privates = new WeakMap(); function get(instance) { if (!privates.has(instance)) throw new Error("Invalid object"); return privates.get(instance); } get.init = function init(instance, data) { if (privates.has(instance)) throw new Error("Invalid object"); privates.set(instance, data); }; return get; } //# sourceMappingURL=privates.js.map