@ohos-rs/oxk 0.7.0 → 0.7.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/index.js +235 -76
- package/oxlint-runtime/plugins.cjs +1 -1
- package/package.json +15 -15
package/index.js
CHANGED
|
@@ -63,7 +63,7 @@ const isMuslFromChildProcess = () => {
|
|
|
63
63
|
function requireNative() {
|
|
64
64
|
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
65
65
|
try {
|
|
66
|
-
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)
|
|
66
|
+
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)
|
|
67
67
|
} catch (err) {
|
|
68
68
|
loadErrors.push(err)
|
|
69
69
|
}
|
|
@@ -77,8 +77,14 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@ohos-rs/oxk-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@ohos-rs/oxk-android-arm64/package.json').version
|
|
80
|
-
if (
|
|
81
|
-
|
|
80
|
+
if (
|
|
81
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
82
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
83
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
84
|
+
) {
|
|
85
|
+
throw new Error(
|
|
86
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
87
|
+
)
|
|
82
88
|
}
|
|
83
89
|
return binding
|
|
84
90
|
} catch (e) {
|
|
@@ -93,8 +99,14 @@ function requireNative() {
|
|
|
93
99
|
try {
|
|
94
100
|
const binding = require('@ohos-rs/oxk-android-arm-eabi')
|
|
95
101
|
const bindingPackageVersion = require('@ohos-rs/oxk-android-arm-eabi/package.json').version
|
|
96
|
-
if (
|
|
97
|
-
|
|
102
|
+
if (
|
|
103
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
104
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
105
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
106
|
+
) {
|
|
107
|
+
throw new Error(
|
|
108
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
109
|
+
)
|
|
98
110
|
}
|
|
99
111
|
return binding
|
|
100
112
|
} catch (e) {
|
|
@@ -105,38 +117,53 @@ function requireNative() {
|
|
|
105
117
|
}
|
|
106
118
|
} else if (process.platform === 'win32') {
|
|
107
119
|
if (process.arch === 'x64') {
|
|
108
|
-
if (
|
|
120
|
+
if (
|
|
121
|
+
process.config?.variables?.shlib_suffix === 'dll.a' ||
|
|
122
|
+
process.config?.variables?.node_target_type === 'shared_library'
|
|
123
|
+
) {
|
|
109
124
|
try {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
125
|
+
return require('./oxk.win32-x64-gnu.node')
|
|
126
|
+
} catch (e) {
|
|
127
|
+
loadErrors.push(e)
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
const binding = require('@ohos-rs/oxk-win32-x64-gnu')
|
|
131
|
+
const bindingPackageVersion = require('@ohos-rs/oxk-win32-x64-gnu/package.json').version
|
|
132
|
+
if (
|
|
133
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
134
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
135
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
136
|
+
) {
|
|
137
|
+
throw new Error(
|
|
138
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
return binding
|
|
142
|
+
} catch (e) {
|
|
143
|
+
loadErrors.push(e)
|
|
119
144
|
}
|
|
120
|
-
return binding
|
|
121
|
-
} catch (e) {
|
|
122
|
-
loadErrors.push(e)
|
|
123
|
-
}
|
|
124
145
|
} else {
|
|
125
146
|
try {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
147
|
+
return require('./oxk.win32-x64-msvc.node')
|
|
148
|
+
} catch (e) {
|
|
149
|
+
loadErrors.push(e)
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
const binding = require('@ohos-rs/oxk-win32-x64-msvc')
|
|
153
|
+
const bindingPackageVersion = require('@ohos-rs/oxk-win32-x64-msvc/package.json').version
|
|
154
|
+
if (
|
|
155
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
156
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
157
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
158
|
+
) {
|
|
159
|
+
throw new Error(
|
|
160
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
return binding
|
|
164
|
+
} catch (e) {
|
|
165
|
+
loadErrors.push(e)
|
|
135
166
|
}
|
|
136
|
-
return binding
|
|
137
|
-
} catch (e) {
|
|
138
|
-
loadErrors.push(e)
|
|
139
|
-
}
|
|
140
167
|
}
|
|
141
168
|
} else if (process.arch === 'ia32') {
|
|
142
169
|
try {
|
|
@@ -147,8 +174,14 @@ function requireNative() {
|
|
|
147
174
|
try {
|
|
148
175
|
const binding = require('@ohos-rs/oxk-win32-ia32-msvc')
|
|
149
176
|
const bindingPackageVersion = require('@ohos-rs/oxk-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (
|
|
151
|
-
|
|
177
|
+
if (
|
|
178
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
179
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
180
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
181
|
+
) {
|
|
182
|
+
throw new Error(
|
|
183
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
184
|
+
)
|
|
152
185
|
}
|
|
153
186
|
return binding
|
|
154
187
|
} catch (e) {
|
|
@@ -163,8 +196,14 @@ function requireNative() {
|
|
|
163
196
|
try {
|
|
164
197
|
const binding = require('@ohos-rs/oxk-win32-arm64-msvc')
|
|
165
198
|
const bindingPackageVersion = require('@ohos-rs/oxk-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (
|
|
167
|
-
|
|
199
|
+
if (
|
|
200
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
201
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
202
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
203
|
+
) {
|
|
204
|
+
throw new Error(
|
|
205
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
206
|
+
)
|
|
168
207
|
}
|
|
169
208
|
return binding
|
|
170
209
|
} catch (e) {
|
|
@@ -182,8 +221,14 @@ function requireNative() {
|
|
|
182
221
|
try {
|
|
183
222
|
const binding = require('@ohos-rs/oxk-darwin-universal')
|
|
184
223
|
const bindingPackageVersion = require('@ohos-rs/oxk-darwin-universal/package.json').version
|
|
185
|
-
if (
|
|
186
|
-
|
|
224
|
+
if (
|
|
225
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
226
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
227
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
228
|
+
) {
|
|
229
|
+
throw new Error(
|
|
230
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
231
|
+
)
|
|
187
232
|
}
|
|
188
233
|
return binding
|
|
189
234
|
} catch (e) {
|
|
@@ -198,8 +243,14 @@ function requireNative() {
|
|
|
198
243
|
try {
|
|
199
244
|
const binding = require('@ohos-rs/oxk-darwin-x64')
|
|
200
245
|
const bindingPackageVersion = require('@ohos-rs/oxk-darwin-x64/package.json').version
|
|
201
|
-
if (
|
|
202
|
-
|
|
246
|
+
if (
|
|
247
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
248
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
249
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
250
|
+
) {
|
|
251
|
+
throw new Error(
|
|
252
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
253
|
+
)
|
|
203
254
|
}
|
|
204
255
|
return binding
|
|
205
256
|
} catch (e) {
|
|
@@ -214,8 +265,14 @@ function requireNative() {
|
|
|
214
265
|
try {
|
|
215
266
|
const binding = require('@ohos-rs/oxk-darwin-arm64')
|
|
216
267
|
const bindingPackageVersion = require('@ohos-rs/oxk-darwin-arm64/package.json').version
|
|
217
|
-
if (
|
|
218
|
-
|
|
268
|
+
if (
|
|
269
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
270
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
271
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
272
|
+
) {
|
|
273
|
+
throw new Error(
|
|
274
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
275
|
+
)
|
|
219
276
|
}
|
|
220
277
|
return binding
|
|
221
278
|
} catch (e) {
|
|
@@ -234,8 +291,14 @@ function requireNative() {
|
|
|
234
291
|
try {
|
|
235
292
|
const binding = require('@ohos-rs/oxk-freebsd-x64')
|
|
236
293
|
const bindingPackageVersion = require('@ohos-rs/oxk-freebsd-x64/package.json').version
|
|
237
|
-
if (
|
|
238
|
-
|
|
294
|
+
if (
|
|
295
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
296
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
297
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
298
|
+
) {
|
|
299
|
+
throw new Error(
|
|
300
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
301
|
+
)
|
|
239
302
|
}
|
|
240
303
|
return binding
|
|
241
304
|
} catch (e) {
|
|
@@ -250,8 +313,14 @@ function requireNative() {
|
|
|
250
313
|
try {
|
|
251
314
|
const binding = require('@ohos-rs/oxk-freebsd-arm64')
|
|
252
315
|
const bindingPackageVersion = require('@ohos-rs/oxk-freebsd-arm64/package.json').version
|
|
253
|
-
if (
|
|
254
|
-
|
|
316
|
+
if (
|
|
317
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
318
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
319
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
320
|
+
) {
|
|
321
|
+
throw new Error(
|
|
322
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
323
|
+
)
|
|
255
324
|
}
|
|
256
325
|
return binding
|
|
257
326
|
} catch (e) {
|
|
@@ -271,8 +340,14 @@ function requireNative() {
|
|
|
271
340
|
try {
|
|
272
341
|
const binding = require('@ohos-rs/oxk-linux-x64-musl')
|
|
273
342
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-x64-musl/package.json').version
|
|
274
|
-
if (
|
|
275
|
-
|
|
343
|
+
if (
|
|
344
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
345
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
346
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
347
|
+
) {
|
|
348
|
+
throw new Error(
|
|
349
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
350
|
+
)
|
|
276
351
|
}
|
|
277
352
|
return binding
|
|
278
353
|
} catch (e) {
|
|
@@ -287,8 +362,14 @@ function requireNative() {
|
|
|
287
362
|
try {
|
|
288
363
|
const binding = require('@ohos-rs/oxk-linux-x64-gnu')
|
|
289
364
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-x64-gnu/package.json').version
|
|
290
|
-
if (
|
|
291
|
-
|
|
365
|
+
if (
|
|
366
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
367
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
368
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
369
|
+
) {
|
|
370
|
+
throw new Error(
|
|
371
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
372
|
+
)
|
|
292
373
|
}
|
|
293
374
|
return binding
|
|
294
375
|
} catch (e) {
|
|
@@ -305,8 +386,14 @@ function requireNative() {
|
|
|
305
386
|
try {
|
|
306
387
|
const binding = require('@ohos-rs/oxk-linux-arm64-musl')
|
|
307
388
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-arm64-musl/package.json').version
|
|
308
|
-
if (
|
|
309
|
-
|
|
389
|
+
if (
|
|
390
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
391
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
392
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
393
|
+
) {
|
|
394
|
+
throw new Error(
|
|
395
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
396
|
+
)
|
|
310
397
|
}
|
|
311
398
|
return binding
|
|
312
399
|
} catch (e) {
|
|
@@ -321,8 +408,14 @@ function requireNative() {
|
|
|
321
408
|
try {
|
|
322
409
|
const binding = require('@ohos-rs/oxk-linux-arm64-gnu')
|
|
323
410
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (
|
|
325
|
-
|
|
411
|
+
if (
|
|
412
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
413
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
414
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
415
|
+
) {
|
|
416
|
+
throw new Error(
|
|
417
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
418
|
+
)
|
|
326
419
|
}
|
|
327
420
|
return binding
|
|
328
421
|
} catch (e) {
|
|
@@ -339,8 +432,14 @@ function requireNative() {
|
|
|
339
432
|
try {
|
|
340
433
|
const binding = require('@ohos-rs/oxk-linux-arm-musleabihf')
|
|
341
434
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (
|
|
343
|
-
|
|
435
|
+
if (
|
|
436
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
437
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
438
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
439
|
+
) {
|
|
440
|
+
throw new Error(
|
|
441
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
442
|
+
)
|
|
344
443
|
}
|
|
345
444
|
return binding
|
|
346
445
|
} catch (e) {
|
|
@@ -355,8 +454,14 @@ function requireNative() {
|
|
|
355
454
|
try {
|
|
356
455
|
const binding = require('@ohos-rs/oxk-linux-arm-gnueabihf')
|
|
357
456
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (
|
|
359
|
-
|
|
457
|
+
if (
|
|
458
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
459
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
460
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
461
|
+
) {
|
|
462
|
+
throw new Error(
|
|
463
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
464
|
+
)
|
|
360
465
|
}
|
|
361
466
|
return binding
|
|
362
467
|
} catch (e) {
|
|
@@ -373,8 +478,14 @@ function requireNative() {
|
|
|
373
478
|
try {
|
|
374
479
|
const binding = require('@ohos-rs/oxk-linux-loong64-musl')
|
|
375
480
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-loong64-musl/package.json').version
|
|
376
|
-
if (
|
|
377
|
-
|
|
481
|
+
if (
|
|
482
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
483
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
484
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
485
|
+
) {
|
|
486
|
+
throw new Error(
|
|
487
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
488
|
+
)
|
|
378
489
|
}
|
|
379
490
|
return binding
|
|
380
491
|
} catch (e) {
|
|
@@ -389,8 +500,14 @@ function requireNative() {
|
|
|
389
500
|
try {
|
|
390
501
|
const binding = require('@ohos-rs/oxk-linux-loong64-gnu')
|
|
391
502
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (
|
|
393
|
-
|
|
503
|
+
if (
|
|
504
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
505
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
506
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
507
|
+
) {
|
|
508
|
+
throw new Error(
|
|
509
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
510
|
+
)
|
|
394
511
|
}
|
|
395
512
|
return binding
|
|
396
513
|
} catch (e) {
|
|
@@ -407,8 +524,14 @@ function requireNative() {
|
|
|
407
524
|
try {
|
|
408
525
|
const binding = require('@ohos-rs/oxk-linux-riscv64-musl')
|
|
409
526
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (
|
|
411
|
-
|
|
527
|
+
if (
|
|
528
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
529
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
530
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
531
|
+
) {
|
|
532
|
+
throw new Error(
|
|
533
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
534
|
+
)
|
|
412
535
|
}
|
|
413
536
|
return binding
|
|
414
537
|
} catch (e) {
|
|
@@ -423,8 +546,14 @@ function requireNative() {
|
|
|
423
546
|
try {
|
|
424
547
|
const binding = require('@ohos-rs/oxk-linux-riscv64-gnu')
|
|
425
548
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (
|
|
427
|
-
|
|
549
|
+
if (
|
|
550
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
551
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
552
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
553
|
+
) {
|
|
554
|
+
throw new Error(
|
|
555
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
556
|
+
)
|
|
428
557
|
}
|
|
429
558
|
return binding
|
|
430
559
|
} catch (e) {
|
|
@@ -440,8 +569,14 @@ function requireNative() {
|
|
|
440
569
|
try {
|
|
441
570
|
const binding = require('@ohos-rs/oxk-linux-ppc64-gnu')
|
|
442
571
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (
|
|
444
|
-
|
|
572
|
+
if (
|
|
573
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
574
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
575
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
576
|
+
) {
|
|
577
|
+
throw new Error(
|
|
578
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
579
|
+
)
|
|
445
580
|
}
|
|
446
581
|
return binding
|
|
447
582
|
} catch (e) {
|
|
@@ -456,8 +591,14 @@ function requireNative() {
|
|
|
456
591
|
try {
|
|
457
592
|
const binding = require('@ohos-rs/oxk-linux-s390x-gnu')
|
|
458
593
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (
|
|
460
|
-
|
|
594
|
+
if (
|
|
595
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
596
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
597
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
598
|
+
) {
|
|
599
|
+
throw new Error(
|
|
600
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
601
|
+
)
|
|
461
602
|
}
|
|
462
603
|
return binding
|
|
463
604
|
} catch (e) {
|
|
@@ -476,8 +617,14 @@ function requireNative() {
|
|
|
476
617
|
try {
|
|
477
618
|
const binding = require('@ohos-rs/oxk-openharmony-arm64')
|
|
478
619
|
const bindingPackageVersion = require('@ohos-rs/oxk-openharmony-arm64/package.json').version
|
|
479
|
-
if (
|
|
480
|
-
|
|
620
|
+
if (
|
|
621
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
622
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
623
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
624
|
+
) {
|
|
625
|
+
throw new Error(
|
|
626
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
627
|
+
)
|
|
481
628
|
}
|
|
482
629
|
return binding
|
|
483
630
|
} catch (e) {
|
|
@@ -492,8 +639,14 @@ function requireNative() {
|
|
|
492
639
|
try {
|
|
493
640
|
const binding = require('@ohos-rs/oxk-openharmony-x64')
|
|
494
641
|
const bindingPackageVersion = require('@ohos-rs/oxk-openharmony-x64/package.json').version
|
|
495
|
-
if (
|
|
496
|
-
|
|
642
|
+
if (
|
|
643
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
644
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
645
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
646
|
+
) {
|
|
647
|
+
throw new Error(
|
|
648
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
649
|
+
)
|
|
497
650
|
}
|
|
498
651
|
return binding
|
|
499
652
|
} catch (e) {
|
|
@@ -508,8 +661,14 @@ function requireNative() {
|
|
|
508
661
|
try {
|
|
509
662
|
const binding = require('@ohos-rs/oxk-openharmony-arm')
|
|
510
663
|
const bindingPackageVersion = require('@ohos-rs/oxk-openharmony-arm/package.json').version
|
|
511
|
-
if (
|
|
512
|
-
|
|
664
|
+
if (
|
|
665
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
666
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
667
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
668
|
+
) {
|
|
669
|
+
throw new Error(
|
|
670
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
671
|
+
)
|
|
513
672
|
}
|
|
514
673
|
return binding
|
|
515
674
|
} catch (e) {
|