configcat-common
Advanced tools
Comparing version
@@ -0,1 +1,19 @@ | ||
var getGlobalObject = (function () { | ||
var value; | ||
return function () { | ||
if (!value) { | ||
value = | ||
typeof globalThis === "object" && globalThis ? globalThis : | ||
typeof self === "object" && self ? self : | ||
typeof window === "object" && window ? window : | ||
typeof global === "object" && global ? global : | ||
typeof Function === "function" ? (Function('return this')()) : | ||
null; | ||
if (!value) { | ||
throw new Error("Global object could not be determined."); | ||
} | ||
} | ||
return value; | ||
}; | ||
})(); | ||
export function setupPolyfills() { | ||
@@ -18,3 +36,3 @@ // Object.values | ||
// so we just polyfill its API (which means falling back on strong references in this case). | ||
WeakRef = getWeakRefFallback(); | ||
getGlobalObject().WeakRef = getWeakRefStub(); | ||
} | ||
@@ -60,3 +78,3 @@ } | ||
} | ||
export function getWeakRefFallback() { | ||
export function getWeakRefStub() { | ||
var WeakRef = function (target) { | ||
@@ -63,0 +81,0 @@ this.target = target; |
@@ -11,4 +11,4 @@ export declare function setupPolyfills(): void; | ||
}; | ||
export declare function getWeakRefFallback<T extends object>(): WeakRefConstructor; | ||
export declare function getWeakRefStub<T extends object>(): WeakRefConstructor; | ||
export declare const isWeakRefAvailable: () => boolean; | ||
//# sourceMappingURL=Polyfills.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isWeakRefAvailable = exports.getWeakRefFallback = exports.ObjectFromEntriesPolyfill = exports.ObjectEntriesPolyfill = exports.ObjectValuesPolyfill = exports.setupPolyfills = void 0; | ||
exports.isWeakRefAvailable = exports.getWeakRefStub = exports.ObjectFromEntriesPolyfill = exports.ObjectEntriesPolyfill = exports.ObjectValuesPolyfill = exports.setupPolyfills = void 0; | ||
var getGlobalObject = (function () { | ||
var value; | ||
return function () { | ||
if (!value) { | ||
value = | ||
typeof globalThis === "object" && globalThis ? globalThis : | ||
typeof self === "object" && self ? self : | ||
typeof window === "object" && window ? window : | ||
typeof global === "object" && global ? global : | ||
typeof Function === "function" ? (Function('return this')()) : | ||
null; | ||
if (!value) { | ||
throw new Error("Global object could not be determined."); | ||
} | ||
} | ||
return value; | ||
}; | ||
})(); | ||
function setupPolyfills() { | ||
@@ -21,3 +39,3 @@ // Object.values | ||
// so we just polyfill its API (which means falling back on strong references in this case). | ||
WeakRef = getWeakRefFallback(); | ||
getGlobalObject().WeakRef = getWeakRefStub(); | ||
} | ||
@@ -67,3 +85,3 @@ } | ||
exports.ObjectFromEntriesPolyfill = ObjectFromEntriesPolyfill; | ||
function getWeakRefFallback() { | ||
function getWeakRefStub() { | ||
var WeakRef = function (target) { | ||
@@ -78,4 +96,4 @@ this.target = target; | ||
} | ||
exports.getWeakRefFallback = getWeakRefFallback; | ||
exports.getWeakRefStub = getWeakRefStub; | ||
var isWeakRefAvailable = function () { return typeof WeakRef === "function" && !WeakRef.hasOwnProperty("isFallback"); }; | ||
exports.isWeakRefAvailable = isWeakRefAvailable; |
{ | ||
"name": "configcat-common", | ||
"version": "7.0.0", | ||
"version": "7.0.1", | ||
"description": "ConfigCat is a configuration as a service that lets you manage your features and configurations without actually deploying new code.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
384094
0.37%7241
0.5%0
-100%