mirror of
https://github.com/koel/koel
synced 2024-12-21 01:53:11 +00:00
12 lines
286 B
TypeScript
12 lines
286 B
TypeScript
export const use = <T> (value: T, cb: (arg: T) => void) => {
|
|
if (typeof value === 'undefined' || value === null) {
|
|
return
|
|
}
|
|
|
|
cb(value)
|
|
}
|
|
|
|
export const arrayify = <T> (maybeArray: T | Array<T>) => ([] as Array<T>).concat(maybeArray)
|
|
|
|
// @ts-ignore
|
|
export const noop = () => {}
|