anchor/dist/anchor.umd.min.js

1 line
806 B
JavaScript

!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define("umd",s):(e="undefined"!=typeof globalThis?globalThis:e||self).umd=s()}(this,function(){"use strict";return class{constructor(e={},s=[],t=!1){return this.namespace=`_${Math.random().toString(36).slice(-6)}_`.toUpperCase(),this.global=window||global,this.build(e,s,t)}register(e,s){return!(!this.global[this.namespace]||this.global[this.namespace][e])&&(this.global[this.namespace][e]=s)}build(e,s,t){return!this.global[this.namespace]&&(this.global[this.namespace]=e,s.forEach(e=>Object.assign(this.global[this.namespace],e)),this.register("register",this.register),t&&console.log("ANCHOR:FASTEN",this.namespace,this.global[this.namespace]),this.global[this.namespace])}}});