@rush-fs/core 0.1.0-alpha.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/index.js ADDED
@@ -0,0 +1,786 @@
1
+ // prettier-ignore
2
+ /* eslint-disable */
3
+ // @ts-nocheck
4
+ /* auto-generated by NAPI-RS */
5
+
6
+ const { readFileSync } = require('node:fs')
7
+ let nativeBinding = null
8
+ const loadErrors = []
9
+
10
+ const isMusl = () => {
11
+ let musl = false
12
+ if (process.platform === 'linux') {
13
+ musl = isMuslFromFilesystem()
14
+ if (musl === null) {
15
+ musl = isMuslFromReport()
16
+ }
17
+ if (musl === null) {
18
+ musl = isMuslFromChildProcess()
19
+ }
20
+ }
21
+ return musl
22
+ }
23
+
24
+ const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
25
+
26
+ const isMuslFromFilesystem = () => {
27
+ try {
28
+ return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
29
+ } catch {
30
+ return null
31
+ }
32
+ }
33
+
34
+ const isMuslFromReport = () => {
35
+ let report = null
36
+ if (typeof process.report?.getReport === 'function') {
37
+ process.report.excludeNetwork = true
38
+ report = process.report.getReport()
39
+ }
40
+ if (!report) {
41
+ return null
42
+ }
43
+ if (report.header && report.header.glibcVersionRuntime) {
44
+ return false
45
+ }
46
+ if (Array.isArray(report.sharedObjects)) {
47
+ if (report.sharedObjects.some(isFileMusl)) {
48
+ return true
49
+ }
50
+ }
51
+ return false
52
+ }
53
+
54
+ const isMuslFromChildProcess = () => {
55
+ try {
56
+ return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
57
+ } catch (e) {
58
+ // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
59
+ return false
60
+ }
61
+ }
62
+
63
+ function requireNative() {
64
+ if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
65
+ try {
66
+ return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
67
+ } catch (err) {
68
+ loadErrors.push(err)
69
+ }
70
+ } else if (process.platform === 'android') {
71
+ if (process.arch === 'arm64') {
72
+ try {
73
+ return require('./rush-fs.android-arm64.node')
74
+ } catch (e) {
75
+ loadErrors.push(e)
76
+ }
77
+ try {
78
+ const binding = require('@rush-fs/rush-fs-android-arm64')
79
+ const bindingPackageVersion = require('@rush-fs/rush-fs-android-arm64/package.json').version
80
+ if (bindingPackageVersion !== '0.0.5' && 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 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
83
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
84
+ const binding = require('@rush-fs/core-android-arm64')
85
+ const bindingPackageVersion = require('@rush-fs/core-android-arm64/package.json').version
86
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
87
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
88
+ }
89
+ return binding
90
+ } catch (e) {
91
+ loadErrors.push(e)
92
+ }
93
+ } else if (process.arch === 'arm') {
94
+ try {
95
+ return require('./rush-fs.android-arm-eabi.node')
96
+ } catch (e) {
97
+ loadErrors.push(e)
98
+ }
99
+ try {
100
+ const binding = require('@rush-fs/rush-fs-android-arm-eabi')
101
+ const bindingPackageVersion = require('@rush-fs/rush-fs-android-arm-eabi/package.json').version
102
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
103
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
104
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
105
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
106
+ const binding = require('@rush-fs/core-android-arm-eabi')
107
+ const bindingPackageVersion = require('@rush-fs/core-android-arm-eabi/package.json').version
108
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
109
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
110
+ }
111
+ return binding
112
+ } catch (e) {
113
+ loadErrors.push(e)
114
+ }
115
+ } else {
116
+ loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
117
+ }
118
+ } else if (process.platform === 'win32') {
119
+ if (process.arch === 'x64') {
120
+ if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
121
+ try {
122
+ return require('./rush-fs.win32-x64-gnu.node')
123
+ } catch (e) {
124
+ loadErrors.push(e)
125
+ }
126
+ try {
127
+ const binding = require('@rush-fs/rush-fs-win32-x64-gnu')
128
+ const bindingPackageVersion = require('@rush-fs/rush-fs-win32-x64-gnu/package.json').version
129
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
130
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
131
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
132
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ const binding = require('@rush-fs/core-win32-x64-gnu')
134
+ const bindingPackageVersion = require('@rush-fs/core-win32-x64-gnu/package.json').version
135
+ if (bindingPackageVersion !== '0.1.0' && 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 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
137
+ }
138
+ return binding
139
+ } catch (e) {
140
+ loadErrors.push(e)
141
+ }
142
+ } else {
143
+ try {
144
+ return require('./rush-fs.win32-x64-msvc.node')
145
+ } catch (e) {
146
+ loadErrors.push(e)
147
+ }
148
+ try {
149
+ const binding = require('@rush-fs/rush-fs-win32-x64-msvc')
150
+ const bindingPackageVersion = require('@rush-fs/rush-fs-win32-x64-msvc/package.json').version
151
+ if (bindingPackageVersion !== '0.0.5' && 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 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
153
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
154
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
155
+ const binding = require('@rush-fs/core-win32-x64-msvc')
156
+ const bindingPackageVersion = require('@rush-fs/core-win32-x64-msvc/package.json').version
157
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
158
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
159
+ }
160
+ return binding
161
+ } catch (e) {
162
+ loadErrors.push(e)
163
+ }
164
+ }
165
+ } else if (process.arch === 'ia32') {
166
+ try {
167
+ return require('./rush-fs.win32-ia32-msvc.node')
168
+ } catch (e) {
169
+ loadErrors.push(e)
170
+ }
171
+ try {
172
+ const binding = require('@rush-fs/rush-fs-win32-ia32-msvc')
173
+ const bindingPackageVersion = require('@rush-fs/rush-fs-win32-ia32-msvc/package.json').version
174
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
175
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
176
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
177
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
178
+ const binding = require('@rush-fs/core-win32-ia32-msvc')
179
+ const bindingPackageVersion = require('@rush-fs/core-win32-ia32-msvc/package.json').version
180
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
181
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
182
+ }
183
+ return binding
184
+ } catch (e) {
185
+ loadErrors.push(e)
186
+ }
187
+ } else if (process.arch === 'arm64') {
188
+ try {
189
+ return require('./rush-fs.win32-arm64-msvc.node')
190
+ } catch (e) {
191
+ loadErrors.push(e)
192
+ }
193
+ try {
194
+ const binding = require('@rush-fs/rush-fs-win32-arm64-msvc')
195
+ const bindingPackageVersion = require('@rush-fs/rush-fs-win32-arm64-msvc/package.json').version
196
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
197
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
198
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
199
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
200
+ const binding = require('@rush-fs/core-win32-arm64-msvc')
201
+ const bindingPackageVersion = require('@rush-fs/core-win32-arm64-msvc/package.json').version
202
+ if (bindingPackageVersion !== '0.1.0' && 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 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
204
+ }
205
+ return binding
206
+ } catch (e) {
207
+ loadErrors.push(e)
208
+ }
209
+ } else {
210
+ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
211
+ }
212
+ } else if (process.platform === 'darwin') {
213
+ try {
214
+ return require('./rush-fs.darwin-universal.node')
215
+ } catch (e) {
216
+ loadErrors.push(e)
217
+ }
218
+ try {
219
+ const binding = require('@rush-fs/rush-fs-darwin-universal')
220
+ const bindingPackageVersion = require('@rush-fs/rush-fs-darwin-universal/package.json').version
221
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
222
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
223
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
224
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
225
+ const binding = require('@rush-fs/core-darwin-universal')
226
+ const bindingPackageVersion = require('@rush-fs/core-darwin-universal/package.json').version
227
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
228
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
229
+ }
230
+ return binding
231
+ } catch (e) {
232
+ loadErrors.push(e)
233
+ }
234
+ if (process.arch === 'x64') {
235
+ try {
236
+ return require('./rush-fs.darwin-x64.node')
237
+ } catch (e) {
238
+ loadErrors.push(e)
239
+ }
240
+ try {
241
+ const binding = require('@rush-fs/rush-fs-darwin-x64')
242
+ const bindingPackageVersion = require('@rush-fs/rush-fs-darwin-x64/package.json').version
243
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
244
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
245
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
246
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
247
+ const binding = require('@rush-fs/core-darwin-x64')
248
+ const bindingPackageVersion = require('@rush-fs/core-darwin-x64/package.json').version
249
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
250
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
251
+ }
252
+ return binding
253
+ } catch (e) {
254
+ loadErrors.push(e)
255
+ }
256
+ } else if (process.arch === 'arm64') {
257
+ try {
258
+ return require('./rush-fs.darwin-arm64.node')
259
+ } catch (e) {
260
+ loadErrors.push(e)
261
+ }
262
+ try {
263
+ const binding = require('@rush-fs/rush-fs-darwin-arm64')
264
+ const bindingPackageVersion = require('@rush-fs/rush-fs-darwin-arm64/package.json').version
265
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
266
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
267
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
268
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
269
+ const binding = require('@rush-fs/core-darwin-arm64')
270
+ const bindingPackageVersion = require('@rush-fs/core-darwin-arm64/package.json').version
271
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
272
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
273
+ }
274
+ return binding
275
+ } catch (e) {
276
+ loadErrors.push(e)
277
+ }
278
+ } else {
279
+ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
280
+ }
281
+ } else if (process.platform === 'freebsd') {
282
+ if (process.arch === 'x64') {
283
+ try {
284
+ return require('./rush-fs.freebsd-x64.node')
285
+ } catch (e) {
286
+ loadErrors.push(e)
287
+ }
288
+ try {
289
+ const binding = require('@rush-fs/rush-fs-freebsd-x64')
290
+ const bindingPackageVersion = require('@rush-fs/rush-fs-freebsd-x64/package.json').version
291
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
292
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
293
+ if (bindingPackageVersion !== '0.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 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
295
+ const binding = require('@rush-fs/core-freebsd-x64')
296
+ const bindingPackageVersion = require('@rush-fs/core-freebsd-x64/package.json').version
297
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
298
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
299
+ }
300
+ return binding
301
+ } catch (e) {
302
+ loadErrors.push(e)
303
+ }
304
+ } else if (process.arch === 'arm64') {
305
+ try {
306
+ return require('./rush-fs.freebsd-arm64.node')
307
+ } catch (e) {
308
+ loadErrors.push(e)
309
+ }
310
+ try {
311
+ const binding = require('@rush-fs/rush-fs-freebsd-arm64')
312
+ const bindingPackageVersion = require('@rush-fs/rush-fs-freebsd-arm64/package.json').version
313
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
314
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
315
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
316
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
317
+ const binding = require('@rush-fs/core-freebsd-arm64')
318
+ const bindingPackageVersion = require('@rush-fs/core-freebsd-arm64/package.json').version
319
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
320
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
321
+ }
322
+ return binding
323
+ } catch (e) {
324
+ loadErrors.push(e)
325
+ }
326
+ } else {
327
+ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
328
+ }
329
+ } else if (process.platform === 'linux') {
330
+ if (process.arch === 'x64') {
331
+ if (isMusl()) {
332
+ try {
333
+ return require('./rush-fs.linux-x64-musl.node')
334
+ } catch (e) {
335
+ loadErrors.push(e)
336
+ }
337
+ try {
338
+ const binding = require('@rush-fs/rush-fs-linux-x64-musl')
339
+ const bindingPackageVersion = require('@rush-fs/rush-fs-linux-x64-musl/package.json').version
340
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
341
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '0.0.3' && 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 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
+ const binding = require('@rush-fs/core-linux-x64-musl')
345
+ const bindingPackageVersion = require('@rush-fs/core-linux-x64-musl/package.json').version
346
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
347
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
348
+ }
349
+ return binding
350
+ } catch (e) {
351
+ loadErrors.push(e)
352
+ }
353
+ } else {
354
+ try {
355
+ return require('./rush-fs.linux-x64-gnu.node')
356
+ } catch (e) {
357
+ loadErrors.push(e)
358
+ }
359
+ try {
360
+ const binding = require('@rush-fs/rush-fs-linux-x64-gnu')
361
+ const bindingPackageVersion = require('@rush-fs/rush-fs-linux-x64-gnu/package.json').version
362
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
363
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
364
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
365
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
366
+ const binding = require('@rush-fs/core-linux-x64-gnu')
367
+ const bindingPackageVersion = require('@rush-fs/core-linux-x64-gnu/package.json').version
368
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
369
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
370
+ }
371
+ return binding
372
+ } catch (e) {
373
+ loadErrors.push(e)
374
+ }
375
+ }
376
+ } else if (process.arch === 'arm64') {
377
+ if (isMusl()) {
378
+ try {
379
+ return require('./rush-fs.linux-arm64-musl.node')
380
+ } catch (e) {
381
+ loadErrors.push(e)
382
+ }
383
+ try {
384
+ const binding = require('@rush-fs/rush-fs-linux-arm64-musl')
385
+ const bindingPackageVersion = require('@rush-fs/rush-fs-linux-arm64-musl/package.json').version
386
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
387
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
388
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
389
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
390
+ const binding = require('@rush-fs/core-linux-arm64-musl')
391
+ const bindingPackageVersion = require('@rush-fs/core-linux-arm64-musl/package.json').version
392
+ if (bindingPackageVersion !== '0.1.0' && 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 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
+ }
395
+ return binding
396
+ } catch (e) {
397
+ loadErrors.push(e)
398
+ }
399
+ } else {
400
+ try {
401
+ return require('./rush-fs.linux-arm64-gnu.node')
402
+ } catch (e) {
403
+ loadErrors.push(e)
404
+ }
405
+ try {
406
+ const binding = require('@rush-fs/rush-fs-linux-arm64-gnu')
407
+ const bindingPackageVersion = require('@rush-fs/rush-fs-linux-arm64-gnu/package.json').version
408
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
409
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '0.0.3' && 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 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
+ const binding = require('@rush-fs/core-linux-arm64-gnu')
413
+ const bindingPackageVersion = require('@rush-fs/core-linux-arm64-gnu/package.json').version
414
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
415
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
416
+ }
417
+ return binding
418
+ } catch (e) {
419
+ loadErrors.push(e)
420
+ }
421
+ }
422
+ } else if (process.arch === 'arm') {
423
+ if (isMusl()) {
424
+ try {
425
+ return require('./rush-fs.linux-arm-musleabihf.node')
426
+ } catch (e) {
427
+ loadErrors.push(e)
428
+ }
429
+ try {
430
+ const binding = require('@rush-fs/rush-fs-linux-arm-musleabihf')
431
+ const bindingPackageVersion = require('@rush-fs/rush-fs-linux-arm-musleabihf/package.json').version
432
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
433
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
434
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
435
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
436
+ const binding = require('@rush-fs/core-linux-arm-musleabihf')
437
+ const bindingPackageVersion = require('@rush-fs/core-linux-arm-musleabihf/package.json').version
438
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
439
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
440
+ }
441
+ return binding
442
+ } catch (e) {
443
+ loadErrors.push(e)
444
+ }
445
+ } else {
446
+ try {
447
+ return require('./rush-fs.linux-arm-gnueabihf.node')
448
+ } catch (e) {
449
+ loadErrors.push(e)
450
+ }
451
+ try {
452
+ const binding = require('@rush-fs/rush-fs-linux-arm-gnueabihf')
453
+ const bindingPackageVersion = require('@rush-fs/rush-fs-linux-arm-gnueabihf/package.json').version
454
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
455
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
456
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
457
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
458
+ const binding = require('@rush-fs/core-linux-arm-gnueabihf')
459
+ const bindingPackageVersion = require('@rush-fs/core-linux-arm-gnueabihf/package.json').version
460
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
461
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
462
+ }
463
+ return binding
464
+ } catch (e) {
465
+ loadErrors.push(e)
466
+ }
467
+ }
468
+ } else if (process.arch === 'loong64') {
469
+ if (isMusl()) {
470
+ try {
471
+ return require('./rush-fs.linux-loong64-musl.node')
472
+ } catch (e) {
473
+ loadErrors.push(e)
474
+ }
475
+ try {
476
+ const binding = require('@rush-fs/rush-fs-linux-loong64-musl')
477
+ const bindingPackageVersion = require('@rush-fs/rush-fs-linux-loong64-musl/package.json').version
478
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
479
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
480
+ if (bindingPackageVersion !== '0.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 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
482
+ const binding = require('@rush-fs/core-linux-loong64-musl')
483
+ const bindingPackageVersion = require('@rush-fs/core-linux-loong64-musl/package.json').version
484
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
485
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
486
+ }
487
+ return binding
488
+ } catch (e) {
489
+ loadErrors.push(e)
490
+ }
491
+ } else {
492
+ try {
493
+ return require('./rush-fs.linux-loong64-gnu.node')
494
+ } catch (e) {
495
+ loadErrors.push(e)
496
+ }
497
+ try {
498
+ const binding = require('@rush-fs/rush-fs-linux-loong64-gnu')
499
+ const bindingPackageVersion = require('@rush-fs/rush-fs-linux-loong64-gnu/package.json').version
500
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
501
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
502
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
503
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
504
+ const binding = require('@rush-fs/core-linux-loong64-gnu')
505
+ const bindingPackageVersion = require('@rush-fs/core-linux-loong64-gnu/package.json').version
506
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
507
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
508
+ }
509
+ return binding
510
+ } catch (e) {
511
+ loadErrors.push(e)
512
+ }
513
+ }
514
+ } else if (process.arch === 'riscv64') {
515
+ if (isMusl()) {
516
+ try {
517
+ return require('./rush-fs.linux-riscv64-musl.node')
518
+ } catch (e) {
519
+ loadErrors.push(e)
520
+ }
521
+ try {
522
+ const binding = require('@rush-fs/rush-fs-linux-riscv64-musl')
523
+ const bindingPackageVersion = require('@rush-fs/rush-fs-linux-riscv64-musl/package.json').version
524
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
525
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
526
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
527
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
528
+ const binding = require('@rush-fs/core-linux-riscv64-musl')
529
+ const bindingPackageVersion = require('@rush-fs/core-linux-riscv64-musl/package.json').version
530
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
531
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
532
+ }
533
+ return binding
534
+ } catch (e) {
535
+ loadErrors.push(e)
536
+ }
537
+ } else {
538
+ try {
539
+ return require('./rush-fs.linux-riscv64-gnu.node')
540
+ } catch (e) {
541
+ loadErrors.push(e)
542
+ }
543
+ try {
544
+ const binding = require('@rush-fs/rush-fs-linux-riscv64-gnu')
545
+ const bindingPackageVersion = require('@rush-fs/rush-fs-linux-riscv64-gnu/package.json').version
546
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
547
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
548
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
549
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
550
+ const binding = require('@rush-fs/core-linux-riscv64-gnu')
551
+ const bindingPackageVersion = require('@rush-fs/core-linux-riscv64-gnu/package.json').version
552
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
553
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
554
+ }
555
+ return binding
556
+ } catch (e) {
557
+ loadErrors.push(e)
558
+ }
559
+ }
560
+ } else if (process.arch === 'ppc64') {
561
+ try {
562
+ return require('./rush-fs.linux-ppc64-gnu.node')
563
+ } catch (e) {
564
+ loadErrors.push(e)
565
+ }
566
+ try {
567
+ const binding = require('@rush-fs/rush-fs-linux-ppc64-gnu')
568
+ const bindingPackageVersion = require('@rush-fs/rush-fs-linux-ppc64-gnu/package.json').version
569
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
570
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
571
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
572
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
573
+ const binding = require('@rush-fs/core-linux-ppc64-gnu')
574
+ const bindingPackageVersion = require('@rush-fs/core-linux-ppc64-gnu/package.json').version
575
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
576
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
577
+ }
578
+ return binding
579
+ } catch (e) {
580
+ loadErrors.push(e)
581
+ }
582
+ } else if (process.arch === 's390x') {
583
+ try {
584
+ return require('./rush-fs.linux-s390x-gnu.node')
585
+ } catch (e) {
586
+ loadErrors.push(e)
587
+ }
588
+ try {
589
+ const binding = require('@rush-fs/rush-fs-linux-s390x-gnu')
590
+ const bindingPackageVersion = require('@rush-fs/rush-fs-linux-s390x-gnu/package.json').version
591
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
592
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
593
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
594
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
595
+ const binding = require('@rush-fs/core-linux-s390x-gnu')
596
+ const bindingPackageVersion = require('@rush-fs/core-linux-s390x-gnu/package.json').version
597
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
598
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
599
+ }
600
+ return binding
601
+ } catch (e) {
602
+ loadErrors.push(e)
603
+ }
604
+ } else {
605
+ loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
606
+ }
607
+ } else if (process.platform === 'openharmony') {
608
+ if (process.arch === 'arm64') {
609
+ try {
610
+ return require('./rush-fs.openharmony-arm64.node')
611
+ } catch (e) {
612
+ loadErrors.push(e)
613
+ }
614
+ try {
615
+ const binding = require('@rush-fs/rush-fs-openharmony-arm64')
616
+ const bindingPackageVersion = require('@rush-fs/rush-fs-openharmony-arm64/package.json').version
617
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
618
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
619
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
620
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
621
+ const binding = require('@rush-fs/core-openharmony-arm64')
622
+ const bindingPackageVersion = require('@rush-fs/core-openharmony-arm64/package.json').version
623
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
624
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
625
+ }
626
+ return binding
627
+ } catch (e) {
628
+ loadErrors.push(e)
629
+ }
630
+ } else if (process.arch === 'x64') {
631
+ try {
632
+ return require('./rush-fs.openharmony-x64.node')
633
+ } catch (e) {
634
+ loadErrors.push(e)
635
+ }
636
+ try {
637
+ const binding = require('@rush-fs/rush-fs-openharmony-x64')
638
+ const bindingPackageVersion = require('@rush-fs/rush-fs-openharmony-x64/package.json').version
639
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
640
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
641
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
642
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
643
+ const binding = require('@rush-fs/core-openharmony-x64')
644
+ const bindingPackageVersion = require('@rush-fs/core-openharmony-x64/package.json').version
645
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
646
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
647
+ }
648
+ return binding
649
+ } catch (e) {
650
+ loadErrors.push(e)
651
+ }
652
+ } else if (process.arch === 'arm') {
653
+ try {
654
+ return require('./rush-fs.openharmony-arm.node')
655
+ } catch (e) {
656
+ loadErrors.push(e)
657
+ }
658
+ try {
659
+ const binding = require('@rush-fs/rush-fs-openharmony-arm')
660
+ const bindingPackageVersion = require('@rush-fs/rush-fs-openharmony-arm/package.json').version
661
+ if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
662
+ throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
663
+ if (bindingPackageVersion !== '0.0.3' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
664
+ throw new Error(`Native binding package version mismatch, expected 0.0.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
665
+ const binding = require('@rush-fs/core-openharmony-arm')
666
+ const bindingPackageVersion = require('@rush-fs/core-openharmony-arm/package.json').version
667
+ if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
668
+ throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
669
+ }
670
+ return binding
671
+ } catch (e) {
672
+ loadErrors.push(e)
673
+ }
674
+ } else {
675
+ loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
676
+ }
677
+ } else {
678
+ loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
679
+ }
680
+ }
681
+
682
+ nativeBinding = requireNative()
683
+
684
+ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
685
+ let wasiBinding = null
686
+ let wasiBindingError = null
687
+ try {
688
+ wasiBinding = require('./rush-fs.wasi.cjs')
689
+ nativeBinding = wasiBinding
690
+ } catch (err) {
691
+ if (process.env.NAPI_RS_FORCE_WASI) {
692
+ wasiBindingError = err
693
+ }
694
+ }
695
+ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
696
+ try {
697
+ wasiBinding = require('@rush-fs/core-wasm32-wasi')
698
+ nativeBinding = wasiBinding
699
+ } catch (err) {
700
+ if (process.env.NAPI_RS_FORCE_WASI) {
701
+ if (!wasiBindingError) {
702
+ wasiBindingError = err
703
+ } else {
704
+ wasiBindingError.cause = err
705
+ }
706
+ loadErrors.push(err)
707
+ }
708
+ }
709
+ }
710
+ if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
711
+ const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
712
+ error.cause = wasiBindingError
713
+ throw error
714
+ }
715
+ }
716
+
717
+ if (!nativeBinding) {
718
+ if (loadErrors.length > 0) {
719
+ throw new Error(
720
+ `Cannot find native binding. ` +
721
+ `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
722
+ 'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
723
+ {
724
+ cause: loadErrors.reduce((err, cur) => {
725
+ cur.cause = err
726
+ return cur
727
+ }),
728
+ },
729
+ )
730
+ }
731
+ throw new Error(`Failed to load native binding`)
732
+ }
733
+
734
+ module.exports = nativeBinding
735
+ module.exports.Dirent = nativeBinding.Dirent
736
+ module.exports.Stats = nativeBinding.Stats
737
+ module.exports.access = nativeBinding.access
738
+ module.exports.accessSync = nativeBinding.accessSync
739
+ module.exports.appendFile = nativeBinding.appendFile
740
+ module.exports.appendFileSync = nativeBinding.appendFileSync
741
+ module.exports.chmod = nativeBinding.chmod
742
+ module.exports.chmodSync = nativeBinding.chmodSync
743
+ module.exports.chown = nativeBinding.chown
744
+ module.exports.chownSync = nativeBinding.chownSync
745
+ module.exports.copyFile = nativeBinding.copyFile
746
+ module.exports.copyFileSync = nativeBinding.copyFileSync
747
+ module.exports.cp = nativeBinding.cp
748
+ module.exports.cpSync = nativeBinding.cpSync
749
+ module.exports.exists = nativeBinding.exists
750
+ module.exports.existsSync = nativeBinding.existsSync
751
+ module.exports.glob = nativeBinding.glob
752
+ module.exports.globSync = nativeBinding.globSync
753
+ module.exports.link = nativeBinding.link
754
+ module.exports.linkSync = nativeBinding.linkSync
755
+ module.exports.lstat = nativeBinding.lstat
756
+ module.exports.lstatSync = nativeBinding.lstatSync
757
+ module.exports.mkdir = nativeBinding.mkdir
758
+ module.exports.mkdirSync = nativeBinding.mkdirSync
759
+ module.exports.mkdtemp = nativeBinding.mkdtemp
760
+ module.exports.mkdtempSync = nativeBinding.mkdtempSync
761
+ module.exports.readdir = nativeBinding.readdir
762
+ module.exports.readdirSync = nativeBinding.readdirSync
763
+ module.exports.readFile = nativeBinding.readFile
764
+ module.exports.readFileSync = nativeBinding.readFileSync
765
+ module.exports.readlink = nativeBinding.readlink
766
+ module.exports.readlinkSync = nativeBinding.readlinkSync
767
+ module.exports.realpath = nativeBinding.realpath
768
+ module.exports.realpathSync = nativeBinding.realpathSync
769
+ module.exports.rename = nativeBinding.rename
770
+ module.exports.renameSync = nativeBinding.renameSync
771
+ module.exports.rm = nativeBinding.rm
772
+ module.exports.rmdir = nativeBinding.rmdir
773
+ module.exports.rmdirSync = nativeBinding.rmdirSync
774
+ module.exports.rmSync = nativeBinding.rmSync
775
+ module.exports.stat = nativeBinding.stat
776
+ module.exports.statSync = nativeBinding.statSync
777
+ module.exports.symlink = nativeBinding.symlink
778
+ module.exports.symlinkSync = nativeBinding.symlinkSync
779
+ module.exports.truncate = nativeBinding.truncate
780
+ module.exports.truncateSync = nativeBinding.truncateSync
781
+ module.exports.unlink = nativeBinding.unlink
782
+ module.exports.unlinkSync = nativeBinding.unlinkSync
783
+ module.exports.utimes = nativeBinding.utimes
784
+ module.exports.utimesSync = nativeBinding.utimesSync
785
+ module.exports.writeFile = nativeBinding.writeFile
786
+ module.exports.writeFileSync = nativeBinding.writeFileSync