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[], n: number, offset: number = 0): T[] => arr.slice(offset, offset + n)