UNPKG

@augment-vir/common

Version:

A collection of augments, helpers types, functions, and classes for any JavaScript environment.

16 lines (15 loc) 361 B
/** * Wraps the input in an array if it isn't already an array. * * @category Array * @category Package : @augment-vir/common * @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common) */ export function ensureArray(input) { if (Array.isArray(input)) { return input; } else { return [input]; } }