Skip to content

Commit 997b2d7

Browse files
committed
refactor: use @socketsecurity/lib parseArgs
Replace node:util.parseArgs with @socketsecurity/lib/argv/parse for better Node 18 compatibility and standardization across Socket repos.
1 parent 58cf04b commit 997b2d7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

scripts/cover.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
* --summary Show only coverage summary (hide detailed output)
1515
*/
1616

17-
import { parseArgs } from 'node:util'
18-
1917
import { isQuiet, isVerbose } from '@socketsecurity/lib/argv/flags'
18+
import { parseArgs } from '@socketsecurity/lib/argv/parse'
2019
import { logger } from '@socketsecurity/lib/logger'
2120

2221
import { runCommandQuiet } from './utils/run-command.mjs'

scripts/utils/common.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
* Provides consistent helpers for running commands and logging.
44
*/
55

6-
import { parseArgs as nodeParseArgs } from 'node:util'
76
import path from 'node:path'
87
import { fileURLToPath } from 'node:url'
98

9+
import { parseArgs } from '@socketsecurity/lib/argv/parse'
10+
1011
// Platform detection
1112
export const WIN32 = process.platform === 'win32'
1213
export const MACOS = process.platform === 'darwin'
@@ -76,7 +77,7 @@ export function parseScriptArgs(options = {}) {
7677
...options,
7778
}
7879

79-
return nodeParseArgs({
80+
return parseArgs({
8081
options: defaultOptions,
8182
allowPositionals: true,
8283
})

0 commit comments

Comments
 (0)