@rg-dev/stdlib 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common-env.cjs +1 -1
- package/lib/common-env.d.cts +1 -1
- package/lib/common-env.d.ts +1 -1
- package/lib/common-env.js +1 -1
- package/package.json +1 -1
package/lib/common-env.cjs
CHANGED
|
@@ -107,7 +107,7 @@ async function fetchHelperText(url, config) {
|
|
|
107
107
|
return await res.text();
|
|
108
108
|
}
|
|
109
109
|
function throwIfNotJSONResponse(res) {
|
|
110
|
-
const contentType = res.headers
|
|
110
|
+
const contentType = res.headers.get("content-type");
|
|
111
111
|
if (!(contentType == null ? void 0 : contentType.toLowerCase().includes("application/json"))) {
|
|
112
112
|
throw new Error(`Response is not JSON (content-type: ${contentType}, URL: ${res.url})`);
|
|
113
113
|
}
|
package/lib/common-env.d.cts
CHANGED
|
@@ -41,7 +41,7 @@ declare class StringBuilder implements IStringBuilder {
|
|
|
41
41
|
toString(): string;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
declare function fetchHelperJSON(url: string, config?: RequestInit): Promise<
|
|
44
|
+
declare function fetchHelperJSON<T extends Record<string, any>>(url: string, config?: RequestInit): Promise<T>;
|
|
45
45
|
declare function fetchHelperText(url: string, config?: RequestInit): Promise<string>;
|
|
46
46
|
|
|
47
47
|
type MyFn<T extends Record<string, (...args: any[]) => any>> = {
|
package/lib/common-env.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ declare class StringBuilder implements IStringBuilder {
|
|
|
41
41
|
toString(): string;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
declare function fetchHelperJSON(url: string, config?: RequestInit): Promise<
|
|
44
|
+
declare function fetchHelperJSON<T extends Record<string, any>>(url: string, config?: RequestInit): Promise<T>;
|
|
45
45
|
declare function fetchHelperText(url: string, config?: RequestInit): Promise<string>;
|
|
46
46
|
|
|
47
47
|
type MyFn<T extends Record<string, (...args: any[]) => any>> = {
|
package/lib/common-env.js
CHANGED
|
@@ -70,7 +70,7 @@ async function fetchHelperText(url, config) {
|
|
|
70
70
|
return await res.text();
|
|
71
71
|
}
|
|
72
72
|
function throwIfNotJSONResponse(res) {
|
|
73
|
-
const contentType = res.headers
|
|
73
|
+
const contentType = res.headers.get("content-type");
|
|
74
74
|
if (!(contentType == null ? void 0 : contentType.toLowerCase().includes("application/json"))) {
|
|
75
75
|
throw new Error(`Response is not JSON (content-type: ${contentType}, URL: ${res.url})`);
|
|
76
76
|
}
|