@schibsted/niche-utils
Advanced tools
Comparing version 0.4.0 to 0.4.1
const state = {}; | ||
export function loadScript(url, id) { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
if (((_a = state[id]) === null || _a === void 0 ? void 0 : _a.state) === 'loaded') { | ||
@@ -10,3 +10,3 @@ return Promise.resolve(); | ||
} | ||
if (state[id].state === 'loading') { | ||
if (((_c = state[id]) === null || _c === void 0 ? void 0 : _c.state) === 'loading') { | ||
return state[id].payload; | ||
@@ -13,0 +13,0 @@ } |
{ | ||
"name": "@schibsted/niche-utils", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"license": "Apache-2.0", | ||
@@ -23,3 +23,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "5fc4cb80aaac17c0b9de081f407b4be24933ef0e" | ||
"gitHead": "02b3fc2061b49da2a7f823ffa4c28770113abacb" | ||
} |
@@ -16,3 +16,3 @@ const state: Record< | ||
} | ||
if (state[id].state === 'loading') { | ||
if (state[id]?.state === 'loading') { | ||
return state[id].payload as Promise<void>; | ||
@@ -19,0 +19,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16968