@qiwi/semantic-release-gh-pages-plugin
Version:
gh-pages publishing plugin for semantic-release
15 lines (12 loc) • 326 B
text/typescript
import { ICallable } from '@qiwi/substrate'
export const catchToSmth = (fn: ICallable, smth?: any) => {
return (...args: any[]) => {
try {
return fn(...args)
} catch (e) {
console.warn(e)
return smth
}
}
}
export const anyDefined = (...args: any[]) => args.find(item => item !== undefined)