fix: replace invariant with simple code (#267)

This commit is contained in:
Hyper-Z11
2025-11-16 07:10:20 -07:00
committed by GitHub
parent 315f6260b8
commit 14176cfa0d
3 changed files with 3 additions and 1226 deletions
-1223
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -39,7 +39,6 @@
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com)",
"license": "MIT",
"dependencies": {
"@epic-web/invariant": "^1.0.0",
"cross-spawn": "^7.0.6"
},
"devDependencies": {
+3 -2
View File
@@ -1,5 +1,4 @@
import { type SpawnOptions } from 'child_process'
import { invariant } from '@epic-web/invariant'
import { spawn } from 'cross-spawn'
import { commandConvert } from './command.js'
import { varValueConvert } from './variable.js'
@@ -98,7 +97,9 @@ function parseCommand(
})
})
const parsedCommand = cStart[0]
invariant(parsedCommand, 'Command is required')
if (!parsedCommand) {
throw new Error('Command is required')
}
command = parsedCommand
commandArgs = cStart.slice(1).filter(Boolean)
break