@emulsify/cli 1.11.4 → 1.12.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/dist/node_modules/.package-lock.json +34 -24
- package/dist/node_modules/@types/node/README.md +2 -2
- package/dist/node_modules/@types/node/assert.d.ts +23 -1
- package/dist/node_modules/@types/node/async_hooks.d.ts +64 -0
- package/dist/node_modules/@types/node/buffer.buffer.d.ts +124 -38
- package/dist/node_modules/@types/node/buffer.d.ts +19 -17
- package/dist/node_modules/@types/node/child_process.d.ts +88 -161
- package/dist/node_modules/@types/node/cluster.d.ts +5 -6
- package/dist/node_modules/@types/node/constants.d.ts +14 -12
- package/dist/node_modules/@types/node/crypto.d.ts +237 -166
- package/dist/node_modules/@types/node/dgram.d.ts +15 -14
- package/dist/node_modules/@types/node/diagnostics_channel.d.ts +39 -15
- package/dist/node_modules/@types/node/dns/promises.d.ts +11 -9
- package/dist/node_modules/@types/node/dns.d.ts +28 -21
- package/dist/node_modules/@types/node/events.d.ts +81 -35
- package/dist/node_modules/@types/node/fs/promises.d.ts +61 -36
- package/dist/node_modules/@types/node/fs.d.ts +251 -193
- package/dist/node_modules/@types/node/globals.d.ts +146 -442
- package/dist/node_modules/@types/node/globals.typedarray.d.ts +17 -0
- package/dist/node_modules/@types/node/http.d.ts +136 -31
- package/dist/node_modules/@types/node/http2.d.ts +102 -26
- package/dist/node_modules/@types/node/https.d.ts +94 -60
- package/dist/node_modules/@types/node/index.d.ts +5 -3
- package/dist/node_modules/@types/node/{inspector.d.ts → inspector.generated.d.ts} +272 -2
- package/dist/node_modules/@types/node/module.d.ts +362 -138
- package/dist/node_modules/@types/node/net.d.ts +27 -20
- package/dist/node_modules/@types/node/os.d.ts +14 -3
- package/dist/node_modules/@types/node/package.json +4 -89
- package/dist/node_modules/@types/node/perf_hooks.d.ts +37 -10
- package/dist/node_modules/@types/node/process.d.ts +108 -35
- package/dist/node_modules/@types/node/querystring.d.ts +2 -3
- package/dist/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/dist/node_modules/@types/node/stream/consumers.d.ts +33 -7
- package/dist/node_modules/@types/node/stream/web.d.ts +13 -4
- package/dist/node_modules/@types/node/stream.d.ts +963 -1014
- package/dist/node_modules/@types/node/string_decoder.d.ts +2 -2
- package/dist/node_modules/@types/node/test.d.ts +1504 -1655
- package/dist/node_modules/@types/node/timers/promises.d.ts +28 -17
- package/dist/node_modules/@types/node/timers.d.ts +157 -111
- package/dist/node_modules/@types/node/tls.d.ts +105 -67
- package/dist/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +120 -37
- package/dist/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +15 -0
- package/dist/node_modules/@types/node/ts5.6/index.d.ts +5 -3
- package/dist/node_modules/@types/node/url.d.ts +10 -1
- package/dist/node_modules/@types/node/util.d.ts +28 -3
- package/dist/node_modules/@types/node/v8.d.ts +6 -5
- package/dist/node_modules/@types/node/vm.d.ts +147 -68
- package/dist/node_modules/@types/node/wasi.d.ts +1 -1
- package/dist/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/dist/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/dist/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/dist/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
- package/dist/node_modules/@types/node/worker_threads.d.ts +60 -39
- package/dist/node_modules/@types/node/zlib.d.ts +21 -20
- package/dist/node_modules/debug/package.json +7 -3
- package/dist/node_modules/debug/src/browser.js +2 -1
- package/dist/node_modules/debug/src/common.js +57 -39
- package/dist/node_modules/fast-uri/.github/dependabot.yml +1 -1
- package/dist/node_modules/fast-uri/.github/workflows/ci.yml +81 -3
- package/dist/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +6 -2
- package/dist/node_modules/fast-uri/LICENSE +3 -1
- package/dist/node_modules/fast-uri/README.md +55 -37
- package/dist/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
- package/dist/node_modules/fast-uri/benchmark/equal.mjs +51 -0
- package/dist/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
- package/dist/node_modules/fast-uri/benchmark/package.json +17 -0
- package/dist/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
- package/dist/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
- package/dist/node_modules/fast-uri/eslint.config.js +6 -0
- package/dist/node_modules/fast-uri/index.js +98 -61
- package/dist/node_modules/fast-uri/lib/schemes.js +160 -81
- package/dist/node_modules/fast-uri/lib/utils.js +217 -123
- package/dist/node_modules/fast-uri/package.json +44 -14
- package/dist/node_modules/fast-uri/test/ajv.test.js +7 -3
- package/dist/node_modules/fast-uri/test/equal.test.js +7 -2
- package/dist/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
- package/dist/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
- package/dist/node_modules/fast-uri/test/parse.test.js +31 -31
- package/dist/node_modules/fast-uri/test/resolve.test.js +52 -49
- package/dist/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
- package/dist/node_modules/fast-uri/test/serialize.test.js +55 -47
- package/dist/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
- package/dist/node_modules/fast-uri/test/uri-js.test.js +230 -230
- package/dist/node_modules/fast-uri/test/util.test.js +23 -8
- package/dist/node_modules/fast-uri/tsconfig.json +9 -0
- package/dist/node_modules/fast-uri/types/index.d.ts +16 -9
- package/dist/node_modules/fast-uri/types/index.test-d.ts +9 -9
- package/dist/node_modules/fs-extra/LICENSE +1 -1
- package/dist/node_modules/fs-extra/README.md +3 -1
- package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +11 -1
- package/dist/node_modules/fs-extra/lib/copy/copy.js +13 -15
- package/dist/node_modules/fs-extra/lib/fs/index.js +6 -0
- package/dist/node_modules/fs-extra/lib/util/async.js +29 -0
- package/dist/node_modules/fs-extra/lib/util/stat.js +2 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonfile/README.md +1 -1
- package/dist/node_modules/jsonfile/index.js +3 -3
- package/dist/node_modules/jsonfile/package.json +1 -1
- package/dist/node_modules/simple-git/dist/cjs/index.js +235 -235
- package/dist/node_modules/simple-git/dist/cjs/index.js.map +3 -3
- package/dist/node_modules/simple-git/dist/esm/index.js +229 -233
- package/dist/node_modules/simple-git/dist/esm/index.js.map +3 -3
- package/dist/node_modules/simple-git/dist/src/lib/git-logger.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-branch.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/plugins/error-detection.plugin.d.ts +2 -3
- package/dist/node_modules/simple-git/dist/src/lib/plugins/simple-git-plugin.d.ts +2 -3
- package/dist/node_modules/simple-git/dist/src/lib/plugins/spawn-options-plugin.d.ts +0 -1
- package/dist/node_modules/simple-git/dist/src/lib/runners/scheduler.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/runners/tasks-pending-queue.d.ts +2 -2
- package/dist/node_modules/simple-git/dist/src/lib/tasks/apply-patch.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/clean.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/clone.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/log.d.ts +3 -3
- package/dist/node_modules/simple-git/dist/src/lib/tasks/push.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/remote.d.ts +4 -2
- package/dist/node_modules/simple-git/dist/src/lib/tasks/reset.d.ts +3 -3
- package/dist/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/task.d.ts +2 -2
- package/dist/node_modules/simple-git/dist/src/lib/types/handlers.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/types/index.d.ts +9 -13
- package/dist/node_modules/simple-git/dist/src/lib/types/tasks.d.ts +5 -6
- package/dist/node_modules/simple-git/dist/src/lib/utils/argument-filters.d.ts +5 -7
- package/dist/node_modules/simple-git/dist/src/lib/utils/git-output-streams.d.ts +0 -1
- package/dist/node_modules/simple-git/dist/src/lib/utils/line-parser.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/utils/task-options.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/utils/util.d.ts +11 -10
- package/dist/node_modules/simple-git/package.json +6 -6
- package/dist/node_modules/simple-git/readme.md +8 -0
- package/dist/node_modules/undici-types/dispatcher.d.ts +1 -0
- package/dist/node_modules/undici-types/eventsource.d.ts +0 -2
- package/dist/node_modules/undici-types/filereader.d.ts +1 -1
- package/dist/node_modules/undici-types/interceptors.d.ts +3 -1
- package/dist/node_modules/undici-types/package.json +1 -1
- package/dist/node_modules/undici-types/patch.d.ts +0 -38
- package/dist/node_modules/undici-types/readable.d.ts +5 -0
- package/dist/node_modules/undici-types/webidl.d.ts +6 -0
- package/dist/node_modules/undici-types/websocket.d.ts +0 -2
- package/dist/package-lock.json +911 -812
- package/dist/package.json +1 -1
- package/dist/util/getAvailableStarters.js +2 -2
- package/package.json +1 -1
- package/dist/node_modules/@types/node/dom-events.d.ts +0 -124
- package/dist/node_modules/fast-uri/benchmark.js +0 -105
- package/dist/node_modules/fast-uri/lib/scopedChars.js +0 -30
- package/dist/node_modules/fast-uri/test/.gitkeep +0 -0
- package/dist/node_modules/fast-uri/test/compatibility.test.js +0 -131
- package/dist/node_modules/jsonfile/CHANGELOG.md +0 -171
|
@@ -2,22 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
const test = require('tape')
|
|
4
4
|
const {
|
|
5
|
-
stringArrayToHexStripped
|
|
5
|
+
stringArrayToHexStripped,
|
|
6
|
+
removeDotSegments
|
|
6
7
|
} = require('../lib/utils')
|
|
7
8
|
|
|
8
9
|
test('stringArrayToHexStripped', (t) => {
|
|
9
10
|
const testCases = [
|
|
10
|
-
[[
|
|
11
|
-
[[
|
|
12
|
-
[[
|
|
13
|
-
[[
|
|
14
|
-
[[
|
|
15
|
-
[[
|
|
11
|
+
[['0', '0', '0', '0'], ''],
|
|
12
|
+
[['0', '0', '0', '1'], '1'],
|
|
13
|
+
[['0', '0', '1', '0'], '10'],
|
|
14
|
+
[['0', '1', '0', '0'], '100'],
|
|
15
|
+
[['1', '0', '0', '0'], '1000'],
|
|
16
|
+
[['1', '0', '0', '1'], '1001'],
|
|
16
17
|
]
|
|
17
18
|
|
|
18
19
|
t.plan(testCases.length)
|
|
19
20
|
|
|
20
21
|
testCases.forEach(([input, expected]) => {
|
|
21
|
-
t.same(stringArrayToHexStripped(input
|
|
22
|
+
t.same(stringArrayToHexStripped(input), expected)
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
// Just fixtures, because this function already tested by resolve
|
|
27
|
+
test('removeDotSegments', (t) => {
|
|
28
|
+
const testCases = []
|
|
29
|
+
// https://github.com/fastify/fast-uri/issues/139
|
|
30
|
+
testCases.push(['WS:/WS://1305G130505:1&%0D:1&C(XXXXX*)))))))XXX130505:UUVUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$aaaaaaaaaaaa13a',
|
|
31
|
+
'WS:/WS://1305G130505:1&%0D:1&C(XXXXX*)))))))XXX130505:UUVUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$aaaaaaaaaaaa13a'])
|
|
32
|
+
|
|
33
|
+
t.plan(testCases.length)
|
|
34
|
+
|
|
35
|
+
testCases.forEach(([input, expected]) => {
|
|
36
|
+
t.same(removeDotSegments(input), expected)
|
|
22
37
|
})
|
|
23
38
|
})
|
|
@@ -10,6 +10,11 @@ declare namespace fastUri {
|
|
|
10
10
|
query?: string;
|
|
11
11
|
fragment?: string;
|
|
12
12
|
reference?: string;
|
|
13
|
+
nid?: string;
|
|
14
|
+
nss?: string;
|
|
15
|
+
resourceName?: string;
|
|
16
|
+
secure?: boolean;
|
|
17
|
+
uuid?: string;
|
|
13
18
|
error?: string;
|
|
14
19
|
}
|
|
15
20
|
export interface Options {
|
|
@@ -19,6 +24,8 @@ declare namespace fastUri {
|
|
|
19
24
|
domainHost?: boolean;
|
|
20
25
|
absolutePath?: boolean;
|
|
21
26
|
tolerant?: boolean;
|
|
27
|
+
skipEscape?: boolean;
|
|
28
|
+
nid?: string;
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
/**
|
|
@@ -30,21 +37,21 @@ declare namespace fastUri {
|
|
|
30
37
|
*/
|
|
31
38
|
export type URIComponents = URIComponent
|
|
32
39
|
|
|
33
|
-
export function normalize(uri: string, opts?: Options): string
|
|
34
|
-
export function normalize(uri: URIComponent, opts?: Options): URIComponent
|
|
35
|
-
export function normalize(uri: any, opts?: Options): any
|
|
40
|
+
export function normalize (uri: string, opts?: Options): string
|
|
41
|
+
export function normalize (uri: URIComponent, opts?: Options): URIComponent
|
|
42
|
+
export function normalize (uri: any, opts?: Options): any
|
|
36
43
|
|
|
37
|
-
export function resolve(baseURI: string, relativeURI: string, options?: Options): string
|
|
44
|
+
export function resolve (baseURI: string, relativeURI: string, options?: Options): string
|
|
38
45
|
|
|
39
|
-
export function resolveComponent(base: URIComponent, relative: URIComponent, options?: Options, skipNormalization?: boolean): URIComponent
|
|
46
|
+
export function resolveComponent (base: URIComponent, relative: URIComponent, options?: Options, skipNormalization?: boolean): URIComponent
|
|
40
47
|
|
|
41
|
-
export function parse(uri: string, opts?: Options): URIComponent
|
|
48
|
+
export function parse (uri: string, opts?: Options): URIComponent
|
|
42
49
|
|
|
43
|
-
export function serialize(component: URIComponent, opts?: Options): string
|
|
50
|
+
export function serialize (component: URIComponent, opts?: Options): string
|
|
44
51
|
|
|
45
|
-
export function equal(uriA: string, uriB: string): boolean
|
|
52
|
+
export function equal (uriA: string, uriB: string): boolean
|
|
46
53
|
|
|
47
|
-
export function resolve(base: string, path: string): string
|
|
54
|
+
export function resolve (base: string, path: string): string
|
|
48
55
|
|
|
49
56
|
export const fastUri: FastUri
|
|
50
57
|
export { fastUri as default }
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import uri, { URIComponents, URIComponent, Options, options } from
|
|
2
|
-
import { expectDeprecated, expectType } from
|
|
1
|
+
import uri, { URIComponents, URIComponent, Options, options } from '..'
|
|
2
|
+
import { expectDeprecated, expectType } from 'tsd'
|
|
3
3
|
|
|
4
|
-
const parsed = uri.parse(
|
|
5
|
-
expectType<URIComponents>(parsed)
|
|
6
|
-
const parsed2 = uri.parse(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
const parsed = uri.parse('foo')
|
|
5
|
+
expectType<URIComponents>(parsed)
|
|
6
|
+
const parsed2 = uri.parse('foo', {
|
|
7
|
+
domainHost: true,
|
|
8
|
+
scheme: 'https',
|
|
9
|
+
unicodeSupport: false
|
|
10
10
|
})
|
|
11
|
-
expectType<URIComponents>(parsed2)
|
|
11
|
+
expectType<URIComponents>(parsed2)
|
|
12
12
|
|
|
13
13
|
expectType<URIComponent>({} as URIComponents)
|
|
14
14
|
expectDeprecated({} as URIComponents)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(The MIT License)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2011-
|
|
3
|
+
Copyright (c) 2011-2024 JP Richardson
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
|
|
6
6
|
(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
|
|
@@ -57,6 +57,8 @@ const fs = require('fs')
|
|
|
57
57
|
const fse = require('fs-extra')
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
**NOTE:** The deprecated constants `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, & `fs.X_OK` are not exported on Node.js v24.0.0+; please use their `fs.constants` equivalents.
|
|
61
|
+
|
|
60
62
|
### ESM
|
|
61
63
|
|
|
62
64
|
There is also an `fs-extra/esm` import, that supports both default and named exports. However, note that `fs` methods are not included in `fs-extra/esm`; you still need to import `fs` and/or `fs/promises` seperately:
|
|
@@ -284,7 +286,7 @@ License
|
|
|
284
286
|
|
|
285
287
|
Licensed under MIT
|
|
286
288
|
|
|
287
|
-
Copyright (c) 2011-
|
|
289
|
+
Copyright (c) 2011-2024 [JP Richardson](https://github.com/jprichardson)
|
|
288
290
|
|
|
289
291
|
[1]: http://nodejs.org/docs/latest/api/fs.html
|
|
290
292
|
|
|
@@ -106,7 +106,17 @@ function mkDirAndCopy (srcMode, src, dest, opts) {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
function copyDir (src, dest, opts) {
|
|
109
|
-
fs.
|
|
109
|
+
const dir = fs.opendirSync(src)
|
|
110
|
+
|
|
111
|
+
try {
|
|
112
|
+
let dirent
|
|
113
|
+
|
|
114
|
+
while ((dirent = dir.readSync()) !== null) {
|
|
115
|
+
copyDirItem(dirent.name, src, dest, opts)
|
|
116
|
+
}
|
|
117
|
+
} finally {
|
|
118
|
+
dir.closeSync()
|
|
119
|
+
}
|
|
110
120
|
}
|
|
111
121
|
|
|
112
122
|
function copyDirItem (item, src, dest, opts) {
|
|
@@ -6,6 +6,7 @@ const { mkdirs } = require('../mkdirs')
|
|
|
6
6
|
const { pathExists } = require('../path-exists')
|
|
7
7
|
const { utimesMillis } = require('../util/utimes')
|
|
8
8
|
const stat = require('../util/stat')
|
|
9
|
+
const { asyncIteratorConcurrentProcess } = require('../util/async')
|
|
9
10
|
|
|
10
11
|
async function copy (src, dest, opts = {}) {
|
|
11
12
|
if (typeof opts === 'function') {
|
|
@@ -113,23 +114,20 @@ async function onDir (srcStat, destStat, src, dest, opts) {
|
|
|
113
114
|
await fs.mkdir(dest)
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
|
|
117
|
+
// iterate through the files in the current directory to copy everything
|
|
118
|
+
await asyncIteratorConcurrentProcess(await fs.opendir(src), async (item) => {
|
|
119
|
+
const srcItem = path.join(src, item.name)
|
|
120
|
+
const destItem = path.join(dest, item.name)
|
|
117
121
|
|
|
118
|
-
// loop through the files in the current directory to copy everything
|
|
119
|
-
await Promise.all(items.map(async item => {
|
|
120
|
-
const srcItem = path.join(src, item)
|
|
121
|
-
const destItem = path.join(dest, item)
|
|
122
|
-
|
|
123
|
-
// skip the item if it is matches by the filter function
|
|
124
122
|
const include = await runFilter(srcItem, destItem, opts)
|
|
125
|
-
if
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
})
|
|
123
|
+
// only copy the item if it matches the filter function
|
|
124
|
+
if (include) {
|
|
125
|
+
const { destStat } = await stat.checkPaths(srcItem, destItem, 'copy', opts)
|
|
126
|
+
// If the item is a copyable file, `getStatsAndPerformCopy` will copy it
|
|
127
|
+
// If the item is a directory, `getStatsAndPerformCopy` will call `onDir` recursively
|
|
128
|
+
await getStatsAndPerformCopy(destStat, srcItem, destItem, opts)
|
|
129
|
+
}
|
|
130
|
+
})
|
|
133
131
|
|
|
134
132
|
if (!destStat) {
|
|
135
133
|
await fs.chmod(dest, srcStat.mode)
|
|
@@ -11,6 +11,7 @@ const api = [
|
|
|
11
11
|
'chown',
|
|
12
12
|
'close',
|
|
13
13
|
'copyFile',
|
|
14
|
+
'cp',
|
|
14
15
|
'fchmod',
|
|
15
16
|
'fchown',
|
|
16
17
|
'fdatasync',
|
|
@@ -18,8 +19,10 @@ const api = [
|
|
|
18
19
|
'fsync',
|
|
19
20
|
'ftruncate',
|
|
20
21
|
'futimes',
|
|
22
|
+
'glob',
|
|
21
23
|
'lchmod',
|
|
22
24
|
'lchown',
|
|
25
|
+
'lutimes',
|
|
23
26
|
'link',
|
|
24
27
|
'lstat',
|
|
25
28
|
'mkdir',
|
|
@@ -34,6 +37,7 @@ const api = [
|
|
|
34
37
|
'rm',
|
|
35
38
|
'rmdir',
|
|
36
39
|
'stat',
|
|
40
|
+
'statfs',
|
|
37
41
|
'symlink',
|
|
38
42
|
'truncate',
|
|
39
43
|
'unlink',
|
|
@@ -42,6 +46,8 @@ const api = [
|
|
|
42
46
|
].filter(key => {
|
|
43
47
|
// Some commands are not available on some systems. Ex:
|
|
44
48
|
// fs.cp was added in Node.js v16.7.0
|
|
49
|
+
// fs.statfs was added in Node v19.6.0, v18.15.0
|
|
50
|
+
// fs.glob was added in Node.js v22.0.0
|
|
45
51
|
// fs.lchown is not available on at least some Linux
|
|
46
52
|
return typeof fs[key] === 'function'
|
|
47
53
|
})
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
// https://github.com/jprichardson/node-fs-extra/issues/1056
|
|
4
|
+
// Performing parallel operations on each item of an async iterator is
|
|
5
|
+
// surprisingly hard; you need to have handlers in place to avoid getting an
|
|
6
|
+
// UnhandledPromiseRejectionWarning.
|
|
7
|
+
// NOTE: This function does not presently handle return values, only errors
|
|
8
|
+
async function asyncIteratorConcurrentProcess (iterator, fn) {
|
|
9
|
+
const promises = []
|
|
10
|
+
for await (const item of iterator) {
|
|
11
|
+
promises.push(
|
|
12
|
+
fn(item).then(
|
|
13
|
+
() => null,
|
|
14
|
+
(err) => err ?? new Error('unknown error')
|
|
15
|
+
)
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
await Promise.all(
|
|
19
|
+
promises.map((promise) =>
|
|
20
|
+
promise.then((possibleErr) => {
|
|
21
|
+
if (possibleErr !== null) throw possibleErr
|
|
22
|
+
})
|
|
23
|
+
)
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
module.exports = {
|
|
28
|
+
asyncIteratorConcurrentProcess
|
|
29
|
+
}
|
|
@@ -130,7 +130,8 @@ function checkParentPathsSync (src, srcStat, dest, funcName) {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
function areIdentical (srcStat, destStat) {
|
|
133
|
-
|
|
133
|
+
// stat.dev can be 0n on windows when node version >= 22.x.x
|
|
134
|
+
return destStat.ino !== undefined && destStat.dev !== undefined && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
// return true if dest is a subdir of src, otherwise false.
|
|
@@ -4,7 +4,7 @@ Node.js - jsonfile
|
|
|
4
4
|
Easily read/write JSON files in Node.js. _Note: this module cannot be used in the browser._
|
|
5
5
|
|
|
6
6
|
[](https://www.npmjs.org/package/jsonfile)
|
|
7
|
-
[](https://github.com/jprichardson/node-jsonfile/actions?query=branch%3Amaster)
|
|
8
8
|
[](https://ci.appveyor.com/project/jprichardson/node-jsonfile/branch/master)
|
|
9
9
|
|
|
10
10
|
<a href="https://github.com/feross/standard"><img src="https://cdn.rawgit.com/feross/standard/master/sticker.svg" alt="Standard JavaScript" width="100"></a>
|
|
@@ -78,11 +78,11 @@ function writeFileSync (file, obj, options = {}) {
|
|
|
78
78
|
return fs.writeFileSync(file, str, options)
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
// NOTE: do not change this export format; required for ESM compat
|
|
82
|
+
// see https://github.com/jprichardson/node-jsonfile/pull/162 for details
|
|
83
|
+
module.exports = {
|
|
82
84
|
readFile,
|
|
83
85
|
readFileSync,
|
|
84
86
|
writeFile,
|
|
85
87
|
writeFileSync
|
|
86
88
|
}
|
|
87
|
-
|
|
88
|
-
module.exports = jsonfile
|