MCPcopy
hub / github.com/stepci/stepci / parseEnvArray

Function parseEnvArray

src/lib/utils.ts:11–19  ·  view source on GitHub ↗
(env?: string[])

Source from the content-addressed store, hash-verified

9
10// Parse every entry in optional env array to a key value pair and return as object
11export function parseEnvArray(env?: string[]): WorkflowEnv {
12 const entries = env?.map((opt) => {
13 const eq = opt.indexOf('=')
14 const key = opt.substring(0, eq)
15 const value = opt.substring(eq + 1)
16 return [key, value]
17 })
18 return Object.fromEntries(entries ?? [])
19}
20
21export function isJSON (input: string | object) {
22 if (typeof input === 'object') return true

Callers 1

index.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected