window-var
Version:
Acquires global `window` var in a browserify-compatible way.
25 lines (24 loc) • 607 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
let thIs = this;
class Instance {
get() {
if (typeof window !== 'undefined') {
return window;
}
else if (typeof global !== 'undefined') {
return global;
}
else if (typeof self !== 'undefined') {
return self;
}
else {
return thIs;
}
}
}
exports.Instance = Instance;
exports.instance = new Instance();
exports.win = exports.instance.get();
exports.get = exports.instance.get;
exports.default = exports.instance;