UNPKG

tc39-weakrefs-shim

Version:
18 lines 558 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 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; } exports.default = makePrivates; //# sourceMappingURL=privates.js.map