UNPKG

@gecut/utilities

Version:

The ultimate utility toolkit from Gecut Company, crafted with TypeScript for optimal speed and efficiency. Designed to boost productivity with a suite of fast and optimized tools.

7 lines 467 B
import { randomNumber } from './number'; export const isArray = (value) => Array.isArray(value); export const sanitize = (array) => array.filter((item, index) => array.indexOf(item) === index); export const range = (count) => Array.from({ length: count }, (_, i) => i + 1); export const joinString = (separator = ' ', ...values) => values.map(String).join(separator); export const choose = (arr) => arr[randomNumber(arr.length - 1)]; //# sourceMappingURL=array.js.map