Skip to content

Commit 701642f

Browse files
committed
Update scripts again
1 parent 44ac08a commit 701642f

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

scripts/make-npm-override.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const { globStreamLicenses } = require('@socketsecurity/registry/lib/globs')
2323
const { LOG_SYMBOLS, logger } = require('@socketsecurity/registry/lib/logger')
2424
const { runNpmScript } = require('@socketsecurity/registry/lib/npm')
2525
const { isObject } = require('@socketsecurity/registry/lib/objects')
26-
const { parallelMap } = require('@socketsecurity/registry/lib/streams')
26+
const { transform } = require('@socketsecurity/registry/lib/streams')
2727
const {
2828
collectIncompatibleLicenses,
2929
collectLicenseWarnings,
@@ -130,7 +130,7 @@ function getCompatData(props) {
130130
async function readLicenses(dirname) {
131131
const stream = await globStreamLicenses(dirname)
132132
const results = []
133-
for await (const license of parallelMap(
133+
for await (const license of transform(
134134
8, // Concurrency level.
135135
async filepath => ({
136136
name: path.basename(filepath),

scripts/update-licenses.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const fs = require('node:fs/promises')
44

55
const constants = require('@socketregistry/scripts/constants')
66
const { globStreamLicenses } = require('@socketsecurity/registry/lib/globs')
7-
const { transform } = require('@socketsecurity/registry/lib/streams')
7+
const { parallelForEach } = require('@socketsecurity/registry/lib/streams')
88

99
const { LICENSE, LICENSE_CONTENT, UTF8, ignoreGlobs, rootPath } = constants
1010

@@ -14,12 +14,9 @@ void (async () => {
1414
ignoreOriginals: true,
1515
ignore: [LICENSE, 'scripts/templates', ...ignoreGlobs]
1616
})
17-
18-
for await (const licensePath of transform(
17+
await parallelForEach(
1918
8, // Concurrency level.
20-
async filepath => filepath,
19+
licensePath => fs.writeFile(licensePath, LICENSE_CONTENT, UTF8),
2120
stream
22-
)) {
23-
fs.writeFile(licensePath, LICENSE_CONTENT, UTF8)
24-
}
21+
)
2522
})()

0 commit comments

Comments
 (0)