UNPKG

@planjs/utils

Version:

🔧 Common tools collection

18 lines (15 loc) 328 B
import getType from './get-type'; import { isObjectLike } from './is-Object'; /** * 是否为Error类型 * @param value * @category Is */ function isError(value) { if (!isObjectLike(value)) { return false; } var tag = getType(value); return tag === 'Error' || tag === 'DOMException'; } export default isError;