export const use = (value: T, cb: (arg: T) => void) => { if (typeof value === 'undefined' || value === null) { return } cb(value) } export const arrayify = (maybeArray: T | Array) => ([] as Array).concat(maybeArray) // @ts-ignore export const noop = () => { } export const limitBy = (arr: T[], count: number, offset: number = 0): T[] => arr.slice(offset, offset + count)