MCPcopy Index your code
hub / github.com/tinyhttp/tinyhttp / toArray

Function toArray

packages/unless/src/index.ts:35–39  ·  view source on GitHub ↗
(val: any | any[])

Source from the content-addressed store, hash-verified

33
34// Convert single element to array of one element
35function toArray(val: any | any[]): any[] {
36 if (!Array.isArray(val) && val !== undefined) return [val]
37
38 return val
39}
40
41/**
42 * Check path parameter

Callers 1

unlessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected