@nestia/fetcher
Advanced tools
Comparing version 3.2.5 to 3.2.6-dev.20240624
@@ -290,10 +290,2 @@ "use strict"; | ||
var polyfill = new Singleton_1.Singleton(function () { return __awaiter(void 0, void 0, void 0, function () { | ||
function is_node_process(m) { | ||
return (m !== null && | ||
typeof m.process === "object" && | ||
m.process !== null && | ||
typeof m.process.versions === "object" && | ||
m.process.versions !== null && | ||
typeof m.process.versions.node !== "undefined"); | ||
} | ||
var m, _a, _b; | ||
@@ -304,4 +296,13 @@ var _c; | ||
case 0: | ||
if (!(typeof global === "object" && is_node_process(global))) return [3 /*break*/, 4]; | ||
m = global; | ||
m = (function () { | ||
if (typeof globalThis === "object") | ||
return globalThis; | ||
else if (typeof global === "object") | ||
return global; | ||
else if (typeof window === "object") | ||
return window; | ||
else if (typeof self === "object") | ||
return self; | ||
throw new Error("Unknown platform. No global object found."); | ||
})(); | ||
if (!((_c = m.fetch) !== null && _c !== void 0)) return [3 /*break*/, 1]; | ||
@@ -319,3 +320,2 @@ _a = _c; | ||
return [2 /*return*/, m.fetch]; | ||
case 4: return [2 /*return*/, self.fetch]; | ||
} | ||
@@ -322,0 +322,0 @@ }); |
{ | ||
"name": "@nestia/fetcher", | ||
"version": "3.2.5", | ||
"version": "3.2.6-dev.20240624", | ||
"description": "Fetcher library of Nestia SDK", | ||
@@ -33,3 +33,3 @@ "main": "lib/index.js", | ||
"rimraf": "^3.0.2", | ||
"typescript": "5.4.5" | ||
"typescript": "<5.5.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "peerDependencies": { |
@@ -200,18 +200,11 @@ import import2 from "import2"; | ||
const polyfill = new Singleton(async (): Promise<typeof fetch> => { | ||
function is_node_process(m: typeof global | null): boolean { | ||
return ( | ||
m !== null && | ||
typeof m.process === "object" && | ||
m.process !== null && | ||
typeof m.process.versions === "object" && | ||
m.process.versions !== null && | ||
typeof m.process.versions.node !== "undefined" | ||
); | ||
} | ||
if (typeof global === "object" && is_node_process(global)) { | ||
const m: any = global as any; | ||
m.fetch ??= ((await import2("node-fetch")) as any).default; | ||
return (m as any).fetch; | ||
} | ||
return self.fetch; | ||
const m: typeof globalThis | null = (() => { | ||
if (typeof globalThis === "object") return globalThis; | ||
else if (typeof global === "object") return global; | ||
else if (typeof window === "object") return window; | ||
else if (typeof self === "object") return self; | ||
throw new Error("Unknown platform. No global object found."); | ||
})(); | ||
m.fetch ??= ((await import2("node-fetch")) as any).default; | ||
return m.fetch; | ||
}); | ||
@@ -218,0 +211,0 @@ |
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
147159
3080
1