Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
35
function
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
unless
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected