mirror of
https://github.com/hanzoai/cross-env.git
synced 2026-09-24 16:58:15 +00:00
fix: replace invariant with simple code (#267)
This commit is contained in:
Generated
-1223
File diff suppressed because it is too large
Load Diff
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user