wreq-js 2.2.1 → 2.2.2
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/dist/wreq-js.cjs +77 -47
- package/dist/wreq-js.cjs.map +1 -1
- package/dist/wreq-js.js +77 -44
- package/dist/wreq-js.js.map +1 -1
- package/package.json +1 -1
- package/rust/wreq-js.darwin-arm64.node +0 -0
- package/rust/wreq-js.darwin-x64.node +0 -0
- package/rust/wreq-js.linux-arm64-gnu.node +0 -0
- package/rust/wreq-js.linux-x64-gnu.node +0 -0
- package/rust/wreq-js.linux-x64-musl.node +0 -0
- package/rust/wreq-js.win32-x64-msvc.node +0 -0
package/dist/wreq-js.cjs
CHANGED
|
@@ -41,7 +41,6 @@ __export(wreq_js_exports, {
|
|
|
41
41
|
module.exports = __toCommonJS(wreq_js_exports);
|
|
42
42
|
var import_node_crypto = require("crypto");
|
|
43
43
|
var import_node_http = require("http");
|
|
44
|
-
var import_node_module = require("module");
|
|
45
44
|
var import_node_stream = require("stream");
|
|
46
45
|
var import_web = require("stream/web");
|
|
47
46
|
|
|
@@ -54,7 +53,6 @@ var RequestError = class extends TypeError {
|
|
|
54
53
|
};
|
|
55
54
|
|
|
56
55
|
// src/wreq-js.ts
|
|
57
|
-
var import_meta = {};
|
|
58
56
|
var nativeBinding;
|
|
59
57
|
var cachedProfiles;
|
|
60
58
|
var cachedProfileSet;
|
|
@@ -79,59 +77,91 @@ function detectLibc() {
|
|
|
79
77
|
return "gnu";
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
|
-
var require2 = typeof import_meta !== "undefined" && import_meta.url ? (0, import_node_module.createRequire)(import_meta.url) : (0, import_node_module.createRequire)(__filename);
|
|
83
|
-
function requirePlatformBinary(platformArch) {
|
|
84
|
-
switch (platformArch) {
|
|
85
|
-
case "darwin-x64":
|
|
86
|
-
return require2("../rust/wreq-js.darwin-x64.node");
|
|
87
|
-
case "darwin-arm64":
|
|
88
|
-
return require2("../rust/wreq-js.darwin-arm64.node");
|
|
89
|
-
case "linux-x64-gnu":
|
|
90
|
-
return require2("../rust/wreq-js.linux-x64-gnu.node");
|
|
91
|
-
case "linux-x64-musl":
|
|
92
|
-
return require2("../rust/wreq-js.linux-x64-musl.node");
|
|
93
|
-
case "linux-arm64-gnu":
|
|
94
|
-
return require2("../rust/wreq-js.linux-arm64-gnu.node");
|
|
95
|
-
case "win32-x64-msvc":
|
|
96
|
-
return require2("../rust/wreq-js.win32-x64-msvc.node");
|
|
97
|
-
default:
|
|
98
|
-
return void 0;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
80
|
function loadNativeBinding() {
|
|
102
81
|
const platform = process.platform;
|
|
103
82
|
const arch = process.arch;
|
|
104
83
|
const libc = detectLibc();
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
`Unsupported platform: ${platform}-${arch}${libc ? `-${libc}` : ""}. Supported platforms: darwin-x64, darwin-arm64, linux-x64-gnu, linux-x64-musl, linux-arm64-gnu, win32-x64-msvc`
|
|
118
|
-
);
|
|
84
|
+
if (platform === "darwin" && arch === "x64") {
|
|
85
|
+
try {
|
|
86
|
+
return require("../rust/wreq-js.darwin-x64.node");
|
|
87
|
+
} catch {
|
|
88
|
+
try {
|
|
89
|
+
return require("../rust/wreq-js.node");
|
|
90
|
+
} catch {
|
|
91
|
+
throw new Error(
|
|
92
|
+
"Failed to load native module for darwin-x64. Tried: ../rust/wreq-js.darwin-x64.node and ../rust/wreq-js.node. Make sure the package is installed correctly and the native module is built for your platform."
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
119
96
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
97
|
+
if (platform === "darwin" && arch === "arm64") {
|
|
98
|
+
try {
|
|
99
|
+
return require("../rust/wreq-js.darwin-arm64.node");
|
|
100
|
+
} catch {
|
|
101
|
+
try {
|
|
102
|
+
return require("../rust/wreq-js.node");
|
|
103
|
+
} catch {
|
|
104
|
+
throw new Error(
|
|
105
|
+
"Failed to load native module for darwin-arm64. Tried: ../rust/wreq-js.darwin-arm64.node and ../rust/wreq-js.node. Make sure the package is installed correctly and the native module is built for your platform."
|
|
106
|
+
);
|
|
107
|
+
}
|
|
125
108
|
}
|
|
126
|
-
} catch {
|
|
127
109
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
110
|
+
if (platform === "linux" && arch === "x64") {
|
|
111
|
+
if (libc === "musl") {
|
|
112
|
+
try {
|
|
113
|
+
return require("../rust/wreq-js.linux-x64-musl.node");
|
|
114
|
+
} catch {
|
|
115
|
+
try {
|
|
116
|
+
return require("../rust/wreq-js.node");
|
|
117
|
+
} catch {
|
|
118
|
+
throw new Error(
|
|
119
|
+
"Failed to load native module for linux-x64-musl. Tried: ../rust/wreq-js.linux-x64-musl.node and ../rust/wreq-js.node. Make sure the package is installed correctly and the native module is built for your platform."
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
return require("../rust/wreq-js.linux-x64-gnu.node");
|
|
126
|
+
} catch {
|
|
127
|
+
try {
|
|
128
|
+
return require("../rust/wreq-js.node");
|
|
129
|
+
} catch {
|
|
130
|
+
throw new Error(
|
|
131
|
+
"Failed to load native module for linux-x64-gnu. Tried: ../rust/wreq-js.linux-x64-gnu.node and ../rust/wreq-js.node. Make sure the package is installed correctly and the native module is built for your platform."
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (platform === "linux" && arch === "arm64") {
|
|
137
|
+
try {
|
|
138
|
+
return require("../rust/wreq-js.linux-arm64-gnu.node");
|
|
139
|
+
} catch {
|
|
140
|
+
try {
|
|
141
|
+
return require("../rust/wreq-js.node");
|
|
142
|
+
} catch {
|
|
143
|
+
throw new Error(
|
|
144
|
+
"Failed to load native module for linux-arm64-gnu. Tried: ../rust/wreq-js.linux-arm64-gnu.node and ../rust/wreq-js.node. Make sure the package is installed correctly and the native module is built for your platform."
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
134
148
|
}
|
|
149
|
+
if (platform === "win32" && arch === "x64") {
|
|
150
|
+
try {
|
|
151
|
+
return require("../rust/wreq-js.win32-x64-msvc.node");
|
|
152
|
+
} catch {
|
|
153
|
+
try {
|
|
154
|
+
return require("../rust/wreq-js.node");
|
|
155
|
+
} catch {
|
|
156
|
+
throw new Error(
|
|
157
|
+
"Failed to load native module for win32-x64-msvc. Tried: ../rust/wreq-js.win32-x64-msvc.node and ../rust/wreq-js.node. Make sure the package is installed correctly and the native module is built for your platform."
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
throw new Error(
|
|
163
|
+
`Unsupported platform: ${platform}-${arch}${libc ? `-${libc}` : ""}. Supported platforms: darwin-x64, darwin-arm64, linux-x64-gnu, linux-x64-musl, linux-arm64-gnu, win32-x64-msvc`
|
|
164
|
+
);
|
|
135
165
|
}
|
|
136
166
|
nativeBinding = loadNativeBinding();
|
|
137
167
|
var websocketFinalizer = typeof FinalizationRegistry === "function" ? new FinalizationRegistry((connection) => {
|