UNPKG

@altostra/core

Version:

Core library for shared types and logic

1 lines 1.67 kB
"use strict";var _Lazy_instances,_Lazy_factory,_Lazy_isSet,_Lazy_value,_Lazy_setVale,__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,t,a,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(e,a):i?i.value=a:t.set(e,a),a},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,a,s){if("a"===a&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?s:"a"===a?s.call(e):s?s.value:t.get(e)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Lazy=void 0;class Lazy{constructor(e){_Lazy_instances.add(this),_Lazy_factory.set(this,void 0),_Lazy_isSet.set(this,!1),_Lazy_value.set(this,void 0),__classPrivateFieldSet(this,_Lazy_factory,e,"f")}get value(){return __classPrivateFieldGet(this,_Lazy_isSet,"f")||__classPrivateFieldGet(this,_Lazy_instances,"m",_Lazy_setVale).call(this,__classPrivateFieldGet(this,_Lazy_factory,"f").call(this)),__classPrivateFieldGet(this,_Lazy_value,"f")}get isSet(){return __classPrivateFieldGet(this,_Lazy_isSet,"f")}}exports.Lazy=Lazy,_Lazy_factory=new WeakMap,_Lazy_isSet=new WeakMap,_Lazy_value=new WeakMap,_Lazy_instances=new WeakSet,_Lazy_setVale=function(e){__classPrivateFieldSet(this,_Lazy_value,e,"f"),__classPrivateFieldSet(this,_Lazy_isSet,!0,"f")};