@pezkuwi/x-fetch 14.0.13 → 14.0.15
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/cjs/node.js +34 -1
- package/cjs/packageInfo.js +1 -1
- package/package.json +15 -54
- package/packageInfo.js +1 -1
- package/build/LICENSE +0 -201
- package/build/README.md +0 -13
- package/build/browser.d.ts +0 -2
- package/build/browser.js +0 -3
- package/build/cjs/browser.d.ts +0 -2
- package/build/cjs/browser.js +0 -7
- package/build/cjs/node.d.ts +0 -2
- package/build/cjs/node.js +0 -52
- package/build/cjs/package.json +0 -3
- package/build/cjs/packageInfo.d.ts +0 -6
- package/build/cjs/packageInfo.js +0 -4
- package/build/cjs/react-native.d.ts +0 -1
- package/build/cjs/react-native.js +0 -4
- package/build/cjs/shim.d.ts +0 -1
- package/build/cjs/shim.js +0 -5
- package/build/node.d.ts +0 -2
- package/build/node.js +0 -15
- package/build/package.json +0 -141
- package/build/packageInfo.d.ts +0 -6
- package/build/packageInfo.js +0 -1
- package/build/react-native.d.ts +0 -1
- package/build/react-native.js +0 -1
- package/build/shim.d.ts +0 -1
- package/build/shim.js +0 -3
- package/build-deno/README.md +0 -13
- package/build-deno/browser.ts +0 -6
- package/build-deno/mod.ts +0 -2
- package/build-deno/node.ts +0 -24
- package/build-deno/packageInfo.ts +0 -3
- package/build-deno/react-native.ts +0 -2
- package/build-deno/shim.ts +0 -5
- package/build-tsc/browser.d.ts +0 -2
- package/build-tsc/node.d.ts +0 -2
- package/build-tsc/packageInfo.d.ts +0 -6
- package/build-tsc/react-native.d.ts +0 -1
- package/build-tsc/shim.d.ts +0 -1
- package/build-tsc-cjs/browser.js +0 -7
- package/build-tsc-cjs/node.js +0 -52
- package/build-tsc-cjs/packageInfo.js +0 -4
- package/build-tsc-cjs/react-native.js +0 -4
- package/build-tsc-cjs/shim.js +0 -5
- package/build-tsc-esm/browser.js +0 -3
- package/build-tsc-esm/node.js +0 -15
- package/build-tsc-esm/packageInfo.js +0 -1
- package/build-tsc-esm/react-native.js +0 -1
- package/build-tsc-esm/shim.js +0 -3
- package/src/browser.ts +0 -8
- package/src/mod.ts +0 -4
- package/src/node.ts +0 -31
- package/src/packageInfo.ts +0 -6
- package/src/react-native.ts +0 -4
- package/src/shim.ts +0 -7
- package/tsconfig.build.json +0 -14
- package/tsconfig.build.tsbuildinfo +0 -1
package/build/package.json
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"author": "Dijital Kurdistan Tech Institute <dev@pezkuwichain.io>",
|
|
3
|
-
"bugs": "https://github.com/pezkuwichain/pezkuwi-common/issues",
|
|
4
|
-
"description": "A cross-environment fetch replacement",
|
|
5
|
-
"engines": {
|
|
6
|
-
"node": ">=18"
|
|
7
|
-
},
|
|
8
|
-
"homepage": "https://github.com/pezkuwichain/pezkuwi-common/tree/master/packages/x-fetch#readme",
|
|
9
|
-
"license": "Apache-2.0",
|
|
10
|
-
"name": "@pezkuwi/x-fetch",
|
|
11
|
-
"repository": {
|
|
12
|
-
"directory": "packages/x-fetch",
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "https://github.com/pezkuwichain/pezkuwi-common.git"
|
|
15
|
-
},
|
|
16
|
-
"sideEffects": false,
|
|
17
|
-
"type": "module",
|
|
18
|
-
"version": "14.0.13",
|
|
19
|
-
"main": "./cjs/node.js",
|
|
20
|
-
"module": "./cjs/node.js",
|
|
21
|
-
"browser": "./cjs/browser.js",
|
|
22
|
-
"react-native": "./cjs/react-native.js",
|
|
23
|
-
"types": "./cjs/node.d.ts",
|
|
24
|
-
"exports": {
|
|
25
|
-
"./cjs/package.json": "./cjs/package.json",
|
|
26
|
-
"./cjs/*": "./cjs/*.js",
|
|
27
|
-
".": {
|
|
28
|
-
"types": "./cjs/node.d.ts./cjs/node.js",
|
|
29
|
-
"react-native": "./cjs/react-native.js./cjs/react-native.js",
|
|
30
|
-
"browser": "./cjs/browser.js./cjs/browser.js",
|
|
31
|
-
"node": "./cjs/node.js./cjs/node.js"
|
|
32
|
-
},
|
|
33
|
-
"./browser": {
|
|
34
|
-
"module": {
|
|
35
|
-
"types": "./browser.d.ts",
|
|
36
|
-
"default": "./browser.js"
|
|
37
|
-
},
|
|
38
|
-
"require": {
|
|
39
|
-
"types": "./cjs/browser.d.ts",
|
|
40
|
-
"default": "./cjs/browser.js"
|
|
41
|
-
},
|
|
42
|
-
"default": {
|
|
43
|
-
"types": "./browser.d.ts",
|
|
44
|
-
"default": "./browser.js"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"./node": {
|
|
48
|
-
"module": {
|
|
49
|
-
"types": "./node.d.ts",
|
|
50
|
-
"default": "./node.js"
|
|
51
|
-
},
|
|
52
|
-
"require": {
|
|
53
|
-
"types": "./cjs/node.d.ts",
|
|
54
|
-
"default": "./cjs/node.js"
|
|
55
|
-
},
|
|
56
|
-
"default": {
|
|
57
|
-
"types": "./node.d.ts",
|
|
58
|
-
"default": "./node.js"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"./package.json": {
|
|
62
|
-
"require": "./cjs/package.json",
|
|
63
|
-
"default": "./package.json"
|
|
64
|
-
},
|
|
65
|
-
"./packageInfo.js": {
|
|
66
|
-
"module": {
|
|
67
|
-
"types": "./packageInfo.d.ts",
|
|
68
|
-
"default": "./packageInfo.js"
|
|
69
|
-
},
|
|
70
|
-
"require": {
|
|
71
|
-
"types": "./cjs/packageInfo.d.ts",
|
|
72
|
-
"default": "./cjs/packageInfo.js"
|
|
73
|
-
},
|
|
74
|
-
"default": {
|
|
75
|
-
"types": "./packageInfo.d.ts",
|
|
76
|
-
"default": "./packageInfo.js"
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
"./packageInfo": {
|
|
80
|
-
"module": {
|
|
81
|
-
"types": "./packageInfo.d.ts",
|
|
82
|
-
"default": "./packageInfo.js"
|
|
83
|
-
},
|
|
84
|
-
"require": {
|
|
85
|
-
"types": "./cjs/packageInfo.d.ts",
|
|
86
|
-
"default": "./cjs/packageInfo.js"
|
|
87
|
-
},
|
|
88
|
-
"default": {
|
|
89
|
-
"types": "./packageInfo.d.ts",
|
|
90
|
-
"default": "./packageInfo.js"
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
"./react-native": {
|
|
94
|
-
"module": {
|
|
95
|
-
"types": "./react-native.d.ts",
|
|
96
|
-
"default": "./react-native.js"
|
|
97
|
-
},
|
|
98
|
-
"require": {
|
|
99
|
-
"types": "./cjs/react-native.d.ts",
|
|
100
|
-
"default": "./cjs/react-native.js"
|
|
101
|
-
},
|
|
102
|
-
"default": {
|
|
103
|
-
"types": "./react-native.d.ts",
|
|
104
|
-
"default": "./react-native.js"
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"./shim.js": {
|
|
108
|
-
"module": {
|
|
109
|
-
"types": "./shim.d.ts",
|
|
110
|
-
"default": "./shim.js"
|
|
111
|
-
},
|
|
112
|
-
"require": {
|
|
113
|
-
"types": "./cjs/shim.d.ts",
|
|
114
|
-
"default": "./cjs/shim.js"
|
|
115
|
-
},
|
|
116
|
-
"default": {
|
|
117
|
-
"types": "./shim.d.ts",
|
|
118
|
-
"default": "./shim.js"
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
"./shim": {
|
|
122
|
-
"module": {
|
|
123
|
-
"types": "./shim.d.ts",
|
|
124
|
-
"default": "./shim.js"
|
|
125
|
-
},
|
|
126
|
-
"require": {
|
|
127
|
-
"types": "./cjs/shim.d.ts",
|
|
128
|
-
"default": "./cjs/shim.js"
|
|
129
|
-
},
|
|
130
|
-
"default": {
|
|
131
|
-
"types": "./shim.d.ts",
|
|
132
|
-
"default": "./shim.js"
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
"dependencies": {
|
|
137
|
-
"@pezkuwi/x-global": "14.0.12",
|
|
138
|
-
"node-fetch": "^3.3.2",
|
|
139
|
-
"tslib": "^2.8.0"
|
|
140
|
-
}
|
|
141
|
-
}
|
package/build/packageInfo.d.ts
DELETED
package/build/packageInfo.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const packageInfo = { name: '@pezkuwi/x-fetch', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.0.13' };
|
package/build/react-native.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './browser.js';
|
package/build/react-native.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './browser.js';
|
package/build/shim.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build/shim.js
DELETED
package/build-deno/README.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# @pezkuwi/x-fetch
|
|
2
|
-
|
|
3
|
-
A cross-environment fetch.
|
|
4
|
-
|
|
5
|
-
Install it via `yarn add @pezkuwi/x-fetch`
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
import { fetch } from 'https://deno.land/x/pezkuwi/x-fetch/mod.ts';
|
|
9
|
-
|
|
10
|
-
...
|
|
11
|
-
const response = await fetch('https://example.com/something.json');
|
|
12
|
-
const json = await response.json();
|
|
13
|
-
```
|
package/build-deno/browser.ts
DELETED
package/build-deno/mod.ts
DELETED
package/build-deno/node.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { extractGlobal } from 'https://deno.land/x/pezkuwi/x-global/mod.ts';
|
|
3
|
-
|
|
4
|
-
export { packageInfo } from './packageInfo.ts';
|
|
5
|
-
|
|
6
|
-
const importFetch = import('https://esm.sh/node-fetch@3.3.2').catch(() => null);
|
|
7
|
-
|
|
8
|
-
let modFn: typeof fetch | null = null;
|
|
9
|
-
|
|
10
|
-
async function nodeFetch (...args: Parameters<typeof fetch>): Promise<Response> {
|
|
11
|
-
if (!modFn) {
|
|
12
|
-
const mod = await importFetch;
|
|
13
|
-
|
|
14
|
-
if (!mod?.default) {
|
|
15
|
-
throw new Error('Unable to import node-fetch in this environment');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
modFn = mod.default as unknown as typeof fetch;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return modFn(...args);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const fetch = /*#__PURE__*/ extractGlobal('fetch', nodeFetch);
|
package/build-deno/shim.ts
DELETED
package/build-tsc/browser.d.ts
DELETED
package/build-tsc/node.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './browser.js';
|
package/build-tsc/shim.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build-tsc-cjs/browser.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetch = exports.packageInfo = void 0;
|
|
4
|
-
const x_global_1 = require("@pezkuwi/x-global");
|
|
5
|
-
var packageInfo_js_1 = require("./packageInfo.js");
|
|
6
|
-
Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
|
|
7
|
-
exports.fetch = x_global_1.xglobal.fetch;
|
package/build-tsc-cjs/node.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.fetch = exports.packageInfo = void 0;
|
|
37
|
-
const x_global_1 = require("@pezkuwi/x-global");
|
|
38
|
-
var packageInfo_js_1 = require("./packageInfo.js");
|
|
39
|
-
Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
|
|
40
|
-
const importFetch = Promise.resolve().then(() => __importStar(require('node-fetch'))).catch(() => null);
|
|
41
|
-
let modFn = null;
|
|
42
|
-
async function nodeFetch(...args) {
|
|
43
|
-
if (!modFn) {
|
|
44
|
-
const mod = await importFetch;
|
|
45
|
-
if (!mod?.default) {
|
|
46
|
-
throw new Error('Unable to import node-fetch in this environment');
|
|
47
|
-
}
|
|
48
|
-
modFn = mod.default;
|
|
49
|
-
}
|
|
50
|
-
return modFn(...args);
|
|
51
|
-
}
|
|
52
|
-
exports.fetch = (0, x_global_1.extractGlobal)('fetch', nodeFetch);
|
package/build-tsc-cjs/shim.js
DELETED
package/build-tsc-esm/browser.js
DELETED
package/build-tsc-esm/node.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { extractGlobal } from '@pezkuwi/x-global';
|
|
2
|
-
export { packageInfo } from './packageInfo.js';
|
|
3
|
-
const importFetch = import('node-fetch').catch(() => null);
|
|
4
|
-
let modFn = null;
|
|
5
|
-
async function nodeFetch(...args) {
|
|
6
|
-
if (!modFn) {
|
|
7
|
-
const mod = await importFetch;
|
|
8
|
-
if (!mod?.default) {
|
|
9
|
-
throw new Error('Unable to import node-fetch in this environment');
|
|
10
|
-
}
|
|
11
|
-
modFn = mod.default;
|
|
12
|
-
}
|
|
13
|
-
return modFn(...args);
|
|
14
|
-
}
|
|
15
|
-
export const fetch = /*#__PURE__*/ extractGlobal('fetch', nodeFetch);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const packageInfo = { name: '@pezkuwi/x-fetch', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.0.13' };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './browser.js';
|
package/build-tsc-esm/shim.js
DELETED
package/src/browser.ts
DELETED
package/src/mod.ts
DELETED
package/src/node.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Copyright 2017-2025 @pezkuwi/x-fetch authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import { extractGlobal } from '@pezkuwi/x-global';
|
|
5
|
-
|
|
6
|
-
export { packageInfo } from './packageInfo.js';
|
|
7
|
-
|
|
8
|
-
// This is an ESM module, use the async import(...) syntax to pull it
|
|
9
|
-
// in. Logically we would like it in nodeFetch(...) itself, however
|
|
10
|
-
// while it is all-ok on Node itself, it does create issues in Jest,
|
|
11
|
-
// possibly due to the Jest 28 need for --experimental-vm-modules
|
|
12
|
-
const importFetch = import('node-fetch').catch(() => null);
|
|
13
|
-
|
|
14
|
-
// keep track of the resolved import value
|
|
15
|
-
let modFn: typeof fetch | null = null;
|
|
16
|
-
|
|
17
|
-
async function nodeFetch (...args: Parameters<typeof fetch>): Promise<Response> {
|
|
18
|
-
if (!modFn) {
|
|
19
|
-
const mod = await importFetch;
|
|
20
|
-
|
|
21
|
-
if (!mod?.default) {
|
|
22
|
-
throw new Error('Unable to import node-fetch in this environment');
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
modFn = mod.default as unknown as typeof fetch;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return modFn(...args);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const fetch = /*#__PURE__*/ extractGlobal('fetch', nodeFetch);
|
package/src/packageInfo.ts
DELETED
package/src/react-native.ts
DELETED
package/src/shim.ts
DELETED
package/tsconfig.build.json
DELETED