has.js 1.7 KB

12345
  1. //>>built
  2. (function(d){"object"===typeof module&&"object"===typeof module.exports?(d=d(require,exports),void 0!==d&&(module.exports=d)):"function"===typeof define&&define.amd&&define(["require","exports"],d)})(function(d,b){function l(a){a=a.toLowerCase();return!!(a in e||a in b.testCache||b.testFunctions[a])}function g(a,c,d){void 0===d&&(d=!1);var f=a.toLowerCase();if(l(f)&&!d&&!(f in e))throw new TypeError('Feature "'+a+'" exists and overwrite not true.');"function"===typeof c?b.testFunctions[f]=c:c&&c.then?
  3. h[a]=c.then(function(c){b.testCache[a]=c;delete h[a]},function(){delete h[a]}):(b.testCache[f]=c,delete b.testFunctions[f])}function m(a){var c=a.toLowerCase();if(c in e)a=e[c];else if(b.testFunctions[c])a=b.testCache[c]=b.testFunctions[c].call(null),delete b.testFunctions[c];else if(c in b.testCache)a=b.testCache[c];else{if(a in h)return!1;throw new TypeError('Attempt to detect unregistered has feature "'+a+'"');}return a}Object.defineProperty(b,"__esModule",{value:!0});b.testCache={};b.testFunctions=
  4. {};var h={};d="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};var k=(d.DojoHasEnvironment||{}).staticFeatures;"DojoHasEnvironment"in d&&delete d.DojoHasEnvironment;var e=k?"function"===typeof k?k.apply(d):k:{};b.load=function(a,c,b,d){a?c([a],b):b()};b.normalize=function(a,b){function c(a){var b=d[e++];if(":"===b)return null;if("?"===d[e++]){if(!a&&m(b))return c();c(!0);return c(a)}return b}var d=a.match(/[\?:]|[^:\?]*/g)||[],e=0;return(a=c())&&
  5. b(a)};b.exists=l;b.add=g;b.default=m;g("debug",!0);g("host-browser","undefined"!==typeof document&&"undefined"!==typeof location);g("host-node",function(){if("object"===typeof process&&process.versions&&process.versions.node)return process.versions.node})});