MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / ensureArray

Function ensureArray

src/utils/powershell/parser.ts:703–708  ·  view source on GitHub ↗

* Ensure a value is an array. PowerShell 5.1's ConvertTo-Json may unwrap * single-element arrays into plain objects.

(value: T | T[] | undefined | null)

Source from the content-addressed store, hash-verified

701 * single-element arrays into plain objects.
702 */
703function ensureArray<T>(value: T | T[] | undefined | null): T[] {
704 if (value === undefined || value === null) {
705 return []
706 }
707 return Array.isArray(value) ? value : [value]
708}
709
710/** Map raw .NET AST type name to our StatementType union */
711// exported for testing

Callers 3

transformCommandAstFunction · 0.85
transformStatementFunction · 0.85
transformRawOutputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected