collectype

collectype v0.11.0


collectype / utils/pipe/pipeFunctions / splitArguments

Function: splitArguments()

splitArguments(input): string[]

Defined in: utils/pipe/pipeFunctions.ts:92

Splits an argument string into individual argument tokens, respecting nesting and string literals.

Parameters

input

string

The argument string

Returns

string[]

Array of argument tokens as strings

Example

splitArguments('1, "foo,bar", [1,2], {a:1, b:2}')
// ['1', '"foo,bar"', '[1,2]', '{a:1, b:2}']