@build-qube/takeoff-calculator 2.0.4 → 2.3.0
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/README.md +4 -0
- package/browser.js +1 -1
- package/index.d.ts +308 -70
- package/index.js +204 -196
- package/package.json +14 -33
package/index.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
|
-
const { readFileSync } = require('node:fs')
|
|
6
|
+
const { readFileSync } = require('node:fs');
|
|
7
7
|
let nativeBinding = null;
|
|
8
8
|
const loadErrors = [];
|
|
9
9
|
|
|
10
10
|
const isMusl = () => {
|
|
11
11
|
let musl = false;
|
|
12
|
-
if (process.platform ===
|
|
12
|
+
if (process.platform === 'linux') {
|
|
13
13
|
musl = isMuslFromFilesystem();
|
|
14
14
|
if (musl === null) {
|
|
15
15
|
musl = isMuslFromReport();
|
|
@@ -21,11 +21,11 @@ const isMusl = () => {
|
|
|
21
21
|
return musl;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const isFileMusl = (f) => f.includes(
|
|
24
|
+
const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-');
|
|
25
25
|
|
|
26
26
|
const isMuslFromFilesystem = () => {
|
|
27
27
|
try {
|
|
28
|
-
return readFileSync(
|
|
28
|
+
return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl');
|
|
29
29
|
} catch {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
@@ -33,7 +33,7 @@ const isMuslFromFilesystem = () => {
|
|
|
33
33
|
|
|
34
34
|
const isMuslFromReport = () => {
|
|
35
35
|
let report = null;
|
|
36
|
-
if (typeof process.report?.getReport ===
|
|
36
|
+
if (typeof process.report?.getReport === 'function') {
|
|
37
37
|
process.report.excludeNetwork = true;
|
|
38
38
|
report = process.report.getReport();
|
|
39
39
|
}
|
|
@@ -53,9 +53,9 @@ const isMuslFromReport = () => {
|
|
|
53
53
|
|
|
54
54
|
const isMuslFromChildProcess = () => {
|
|
55
55
|
try {
|
|
56
|
-
return require(
|
|
57
|
-
.execSync(
|
|
58
|
-
.includes(
|
|
56
|
+
return require('child_process')
|
|
57
|
+
.execSync('ldd --version', { encoding: 'utf8' })
|
|
58
|
+
.includes('musl');
|
|
59
59
|
} catch (e) {
|
|
60
60
|
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
|
|
61
61
|
return false;
|
|
@@ -69,47 +69,47 @@ function requireNative() {
|
|
|
69
69
|
} catch (err) {
|
|
70
70
|
loadErrors.push(err);
|
|
71
71
|
}
|
|
72
|
-
} else if (process.platform ===
|
|
73
|
-
if (process.arch ===
|
|
72
|
+
} else if (process.platform === 'android') {
|
|
73
|
+
if (process.arch === 'arm64') {
|
|
74
74
|
try {
|
|
75
|
-
return require(
|
|
75
|
+
return require('./takeoff-calculator.android-arm64.node');
|
|
76
76
|
} catch (e) {
|
|
77
77
|
loadErrors.push(e);
|
|
78
78
|
}
|
|
79
79
|
try {
|
|
80
|
-
const binding = require(
|
|
80
|
+
const binding = require('@build-qube/takeoff-calculator-android-arm64');
|
|
81
81
|
const bindingPackageVersion =
|
|
82
|
-
require(
|
|
82
|
+
require('@build-qube/takeoff-calculator-android-arm64/package.json').version;
|
|
83
83
|
if (
|
|
84
|
-
bindingPackageVersion !==
|
|
84
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
85
85
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
86
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
86
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
87
87
|
) {
|
|
88
88
|
throw new Error(
|
|
89
|
-
`Native binding package version mismatch, expected 2.0
|
|
89
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
return binding;
|
|
93
93
|
} catch (e) {
|
|
94
94
|
loadErrors.push(e);
|
|
95
95
|
}
|
|
96
|
-
} else if (process.arch ===
|
|
96
|
+
} else if (process.arch === 'arm') {
|
|
97
97
|
try {
|
|
98
|
-
return require(
|
|
98
|
+
return require('./takeoff-calculator.android-arm-eabi.node');
|
|
99
99
|
} catch (e) {
|
|
100
100
|
loadErrors.push(e);
|
|
101
101
|
}
|
|
102
102
|
try {
|
|
103
|
-
const binding = require(
|
|
103
|
+
const binding = require('@build-qube/takeoff-calculator-android-arm-eabi');
|
|
104
104
|
const bindingPackageVersion =
|
|
105
|
-
require(
|
|
105
|
+
require('@build-qube/takeoff-calculator-android-arm-eabi/package.json').version;
|
|
106
106
|
if (
|
|
107
|
-
bindingPackageVersion !==
|
|
107
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
108
108
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
109
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
109
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
110
110
|
) {
|
|
111
111
|
throw new Error(
|
|
112
|
-
`Native binding package version mismatch, expected 2.0
|
|
112
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
return binding;
|
|
@@ -121,28 +121,28 @@ function requireNative() {
|
|
|
121
121
|
new Error(`Unsupported architecture on Android ${process.arch}`),
|
|
122
122
|
);
|
|
123
123
|
}
|
|
124
|
-
} else if (process.platform ===
|
|
125
|
-
if (process.arch ===
|
|
124
|
+
} else if (process.platform === 'win32') {
|
|
125
|
+
if (process.arch === 'x64') {
|
|
126
126
|
if (
|
|
127
|
-
process.config?.variables?.shlib_suffix ===
|
|
128
|
-
process.config?.variables?.node_target_type ===
|
|
127
|
+
process.config?.variables?.shlib_suffix === 'dll.a' ||
|
|
128
|
+
process.config?.variables?.node_target_type === 'shared_library'
|
|
129
129
|
) {
|
|
130
130
|
try {
|
|
131
|
-
return require(
|
|
131
|
+
return require('./takeoff-calculator.win32-x64-gnu.node');
|
|
132
132
|
} catch (e) {
|
|
133
133
|
loadErrors.push(e);
|
|
134
134
|
}
|
|
135
135
|
try {
|
|
136
|
-
const binding = require(
|
|
136
|
+
const binding = require('@build-qube/takeoff-calculator-win32-x64-gnu');
|
|
137
137
|
const bindingPackageVersion =
|
|
138
|
-
require(
|
|
138
|
+
require('@build-qube/takeoff-calculator-win32-x64-gnu/package.json').version;
|
|
139
139
|
if (
|
|
140
|
-
bindingPackageVersion !==
|
|
140
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
141
141
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
142
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
142
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
143
143
|
) {
|
|
144
144
|
throw new Error(
|
|
145
|
-
`Native binding package version mismatch, expected 2.0
|
|
145
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
148
|
return binding;
|
|
@@ -151,21 +151,21 @@ function requireNative() {
|
|
|
151
151
|
}
|
|
152
152
|
} else {
|
|
153
153
|
try {
|
|
154
|
-
return require(
|
|
154
|
+
return require('./takeoff-calculator.win32-x64-msvc.node');
|
|
155
155
|
} catch (e) {
|
|
156
156
|
loadErrors.push(e);
|
|
157
157
|
}
|
|
158
158
|
try {
|
|
159
|
-
const binding = require(
|
|
159
|
+
const binding = require('@build-qube/takeoff-calculator-win32-x64-msvc');
|
|
160
160
|
const bindingPackageVersion =
|
|
161
|
-
require(
|
|
161
|
+
require('@build-qube/takeoff-calculator-win32-x64-msvc/package.json').version;
|
|
162
162
|
if (
|
|
163
|
-
bindingPackageVersion !==
|
|
163
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
164
164
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
165
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
165
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
166
166
|
) {
|
|
167
167
|
throw new Error(
|
|
168
|
-
`Native binding package version mismatch, expected 2.0
|
|
168
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
169
169
|
);
|
|
170
170
|
}
|
|
171
171
|
return binding;
|
|
@@ -173,46 +173,46 @@ function requireNative() {
|
|
|
173
173
|
loadErrors.push(e);
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
} else if (process.arch ===
|
|
176
|
+
} else if (process.arch === 'ia32') {
|
|
177
177
|
try {
|
|
178
|
-
return require(
|
|
178
|
+
return require('./takeoff-calculator.win32-ia32-msvc.node');
|
|
179
179
|
} catch (e) {
|
|
180
180
|
loadErrors.push(e);
|
|
181
181
|
}
|
|
182
182
|
try {
|
|
183
|
-
const binding = require(
|
|
183
|
+
const binding = require('@build-qube/takeoff-calculator-win32-ia32-msvc');
|
|
184
184
|
const bindingPackageVersion =
|
|
185
|
-
require(
|
|
185
|
+
require('@build-qube/takeoff-calculator-win32-ia32-msvc/package.json').version;
|
|
186
186
|
if (
|
|
187
|
-
bindingPackageVersion !==
|
|
187
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
188
188
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
189
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
189
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
190
190
|
) {
|
|
191
191
|
throw new Error(
|
|
192
|
-
`Native binding package version mismatch, expected 2.0
|
|
192
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
193
193
|
);
|
|
194
194
|
}
|
|
195
195
|
return binding;
|
|
196
196
|
} catch (e) {
|
|
197
197
|
loadErrors.push(e);
|
|
198
198
|
}
|
|
199
|
-
} else if (process.arch ===
|
|
199
|
+
} else if (process.arch === 'arm64') {
|
|
200
200
|
try {
|
|
201
|
-
return require(
|
|
201
|
+
return require('./takeoff-calculator.win32-arm64-msvc.node');
|
|
202
202
|
} catch (e) {
|
|
203
203
|
loadErrors.push(e);
|
|
204
204
|
}
|
|
205
205
|
try {
|
|
206
|
-
const binding = require(
|
|
206
|
+
const binding = require('@build-qube/takeoff-calculator-win32-arm64-msvc');
|
|
207
207
|
const bindingPackageVersion =
|
|
208
|
-
require(
|
|
208
|
+
require('@build-qube/takeoff-calculator-win32-arm64-msvc/package.json').version;
|
|
209
209
|
if (
|
|
210
|
-
bindingPackageVersion !==
|
|
210
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
211
211
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
212
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
212
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
213
213
|
) {
|
|
214
214
|
throw new Error(
|
|
215
|
-
`Native binding package version mismatch, expected 2.0
|
|
215
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
218
|
return binding;
|
|
@@ -224,69 +224,69 @@ function requireNative() {
|
|
|
224
224
|
new Error(`Unsupported architecture on Windows: ${process.arch}`),
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
|
-
} else if (process.platform ===
|
|
227
|
+
} else if (process.platform === 'darwin') {
|
|
228
228
|
try {
|
|
229
|
-
return require(
|
|
229
|
+
return require('./takeoff-calculator.darwin-universal.node');
|
|
230
230
|
} catch (e) {
|
|
231
231
|
loadErrors.push(e);
|
|
232
232
|
}
|
|
233
233
|
try {
|
|
234
|
-
const binding = require(
|
|
234
|
+
const binding = require('@build-qube/takeoff-calculator-darwin-universal');
|
|
235
235
|
const bindingPackageVersion =
|
|
236
|
-
require(
|
|
236
|
+
require('@build-qube/takeoff-calculator-darwin-universal/package.json').version;
|
|
237
237
|
if (
|
|
238
|
-
bindingPackageVersion !==
|
|
238
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
239
239
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
240
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
240
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
241
241
|
) {
|
|
242
242
|
throw new Error(
|
|
243
|
-
`Native binding package version mismatch, expected 2.0
|
|
243
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
246
|
return binding;
|
|
247
247
|
} catch (e) {
|
|
248
248
|
loadErrors.push(e);
|
|
249
249
|
}
|
|
250
|
-
if (process.arch ===
|
|
250
|
+
if (process.arch === 'x64') {
|
|
251
251
|
try {
|
|
252
|
-
return require(
|
|
252
|
+
return require('./takeoff-calculator.darwin-x64.node');
|
|
253
253
|
} catch (e) {
|
|
254
254
|
loadErrors.push(e);
|
|
255
255
|
}
|
|
256
256
|
try {
|
|
257
|
-
const binding = require(
|
|
257
|
+
const binding = require('@build-qube/takeoff-calculator-darwin-x64');
|
|
258
258
|
const bindingPackageVersion =
|
|
259
|
-
require(
|
|
259
|
+
require('@build-qube/takeoff-calculator-darwin-x64/package.json').version;
|
|
260
260
|
if (
|
|
261
|
-
bindingPackageVersion !==
|
|
261
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
262
262
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
263
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
263
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
264
264
|
) {
|
|
265
265
|
throw new Error(
|
|
266
|
-
`Native binding package version mismatch, expected 2.0
|
|
266
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
267
267
|
);
|
|
268
268
|
}
|
|
269
269
|
return binding;
|
|
270
270
|
} catch (e) {
|
|
271
271
|
loadErrors.push(e);
|
|
272
272
|
}
|
|
273
|
-
} else if (process.arch ===
|
|
273
|
+
} else if (process.arch === 'arm64') {
|
|
274
274
|
try {
|
|
275
|
-
return require(
|
|
275
|
+
return require('./takeoff-calculator.darwin-arm64.node');
|
|
276
276
|
} catch (e) {
|
|
277
277
|
loadErrors.push(e);
|
|
278
278
|
}
|
|
279
279
|
try {
|
|
280
|
-
const binding = require(
|
|
280
|
+
const binding = require('@build-qube/takeoff-calculator-darwin-arm64');
|
|
281
281
|
const bindingPackageVersion =
|
|
282
|
-
require(
|
|
282
|
+
require('@build-qube/takeoff-calculator-darwin-arm64/package.json').version;
|
|
283
283
|
if (
|
|
284
|
-
bindingPackageVersion !==
|
|
284
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
285
285
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
286
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
286
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
287
287
|
) {
|
|
288
288
|
throw new Error(
|
|
289
|
-
`Native binding package version mismatch, expected 2.0
|
|
289
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
290
290
|
);
|
|
291
291
|
}
|
|
292
292
|
return binding;
|
|
@@ -298,47 +298,47 @@ function requireNative() {
|
|
|
298
298
|
new Error(`Unsupported architecture on macOS: ${process.arch}`),
|
|
299
299
|
);
|
|
300
300
|
}
|
|
301
|
-
} else if (process.platform ===
|
|
302
|
-
if (process.arch ===
|
|
301
|
+
} else if (process.platform === 'freebsd') {
|
|
302
|
+
if (process.arch === 'x64') {
|
|
303
303
|
try {
|
|
304
|
-
return require(
|
|
304
|
+
return require('./takeoff-calculator.freebsd-x64.node');
|
|
305
305
|
} catch (e) {
|
|
306
306
|
loadErrors.push(e);
|
|
307
307
|
}
|
|
308
308
|
try {
|
|
309
|
-
const binding = require(
|
|
309
|
+
const binding = require('@build-qube/takeoff-calculator-freebsd-x64');
|
|
310
310
|
const bindingPackageVersion =
|
|
311
|
-
require(
|
|
311
|
+
require('@build-qube/takeoff-calculator-freebsd-x64/package.json').version;
|
|
312
312
|
if (
|
|
313
|
-
bindingPackageVersion !==
|
|
313
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
314
314
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
315
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
315
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
316
316
|
) {
|
|
317
317
|
throw new Error(
|
|
318
|
-
`Native binding package version mismatch, expected 2.0
|
|
318
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
319
319
|
);
|
|
320
320
|
}
|
|
321
321
|
return binding;
|
|
322
322
|
} catch (e) {
|
|
323
323
|
loadErrors.push(e);
|
|
324
324
|
}
|
|
325
|
-
} else if (process.arch ===
|
|
325
|
+
} else if (process.arch === 'arm64') {
|
|
326
326
|
try {
|
|
327
|
-
return require(
|
|
327
|
+
return require('./takeoff-calculator.freebsd-arm64.node');
|
|
328
328
|
} catch (e) {
|
|
329
329
|
loadErrors.push(e);
|
|
330
330
|
}
|
|
331
331
|
try {
|
|
332
|
-
const binding = require(
|
|
332
|
+
const binding = require('@build-qube/takeoff-calculator-freebsd-arm64');
|
|
333
333
|
const bindingPackageVersion =
|
|
334
|
-
require(
|
|
334
|
+
require('@build-qube/takeoff-calculator-freebsd-arm64/package.json').version;
|
|
335
335
|
if (
|
|
336
|
-
bindingPackageVersion !==
|
|
336
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
337
337
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
338
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
338
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
339
339
|
) {
|
|
340
340
|
throw new Error(
|
|
341
|
-
`Native binding package version mismatch, expected 2.0
|
|
341
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
342
342
|
);
|
|
343
343
|
}
|
|
344
344
|
return binding;
|
|
@@ -350,25 +350,25 @@ function requireNative() {
|
|
|
350
350
|
new Error(`Unsupported architecture on FreeBSD: ${process.arch}`),
|
|
351
351
|
);
|
|
352
352
|
}
|
|
353
|
-
} else if (process.platform ===
|
|
354
|
-
if (process.arch ===
|
|
353
|
+
} else if (process.platform === 'linux') {
|
|
354
|
+
if (process.arch === 'x64') {
|
|
355
355
|
if (isMusl()) {
|
|
356
356
|
try {
|
|
357
|
-
return require(
|
|
357
|
+
return require('./takeoff-calculator.linux-x64-musl.node');
|
|
358
358
|
} catch (e) {
|
|
359
359
|
loadErrors.push(e);
|
|
360
360
|
}
|
|
361
361
|
try {
|
|
362
|
-
const binding = require(
|
|
362
|
+
const binding = require('@build-qube/takeoff-calculator-linux-x64-musl');
|
|
363
363
|
const bindingPackageVersion =
|
|
364
|
-
require(
|
|
364
|
+
require('@build-qube/takeoff-calculator-linux-x64-musl/package.json').version;
|
|
365
365
|
if (
|
|
366
|
-
bindingPackageVersion !==
|
|
366
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
367
367
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
368
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
368
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
369
369
|
) {
|
|
370
370
|
throw new Error(
|
|
371
|
-
`Native binding package version mismatch, expected 2.0
|
|
371
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
372
372
|
);
|
|
373
373
|
}
|
|
374
374
|
return binding;
|
|
@@ -377,21 +377,21 @@ function requireNative() {
|
|
|
377
377
|
}
|
|
378
378
|
} else {
|
|
379
379
|
try {
|
|
380
|
-
return require(
|
|
380
|
+
return require('./takeoff-calculator.linux-x64-gnu.node');
|
|
381
381
|
} catch (e) {
|
|
382
382
|
loadErrors.push(e);
|
|
383
383
|
}
|
|
384
384
|
try {
|
|
385
|
-
const binding = require(
|
|
385
|
+
const binding = require('@build-qube/takeoff-calculator-linux-x64-gnu');
|
|
386
386
|
const bindingPackageVersion =
|
|
387
|
-
require(
|
|
387
|
+
require('@build-qube/takeoff-calculator-linux-x64-gnu/package.json').version;
|
|
388
388
|
if (
|
|
389
|
-
bindingPackageVersion !==
|
|
389
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
390
390
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
391
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
391
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
392
392
|
) {
|
|
393
393
|
throw new Error(
|
|
394
|
-
`Native binding package version mismatch, expected 2.0
|
|
394
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
395
395
|
);
|
|
396
396
|
}
|
|
397
397
|
return binding;
|
|
@@ -399,24 +399,24 @@ function requireNative() {
|
|
|
399
399
|
loadErrors.push(e);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
|
-
} else if (process.arch ===
|
|
402
|
+
} else if (process.arch === 'arm64') {
|
|
403
403
|
if (isMusl()) {
|
|
404
404
|
try {
|
|
405
|
-
return require(
|
|
405
|
+
return require('./takeoff-calculator.linux-arm64-musl.node');
|
|
406
406
|
} catch (e) {
|
|
407
407
|
loadErrors.push(e);
|
|
408
408
|
}
|
|
409
409
|
try {
|
|
410
|
-
const binding = require(
|
|
410
|
+
const binding = require('@build-qube/takeoff-calculator-linux-arm64-musl');
|
|
411
411
|
const bindingPackageVersion =
|
|
412
|
-
require(
|
|
412
|
+
require('@build-qube/takeoff-calculator-linux-arm64-musl/package.json').version;
|
|
413
413
|
if (
|
|
414
|
-
bindingPackageVersion !==
|
|
414
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
415
415
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
416
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
416
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
417
417
|
) {
|
|
418
418
|
throw new Error(
|
|
419
|
-
`Native binding package version mismatch, expected 2.0
|
|
419
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
420
420
|
);
|
|
421
421
|
}
|
|
422
422
|
return binding;
|
|
@@ -425,21 +425,21 @@ function requireNative() {
|
|
|
425
425
|
}
|
|
426
426
|
} else {
|
|
427
427
|
try {
|
|
428
|
-
return require(
|
|
428
|
+
return require('./takeoff-calculator.linux-arm64-gnu.node');
|
|
429
429
|
} catch (e) {
|
|
430
430
|
loadErrors.push(e);
|
|
431
431
|
}
|
|
432
432
|
try {
|
|
433
|
-
const binding = require(
|
|
433
|
+
const binding = require('@build-qube/takeoff-calculator-linux-arm64-gnu');
|
|
434
434
|
const bindingPackageVersion =
|
|
435
|
-
require(
|
|
435
|
+
require('@build-qube/takeoff-calculator-linux-arm64-gnu/package.json').version;
|
|
436
436
|
if (
|
|
437
|
-
bindingPackageVersion !==
|
|
437
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
438
438
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
439
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
439
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
440
440
|
) {
|
|
441
441
|
throw new Error(
|
|
442
|
-
`Native binding package version mismatch, expected 2.0
|
|
442
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
443
443
|
);
|
|
444
444
|
}
|
|
445
445
|
return binding;
|
|
@@ -447,24 +447,24 @@ function requireNative() {
|
|
|
447
447
|
loadErrors.push(e);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
} else if (process.arch ===
|
|
450
|
+
} else if (process.arch === 'arm') {
|
|
451
451
|
if (isMusl()) {
|
|
452
452
|
try {
|
|
453
|
-
return require(
|
|
453
|
+
return require('./takeoff-calculator.linux-arm-musleabihf.node');
|
|
454
454
|
} catch (e) {
|
|
455
455
|
loadErrors.push(e);
|
|
456
456
|
}
|
|
457
457
|
try {
|
|
458
|
-
const binding = require(
|
|
458
|
+
const binding = require('@build-qube/takeoff-calculator-linux-arm-musleabihf');
|
|
459
459
|
const bindingPackageVersion =
|
|
460
|
-
require(
|
|
460
|
+
require('@build-qube/takeoff-calculator-linux-arm-musleabihf/package.json').version;
|
|
461
461
|
if (
|
|
462
|
-
bindingPackageVersion !==
|
|
462
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
463
463
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
464
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
464
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
465
465
|
) {
|
|
466
466
|
throw new Error(
|
|
467
|
-
`Native binding package version mismatch, expected 2.0
|
|
467
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
468
468
|
);
|
|
469
469
|
}
|
|
470
470
|
return binding;
|
|
@@ -473,21 +473,21 @@ function requireNative() {
|
|
|
473
473
|
}
|
|
474
474
|
} else {
|
|
475
475
|
try {
|
|
476
|
-
return require(
|
|
476
|
+
return require('./takeoff-calculator.linux-arm-gnueabihf.node');
|
|
477
477
|
} catch (e) {
|
|
478
478
|
loadErrors.push(e);
|
|
479
479
|
}
|
|
480
480
|
try {
|
|
481
|
-
const binding = require(
|
|
481
|
+
const binding = require('@build-qube/takeoff-calculator-linux-arm-gnueabihf');
|
|
482
482
|
const bindingPackageVersion =
|
|
483
|
-
require(
|
|
483
|
+
require('@build-qube/takeoff-calculator-linux-arm-gnueabihf/package.json').version;
|
|
484
484
|
if (
|
|
485
|
-
bindingPackageVersion !==
|
|
485
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
486
486
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
487
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
487
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
488
488
|
) {
|
|
489
489
|
throw new Error(
|
|
490
|
-
`Native binding package version mismatch, expected 2.0
|
|
490
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
491
491
|
);
|
|
492
492
|
}
|
|
493
493
|
return binding;
|
|
@@ -495,24 +495,24 @@ function requireNative() {
|
|
|
495
495
|
loadErrors.push(e);
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
} else if (process.arch ===
|
|
498
|
+
} else if (process.arch === 'loong64') {
|
|
499
499
|
if (isMusl()) {
|
|
500
500
|
try {
|
|
501
|
-
return require(
|
|
501
|
+
return require('./takeoff-calculator.linux-loong64-musl.node');
|
|
502
502
|
} catch (e) {
|
|
503
503
|
loadErrors.push(e);
|
|
504
504
|
}
|
|
505
505
|
try {
|
|
506
|
-
const binding = require(
|
|
506
|
+
const binding = require('@build-qube/takeoff-calculator-linux-loong64-musl');
|
|
507
507
|
const bindingPackageVersion =
|
|
508
|
-
require(
|
|
508
|
+
require('@build-qube/takeoff-calculator-linux-loong64-musl/package.json').version;
|
|
509
509
|
if (
|
|
510
|
-
bindingPackageVersion !==
|
|
510
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
511
511
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
512
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
512
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
513
513
|
) {
|
|
514
514
|
throw new Error(
|
|
515
|
-
`Native binding package version mismatch, expected 2.0
|
|
515
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
516
516
|
);
|
|
517
517
|
}
|
|
518
518
|
return binding;
|
|
@@ -521,21 +521,21 @@ function requireNative() {
|
|
|
521
521
|
}
|
|
522
522
|
} else {
|
|
523
523
|
try {
|
|
524
|
-
return require(
|
|
524
|
+
return require('./takeoff-calculator.linux-loong64-gnu.node');
|
|
525
525
|
} catch (e) {
|
|
526
526
|
loadErrors.push(e);
|
|
527
527
|
}
|
|
528
528
|
try {
|
|
529
|
-
const binding = require(
|
|
529
|
+
const binding = require('@build-qube/takeoff-calculator-linux-loong64-gnu');
|
|
530
530
|
const bindingPackageVersion =
|
|
531
|
-
require(
|
|
531
|
+
require('@build-qube/takeoff-calculator-linux-loong64-gnu/package.json').version;
|
|
532
532
|
if (
|
|
533
|
-
bindingPackageVersion !==
|
|
533
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
534
534
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
535
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
535
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
536
536
|
) {
|
|
537
537
|
throw new Error(
|
|
538
|
-
`Native binding package version mismatch, expected 2.0
|
|
538
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
539
539
|
);
|
|
540
540
|
}
|
|
541
541
|
return binding;
|
|
@@ -543,24 +543,24 @@ function requireNative() {
|
|
|
543
543
|
loadErrors.push(e);
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
} else if (process.arch ===
|
|
546
|
+
} else if (process.arch === 'riscv64') {
|
|
547
547
|
if (isMusl()) {
|
|
548
548
|
try {
|
|
549
|
-
return require(
|
|
549
|
+
return require('./takeoff-calculator.linux-riscv64-musl.node');
|
|
550
550
|
} catch (e) {
|
|
551
551
|
loadErrors.push(e);
|
|
552
552
|
}
|
|
553
553
|
try {
|
|
554
|
-
const binding = require(
|
|
554
|
+
const binding = require('@build-qube/takeoff-calculator-linux-riscv64-musl');
|
|
555
555
|
const bindingPackageVersion =
|
|
556
|
-
require(
|
|
556
|
+
require('@build-qube/takeoff-calculator-linux-riscv64-musl/package.json').version;
|
|
557
557
|
if (
|
|
558
|
-
bindingPackageVersion !==
|
|
558
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
559
559
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
560
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
560
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
561
561
|
) {
|
|
562
562
|
throw new Error(
|
|
563
|
-
`Native binding package version mismatch, expected 2.0
|
|
563
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
564
564
|
);
|
|
565
565
|
}
|
|
566
566
|
return binding;
|
|
@@ -569,21 +569,21 @@ function requireNative() {
|
|
|
569
569
|
}
|
|
570
570
|
} else {
|
|
571
571
|
try {
|
|
572
|
-
return require(
|
|
572
|
+
return require('./takeoff-calculator.linux-riscv64-gnu.node');
|
|
573
573
|
} catch (e) {
|
|
574
574
|
loadErrors.push(e);
|
|
575
575
|
}
|
|
576
576
|
try {
|
|
577
|
-
const binding = require(
|
|
577
|
+
const binding = require('@build-qube/takeoff-calculator-linux-riscv64-gnu');
|
|
578
578
|
const bindingPackageVersion =
|
|
579
|
-
require(
|
|
579
|
+
require('@build-qube/takeoff-calculator-linux-riscv64-gnu/package.json').version;
|
|
580
580
|
if (
|
|
581
|
-
bindingPackageVersion !==
|
|
581
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
582
582
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
583
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
583
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
584
584
|
) {
|
|
585
585
|
throw new Error(
|
|
586
|
-
`Native binding package version mismatch, expected 2.0
|
|
586
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
587
587
|
);
|
|
588
588
|
}
|
|
589
589
|
return binding;
|
|
@@ -591,46 +591,46 @@ function requireNative() {
|
|
|
591
591
|
loadErrors.push(e);
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
|
-
} else if (process.arch ===
|
|
594
|
+
} else if (process.arch === 'ppc64') {
|
|
595
595
|
try {
|
|
596
|
-
return require(
|
|
596
|
+
return require('./takeoff-calculator.linux-ppc64-gnu.node');
|
|
597
597
|
} catch (e) {
|
|
598
598
|
loadErrors.push(e);
|
|
599
599
|
}
|
|
600
600
|
try {
|
|
601
|
-
const binding = require(
|
|
601
|
+
const binding = require('@build-qube/takeoff-calculator-linux-ppc64-gnu');
|
|
602
602
|
const bindingPackageVersion =
|
|
603
|
-
require(
|
|
603
|
+
require('@build-qube/takeoff-calculator-linux-ppc64-gnu/package.json').version;
|
|
604
604
|
if (
|
|
605
|
-
bindingPackageVersion !==
|
|
605
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
606
606
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
607
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
607
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
608
608
|
) {
|
|
609
609
|
throw new Error(
|
|
610
|
-
`Native binding package version mismatch, expected 2.0
|
|
610
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
611
611
|
);
|
|
612
612
|
}
|
|
613
613
|
return binding;
|
|
614
614
|
} catch (e) {
|
|
615
615
|
loadErrors.push(e);
|
|
616
616
|
}
|
|
617
|
-
} else if (process.arch ===
|
|
617
|
+
} else if (process.arch === 's390x') {
|
|
618
618
|
try {
|
|
619
|
-
return require(
|
|
619
|
+
return require('./takeoff-calculator.linux-s390x-gnu.node');
|
|
620
620
|
} catch (e) {
|
|
621
621
|
loadErrors.push(e);
|
|
622
622
|
}
|
|
623
623
|
try {
|
|
624
|
-
const binding = require(
|
|
624
|
+
const binding = require('@build-qube/takeoff-calculator-linux-s390x-gnu');
|
|
625
625
|
const bindingPackageVersion =
|
|
626
|
-
require(
|
|
626
|
+
require('@build-qube/takeoff-calculator-linux-s390x-gnu/package.json').version;
|
|
627
627
|
if (
|
|
628
|
-
bindingPackageVersion !==
|
|
628
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
629
629
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
630
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
630
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
631
631
|
) {
|
|
632
632
|
throw new Error(
|
|
633
|
-
`Native binding package version mismatch, expected 2.0
|
|
633
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
634
634
|
);
|
|
635
635
|
}
|
|
636
636
|
return binding;
|
|
@@ -642,70 +642,70 @@ function requireNative() {
|
|
|
642
642
|
new Error(`Unsupported architecture on Linux: ${process.arch}`),
|
|
643
643
|
);
|
|
644
644
|
}
|
|
645
|
-
} else if (process.platform ===
|
|
646
|
-
if (process.arch ===
|
|
645
|
+
} else if (process.platform === 'openharmony') {
|
|
646
|
+
if (process.arch === 'arm64') {
|
|
647
647
|
try {
|
|
648
|
-
return require(
|
|
648
|
+
return require('./takeoff-calculator.openharmony-arm64.node');
|
|
649
649
|
} catch (e) {
|
|
650
650
|
loadErrors.push(e);
|
|
651
651
|
}
|
|
652
652
|
try {
|
|
653
|
-
const binding = require(
|
|
653
|
+
const binding = require('@build-qube/takeoff-calculator-openharmony-arm64');
|
|
654
654
|
const bindingPackageVersion =
|
|
655
|
-
require(
|
|
655
|
+
require('@build-qube/takeoff-calculator-openharmony-arm64/package.json').version;
|
|
656
656
|
if (
|
|
657
|
-
bindingPackageVersion !==
|
|
657
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
658
658
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
659
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
659
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
660
660
|
) {
|
|
661
661
|
throw new Error(
|
|
662
|
-
`Native binding package version mismatch, expected 2.0
|
|
662
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
663
663
|
);
|
|
664
664
|
}
|
|
665
665
|
return binding;
|
|
666
666
|
} catch (e) {
|
|
667
667
|
loadErrors.push(e);
|
|
668
668
|
}
|
|
669
|
-
} else if (process.arch ===
|
|
669
|
+
} else if (process.arch === 'x64') {
|
|
670
670
|
try {
|
|
671
|
-
return require(
|
|
671
|
+
return require('./takeoff-calculator.openharmony-x64.node');
|
|
672
672
|
} catch (e) {
|
|
673
673
|
loadErrors.push(e);
|
|
674
674
|
}
|
|
675
675
|
try {
|
|
676
|
-
const binding = require(
|
|
676
|
+
const binding = require('@build-qube/takeoff-calculator-openharmony-x64');
|
|
677
677
|
const bindingPackageVersion =
|
|
678
|
-
require(
|
|
678
|
+
require('@build-qube/takeoff-calculator-openharmony-x64/package.json').version;
|
|
679
679
|
if (
|
|
680
|
-
bindingPackageVersion !==
|
|
680
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
681
681
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
682
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
682
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
683
683
|
) {
|
|
684
684
|
throw new Error(
|
|
685
|
-
`Native binding package version mismatch, expected 2.0
|
|
685
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
686
686
|
);
|
|
687
687
|
}
|
|
688
688
|
return binding;
|
|
689
689
|
} catch (e) {
|
|
690
690
|
loadErrors.push(e);
|
|
691
691
|
}
|
|
692
|
-
} else if (process.arch ===
|
|
692
|
+
} else if (process.arch === 'arm') {
|
|
693
693
|
try {
|
|
694
|
-
return require(
|
|
694
|
+
return require('./takeoff-calculator.openharmony-arm.node');
|
|
695
695
|
} catch (e) {
|
|
696
696
|
loadErrors.push(e);
|
|
697
697
|
}
|
|
698
698
|
try {
|
|
699
|
-
const binding = require(
|
|
699
|
+
const binding = require('@build-qube/takeoff-calculator-openharmony-arm');
|
|
700
700
|
const bindingPackageVersion =
|
|
701
|
-
require(
|
|
701
|
+
require('@build-qube/takeoff-calculator-openharmony-arm/package.json').version;
|
|
702
702
|
if (
|
|
703
|
-
bindingPackageVersion !==
|
|
703
|
+
bindingPackageVersion !== '2.2.0' &&
|
|
704
704
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
705
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !==
|
|
705
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
706
706
|
) {
|
|
707
707
|
throw new Error(
|
|
708
|
-
`Native binding package version mismatch, expected 2.0
|
|
708
|
+
`Native binding package version mismatch, expected 2.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
709
709
|
);
|
|
710
710
|
}
|
|
711
711
|
return binding;
|
|
@@ -732,7 +732,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
|
732
732
|
let wasiBinding = null;
|
|
733
733
|
let wasiBindingError = null;
|
|
734
734
|
try {
|
|
735
|
-
wasiBinding = require(
|
|
735
|
+
wasiBinding = require('./takeoff-calculator.wasi.cjs');
|
|
736
736
|
nativeBinding = wasiBinding;
|
|
737
737
|
} catch (err) {
|
|
738
738
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
@@ -741,7 +741,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
|
741
741
|
}
|
|
742
742
|
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
743
743
|
try {
|
|
744
|
-
wasiBinding = require(
|
|
744
|
+
wasiBinding = require('@build-qube/takeoff-calculator-wasm32-wasi');
|
|
745
745
|
nativeBinding = wasiBinding;
|
|
746
746
|
} catch (err) {
|
|
747
747
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
@@ -754,9 +754,9 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
|
-
if (process.env.NAPI_RS_FORCE_WASI ===
|
|
757
|
+
if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
|
|
758
758
|
const error = new Error(
|
|
759
|
-
|
|
759
|
+
'WASI binding not found and NAPI_RS_FORCE_WASI is set to error',
|
|
760
760
|
);
|
|
761
761
|
error.cause = wasiBindingError;
|
|
762
762
|
throw error;
|
|
@@ -768,7 +768,7 @@ if (!nativeBinding) {
|
|
|
768
768
|
throw new Error(
|
|
769
769
|
`Cannot find native binding. ` +
|
|
770
770
|
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
|
|
771
|
-
|
|
771
|
+
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
|
|
772
772
|
{
|
|
773
773
|
cause: loadErrors.reduce((err, cur) => {
|
|
774
774
|
cur.cause = err;
|
|
@@ -781,12 +781,20 @@ if (!nativeBinding) {
|
|
|
781
781
|
}
|
|
782
782
|
|
|
783
783
|
module.exports = nativeBinding;
|
|
784
|
+
module.exports.ContourWrapper = nativeBinding.ContourWrapper;
|
|
784
785
|
module.exports.GroupWrapper = nativeBinding.GroupWrapper;
|
|
785
786
|
module.exports.MeasurementWrapper = nativeBinding.MeasurementWrapper;
|
|
786
787
|
module.exports.TakeoffStateHandler = nativeBinding.TakeoffStateHandler;
|
|
788
|
+
module.exports.VolumetricUnitResult = nativeBinding.VolumetricUnitResult;
|
|
787
789
|
module.exports.plus100 = nativeBinding.plus100;
|
|
790
|
+
module.exports.plus200 = nativeBinding.plus200;
|
|
788
791
|
module.exports.UnitValue = nativeBinding.UnitValue;
|
|
792
|
+
module.exports.distance = nativeBinding.distance;
|
|
793
|
+
module.exports.generateRandomId = nativeBinding.generateRandomId;
|
|
794
|
+
module.exports.getCentroid = nativeBinding.getCentroid;
|
|
789
795
|
module.exports.MeasurementType = nativeBinding.MeasurementType;
|
|
796
|
+
module.exports.repositionMeasurementToCentroid =
|
|
797
|
+
nativeBinding.repositionMeasurementToCentroid;
|
|
790
798
|
module.exports.simplifyPolyline = nativeBinding.simplifyPolyline;
|
|
791
799
|
module.exports.Unit = nativeBinding.Unit;
|
|
792
800
|
module.exports.UnitValueItemType = nativeBinding.UnitValueItemType;
|