wreq-js 2.2.0 → 2.2.1
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 +29 -8
- package/dist/wreq-js.cjs.map +1 -1
- package/dist/wreq-js.js +29 -8
- package/dist/wreq-js.js.map +1 -1
- package/package.json +5 -3
- 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.js
CHANGED
|
@@ -39,6 +39,24 @@ function detectLibc() {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
var require2 = typeof import.meta !== "undefined" && import.meta.url ? createRequire(import.meta.url) : createRequire(__filename);
|
|
42
|
+
function requirePlatformBinary(platformArch) {
|
|
43
|
+
switch (platformArch) {
|
|
44
|
+
case "darwin-x64":
|
|
45
|
+
return require2("../rust/wreq-js.darwin-x64.node");
|
|
46
|
+
case "darwin-arm64":
|
|
47
|
+
return require2("../rust/wreq-js.darwin-arm64.node");
|
|
48
|
+
case "linux-x64-gnu":
|
|
49
|
+
return require2("../rust/wreq-js.linux-x64-gnu.node");
|
|
50
|
+
case "linux-x64-musl":
|
|
51
|
+
return require2("../rust/wreq-js.linux-x64-musl.node");
|
|
52
|
+
case "linux-arm64-gnu":
|
|
53
|
+
return require2("../rust/wreq-js.linux-arm64-gnu.node");
|
|
54
|
+
case "win32-x64-msvc":
|
|
55
|
+
return require2("../rust/wreq-js.win32-x64-msvc.node");
|
|
56
|
+
default:
|
|
57
|
+
return void 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
42
60
|
function loadNativeBinding() {
|
|
43
61
|
const platform = process.platform;
|
|
44
62
|
const arch = process.arch;
|
|
@@ -60,15 +78,18 @@ function loadNativeBinding() {
|
|
|
60
78
|
}
|
|
61
79
|
const binaryName = `wreq-js.${platformArch}.node`;
|
|
62
80
|
try {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return require2("../rust/wreq-js.node");
|
|
67
|
-
} catch {
|
|
68
|
-
throw new Error(
|
|
69
|
-
`Failed to load native module for ${platform}-${arch}. Tried: ../rust/${binaryName} and ../rust/wreq-js.node. Make sure the package is installed correctly and the native module is built for your platform.`
|
|
70
|
-
);
|
|
81
|
+
const platformBinding = requirePlatformBinary(platformArch);
|
|
82
|
+
if (platformBinding) {
|
|
83
|
+
return platformBinding;
|
|
71
84
|
}
|
|
85
|
+
} catch {
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
return require2("../rust/wreq-js.node");
|
|
89
|
+
} catch {
|
|
90
|
+
throw new Error(
|
|
91
|
+
`Failed to load native module for ${platform}-${arch}. Tried: ../rust/${binaryName} and ../rust/wreq-js.node. Make sure the package is installed correctly and the native module is built for your platform.`
|
|
92
|
+
);
|
|
72
93
|
}
|
|
73
94
|
}
|
|
74
95
|
nativeBinding = loadNativeBinding();
|