Skip to main content
variable castArray
import { castArray } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Casts the provided value as an array if it's not one.

Use Array.prototype.isArray() to determine if val is an array and return it as-is or encapsulated in an array accordingly.

type

(val: any) => any[]