Locaft/auth/node_modules/context/dist/context.cjs.production.min.js

3 lines
1.9 KiB
JavaScript
Raw Normal View History

2020-11-29 09:05:56 -08:00
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(t){return"__"+t},e=function(){function e(e,n){var r,o=e.use,i=e.set,u=e.addQueryableProperties,a=e.init;this._parentContext=null;var c=o(),s="function"==typeof a&&null!==(r=a(n,c))&&void 0!==r?r:n,f=u(s);if(s&&"object"==typeof s)for(var p in f)Object.prototype.hasOwnProperty.call(s,p)&&(this[t(p)]=s[p]),this.addLookupProperty(p);c&&this.setParentContext(c),i(this)}e.is=function(t){return t instanceof e};var n,r=e.prototype;return r.addLookupProperty=function(e){var n=t(e);Object.defineProperty(this,e,{get:function(){return this.lookup(n)},set:function(t){throw new Error('Context: Unable to set "'+e+'" to `'+JSON.stringify(t)+"`. Context properties cannot be set directly. Use context.run() instead.")}})},r.lookup=function(t){var n=this;do{if(n.hasOwnProperty(t))return n[t];if(!e.is(n.parentContext))return;n=n.parentContext}while(n)},r.setParentContext=function(t){e.is(this)&&(this._parentContext=t)},(n=[{key:"parentContext",get:function(){return this._parentContext}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(e.prototype,n),e}();exports.default=function(t){var n={ctx:void 0},r={};function o(t){if(!t||"object"!=typeof t)return{};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=!0);return r}function i(){return n.ctx}function u(t){return n.ctx=t}function a(n,r){var a,c=r(new e({set:u,use:i,addQueryableProperties:o,init:t},n));return a=i(),e.is(a)&&u(a.parentContext),c}return{use:i,run:a,bind:function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return a(t,(function(){return e.apply(void 0,r.concat(o))}))}}}};
//# sourceMappingURL=context.cjs.production.min.js.map