@@ -7,7 +7,7 @@ import { logger } from '@socketsecurity/registry/lib/logger'
7
7
import { hasOwn , toSortedObject } from '@socketsecurity/registry/lib/objects'
8
8
import { normalizePath } from '@socketsecurity/registry/lib/path'
9
9
import { naturalCompare } from '@socketsecurity/registry/lib/sorts'
10
- import { indentString } from '@socketsecurity/registry/lib/strings'
10
+ import { indentString , trimNewlines } from '@socketsecurity/registry/lib/strings'
11
11
12
12
import {
13
13
getConfigValueOrUndef ,
@@ -74,10 +74,6 @@ function description(command: CliSubcommand | undefined): string {
74
74
return indentString ( str , HELP_PAD_NAME ) . trimStart ( )
75
75
}
76
76
77
- function trimNewlines ( str : string ) : string {
78
- return str . replace ( / ^ \n + | \n + $ / g, '' )
79
- }
80
-
81
77
// For debugging. Whenever you call meowOrExit it will store the command here
82
78
// This module exports a getter that returns the current value.
83
79
let lastSeenCommand = ''
@@ -183,7 +179,7 @@ export async function meowWithSubcommands(
183
179
}
184
180
185
181
// This is basically a dry-run parse of cli args and flags. We use this to
186
- // determine config overrides and expected o mode.
182
+ // determine config overrides and expected output mode.
187
183
const cli1 = meow ( {
188
184
argv,
189
185
importMeta,
@@ -240,7 +236,7 @@ export async function meowWithSubcommands(
240
236
return
241
237
}
242
238
243
- // If we got at least some args, then lets find o if we can find a command.
239
+ // If we have got some args, then lets find out if we can find a command.
244
240
if ( commandOrAliasName ) {
245
241
const alias = aliases [ commandOrAliasName ]
246
242
// First: Resolve argv data from alias if its an alias that's been given.
0 commit comments