@fast-down/fast-down 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/index.js +55 -74
  2. package/package.json +14 -14
package/index.js CHANGED
@@ -3,6 +3,9 @@
3
3
  // @ts-nocheck
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
+ const { createRequire } = require('node:module')
7
+ require = createRequire(__filename)
8
+
6
9
  const { readFileSync } = require('node:fs')
7
10
  let nativeBinding = null
8
11
  const loadErrors = []
@@ -77,8 +80,8 @@ function requireNative() {
77
80
  try {
78
81
  const binding = require('@fast-down/fast-down-android-arm64')
79
82
  const bindingPackageVersion = require('@fast-down/fast-down-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
83
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
84
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
85
  }
83
86
  return binding
84
87
  } catch (e) {
@@ -93,8 +96,8 @@ function requireNative() {
93
96
  try {
94
97
  const binding = require('@fast-down/fast-down-android-arm-eabi')
95
98
  const bindingPackageVersion = require('@fast-down/fast-down-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
99
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
100
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
101
  }
99
102
  return binding
100
103
  } catch (e) {
@@ -105,24 +108,7 @@ function requireNative() {
105
108
  }
106
109
  } else if (process.platform === 'win32') {
107
110
  if (process.arch === 'x64') {
108
- if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
109
- try {
110
- return require('./fast-down.win32-x64-gnu.node')
111
- } catch (e) {
112
- loadErrors.push(e)
113
- }
114
111
  try {
115
- const binding = require('@fast-down/fast-down-win32-x64-gnu')
116
- const bindingPackageVersion = require('@fast-down/fast-down-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
- }
120
- return binding
121
- } catch (e) {
122
- loadErrors.push(e)
123
- }
124
- } else {
125
- try {
126
112
  return require('./fast-down.win32-x64-msvc.node')
127
113
  } catch (e) {
128
114
  loadErrors.push(e)
@@ -130,14 +116,13 @@ function requireNative() {
130
116
  try {
131
117
  const binding = require('@fast-down/fast-down-win32-x64-msvc')
132
118
  const bindingPackageVersion = require('@fast-down/fast-down-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
120
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
121
  }
136
122
  return binding
137
123
  } catch (e) {
138
124
  loadErrors.push(e)
139
125
  }
140
- }
141
126
  } else if (process.arch === 'ia32') {
142
127
  try {
143
128
  return require('./fast-down.win32-ia32-msvc.node')
@@ -147,8 +132,8 @@ function requireNative() {
147
132
  try {
148
133
  const binding = require('@fast-down/fast-down-win32-ia32-msvc')
149
134
  const bindingPackageVersion = require('@fast-down/fast-down-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
136
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
137
  }
153
138
  return binding
154
139
  } catch (e) {
@@ -163,8 +148,8 @@ function requireNative() {
163
148
  try {
164
149
  const binding = require('@fast-down/fast-down-win32-arm64-msvc')
165
150
  const bindingPackageVersion = require('@fast-down/fast-down-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
151
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
152
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
153
  }
169
154
  return binding
170
155
  } catch (e) {
@@ -182,8 +167,8 @@ function requireNative() {
182
167
  try {
183
168
  const binding = require('@fast-down/fast-down-darwin-universal')
184
169
  const bindingPackageVersion = require('@fast-down/fast-down-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
170
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
172
  }
188
173
  return binding
189
174
  } catch (e) {
@@ -198,8 +183,8 @@ function requireNative() {
198
183
  try {
199
184
  const binding = require('@fast-down/fast-down-darwin-x64')
200
185
  const bindingPackageVersion = require('@fast-down/fast-down-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
186
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
187
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
188
  }
204
189
  return binding
205
190
  } catch (e) {
@@ -214,8 +199,8 @@ function requireNative() {
214
199
  try {
215
200
  const binding = require('@fast-down/fast-down-darwin-arm64')
216
201
  const bindingPackageVersion = require('@fast-down/fast-down-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
202
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
203
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
204
  }
220
205
  return binding
221
206
  } catch (e) {
@@ -234,8 +219,8 @@ function requireNative() {
234
219
  try {
235
220
  const binding = require('@fast-down/fast-down-freebsd-x64')
236
221
  const bindingPackageVersion = require('@fast-down/fast-down-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
222
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
223
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
224
  }
240
225
  return binding
241
226
  } catch (e) {
@@ -250,8 +235,8 @@ function requireNative() {
250
235
  try {
251
236
  const binding = require('@fast-down/fast-down-freebsd-arm64')
252
237
  const bindingPackageVersion = require('@fast-down/fast-down-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
238
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
239
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
240
  }
256
241
  return binding
257
242
  } catch (e) {
@@ -271,8 +256,8 @@ function requireNative() {
271
256
  try {
272
257
  const binding = require('@fast-down/fast-down-linux-x64-musl')
273
258
  const bindingPackageVersion = require('@fast-down/fast-down-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
259
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
260
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
261
  }
277
262
  return binding
278
263
  } catch (e) {
@@ -287,8 +272,8 @@ function requireNative() {
287
272
  try {
288
273
  const binding = require('@fast-down/fast-down-linux-x64-gnu')
289
274
  const bindingPackageVersion = require('@fast-down/fast-down-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
275
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
276
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
277
  }
293
278
  return binding
294
279
  } catch (e) {
@@ -305,8 +290,8 @@ function requireNative() {
305
290
  try {
306
291
  const binding = require('@fast-down/fast-down-linux-arm64-musl')
307
292
  const bindingPackageVersion = require('@fast-down/fast-down-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
293
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
294
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
295
  }
311
296
  return binding
312
297
  } catch (e) {
@@ -321,8 +306,8 @@ function requireNative() {
321
306
  try {
322
307
  const binding = require('@fast-down/fast-down-linux-arm64-gnu')
323
308
  const bindingPackageVersion = require('@fast-down/fast-down-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
309
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
310
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
311
  }
327
312
  return binding
328
313
  } catch (e) {
@@ -339,8 +324,8 @@ function requireNative() {
339
324
  try {
340
325
  const binding = require('@fast-down/fast-down-linux-arm-musleabihf')
341
326
  const bindingPackageVersion = require('@fast-down/fast-down-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
327
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
328
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
329
  }
345
330
  return binding
346
331
  } catch (e) {
@@ -355,8 +340,8 @@ function requireNative() {
355
340
  try {
356
341
  const binding = require('@fast-down/fast-down-linux-arm-gnueabihf')
357
342
  const bindingPackageVersion = require('@fast-down/fast-down-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
343
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
344
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
345
  }
361
346
  return binding
362
347
  } catch (e) {
@@ -373,8 +358,8 @@ function requireNative() {
373
358
  try {
374
359
  const binding = require('@fast-down/fast-down-linux-loong64-musl')
375
360
  const bindingPackageVersion = require('@fast-down/fast-down-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
361
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
362
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
363
  }
379
364
  return binding
380
365
  } catch (e) {
@@ -389,8 +374,8 @@ function requireNative() {
389
374
  try {
390
375
  const binding = require('@fast-down/fast-down-linux-loong64-gnu')
391
376
  const bindingPackageVersion = require('@fast-down/fast-down-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
377
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
378
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
379
  }
395
380
  return binding
396
381
  } catch (e) {
@@ -407,8 +392,8 @@ function requireNative() {
407
392
  try {
408
393
  const binding = require('@fast-down/fast-down-linux-riscv64-musl')
409
394
  const bindingPackageVersion = require('@fast-down/fast-down-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
395
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
396
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
397
  }
413
398
  return binding
414
399
  } catch (e) {
@@ -423,8 +408,8 @@ function requireNative() {
423
408
  try {
424
409
  const binding = require('@fast-down/fast-down-linux-riscv64-gnu')
425
410
  const bindingPackageVersion = require('@fast-down/fast-down-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
411
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
412
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
413
  }
429
414
  return binding
430
415
  } catch (e) {
@@ -440,8 +425,8 @@ function requireNative() {
440
425
  try {
441
426
  const binding = require('@fast-down/fast-down-linux-ppc64-gnu')
442
427
  const bindingPackageVersion = require('@fast-down/fast-down-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
429
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
430
  }
446
431
  return binding
447
432
  } catch (e) {
@@ -456,8 +441,8 @@ function requireNative() {
456
441
  try {
457
442
  const binding = require('@fast-down/fast-down-linux-s390x-gnu')
458
443
  const bindingPackageVersion = require('@fast-down/fast-down-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
444
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
445
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
446
  }
462
447
  return binding
463
448
  } catch (e) {
@@ -476,8 +461,8 @@ function requireNative() {
476
461
  try {
477
462
  const binding = require('@fast-down/fast-down-openharmony-arm64')
478
463
  const bindingPackageVersion = require('@fast-down/fast-down-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
464
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
465
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
466
  }
482
467
  return binding
483
468
  } catch (e) {
@@ -492,8 +477,8 @@ function requireNative() {
492
477
  try {
493
478
  const binding = require('@fast-down/fast-down-openharmony-x64')
494
479
  const bindingPackageVersion = require('@fast-down/fast-down-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
480
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
481
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
482
  }
498
483
  return binding
499
484
  } catch (e) {
@@ -508,8 +493,8 @@ function requireNative() {
508
493
  try {
509
494
  const binding = require('@fast-down/fast-down-openharmony-arm')
510
495
  const bindingPackageVersion = require('@fast-down/fast-down-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '1.0.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 1.0.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
496
+ if (bindingPackageVersion !== '1.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
497
+ throw new Error(`Native binding package version mismatch, expected 1.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
498
  }
514
499
  return binding
515
500
  } catch (e) {
@@ -536,17 +521,13 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
536
521
  wasiBindingError = err
537
522
  }
538
523
  }
539
- if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
524
+ if (!nativeBinding) {
540
525
  try {
541
526
  wasiBinding = require('@fast-down/fast-down-wasm32-wasi')
542
527
  nativeBinding = wasiBinding
543
528
  } catch (err) {
544
529
  if (process.env.NAPI_RS_FORCE_WASI) {
545
- if (!wasiBindingError) {
546
- wasiBindingError = err
547
- } else {
548
- wasiBindingError.cause = err
549
- }
530
+ wasiBindingError.cause = err
550
531
  loadErrors.push(err)
551
532
  }
552
533
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fast-down/fast-down",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "fast-down 的 js 接口",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -109,18 +109,18 @@
109
109
  },
110
110
  "packageManager": "yarn@4.12.0",
111
111
  "optionalDependencies": {
112
- "@fast-down/fast-down-win32-x64-msvc": "1.0.2",
113
- "@fast-down/fast-down-darwin-x64": "1.0.2",
114
- "@fast-down/fast-down-linux-x64-gnu": "1.0.2",
115
- "@fast-down/fast-down-linux-x64-musl": "1.0.2",
116
- "@fast-down/fast-down-linux-arm64-gnu": "1.0.2",
117
- "@fast-down/fast-down-win32-ia32-msvc": "1.0.2",
118
- "@fast-down/fast-down-linux-arm-gnueabihf": "1.0.2",
119
- "@fast-down/fast-down-darwin-arm64": "1.0.2",
120
- "@fast-down/fast-down-android-arm64": "1.0.2",
121
- "@fast-down/fast-down-freebsd-x64": "1.0.2",
122
- "@fast-down/fast-down-linux-arm64-musl": "1.0.2",
123
- "@fast-down/fast-down-win32-arm64-msvc": "1.0.2",
124
- "@fast-down/fast-down-android-arm-eabi": "1.0.2"
112
+ "@fast-down/fast-down-win32-x64-msvc": "1.0.3",
113
+ "@fast-down/fast-down-darwin-x64": "1.0.3",
114
+ "@fast-down/fast-down-linux-x64-gnu": "1.0.3",
115
+ "@fast-down/fast-down-linux-x64-musl": "1.0.3",
116
+ "@fast-down/fast-down-linux-arm64-gnu": "1.0.3",
117
+ "@fast-down/fast-down-win32-ia32-msvc": "1.0.3",
118
+ "@fast-down/fast-down-linux-arm-gnueabihf": "1.0.3",
119
+ "@fast-down/fast-down-darwin-arm64": "1.0.3",
120
+ "@fast-down/fast-down-android-arm64": "1.0.3",
121
+ "@fast-down/fast-down-freebsd-x64": "1.0.3",
122
+ "@fast-down/fast-down-linux-arm64-musl": "1.0.3",
123
+ "@fast-down/fast-down-win32-arm64-msvc": "1.0.3",
124
+ "@fast-down/fast-down-android-arm-eabi": "1.0.3"
125
125
  }
126
126
  }