MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / ensureArray

Function ensureArray

source code/utils/powershell/parser.ts:705–710  ·  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

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

Callers 3

transformCommandAstFunction · 0.85
transformStatementFunction · 0.85
transformRawOutputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected