UNPKG

@charpeni/one-of

Version:

Type-safe utilities to return a random element from an array or random entry from an object

14 lines (12 loc) 307 B
//#region src/isArray.ts /** * Wrapper around `Array.isArray` to check if the input is an array, * but with a type guard rather than `any[]`. * * See: https://github.com/microsoft/TypeScript/issues/17002. */ function isArray(input) { return Array.isArray(input); } //#endregion exports.isArray = isArray;