mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-02 22:22:19 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
31
web/node_modules/ext/global-this/implementation.js
generated
vendored
Normal file
31
web/node_modules/ext/global-this/implementation.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
var naiveFallback = function () {
|
||||
if (typeof self === "object" && self) return self;
|
||||
if (typeof window === "object" && window) return window;
|
||||
throw new Error("Unable to resolve global `this`");
|
||||
};
|
||||
|
||||
module.exports = (function () {
|
||||
if (this) return this;
|
||||
|
||||
// Unexpected strict mode (may happen if e.g. bundled into ESM module)
|
||||
|
||||
// Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
|
||||
// In all ES5+ engines global object inherits from Object.prototype
|
||||
// (if you approached one that doesn't please report)
|
||||
try {
|
||||
Object.defineProperty(Object.prototype, "__global__", {
|
||||
get: function () { return this; },
|
||||
configurable: true
|
||||
});
|
||||
} catch (error) {
|
||||
// Unfortunate case of Object.prototype being sealed (via preventExtensions, seal or freeze)
|
||||
return naiveFallback();
|
||||
}
|
||||
try {
|
||||
// Safari case (window.__global__ is resolved with global context, but __global__ does not)
|
||||
if (!__global__) return naiveFallback();
|
||||
return __global__;
|
||||
} finally {
|
||||
delete Object.prototype.__global__;
|
||||
}
|
||||
})();
|
3
web/node_modules/ext/global-this/index.js
generated
vendored
Normal file
3
web/node_modules/ext/global-this/index.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? globalThis : require("./implementation");
|
7
web/node_modules/ext/global-this/is-implemented.js
generated
vendored
Normal file
7
web/node_modules/ext/global-this/is-implemented.js
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = function () {
|
||||
if (typeof globalThis !== "object") return false;
|
||||
if (!globalThis) return false;
|
||||
return globalThis.Array === Array;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue