UNPKG

@hayspec/spec

Version:

Core logic for Hayspec framework.

18 lines (17 loc) 263 B
/** * */ export default function throws (fn: () => any) { try { const res = fn(); if (res instanceof Promise) { return res.then(() => false).catch(() => true); } else { return false; } } catch (e) { return true; } }