Urara-Blog/node_modules/.pnpm-store/v3/files/60/29a1ab43ff52b426135d757c14d73a017c1df329dcd14026076298d907e4fa3ad5b4263fda3e70afbedf654232b3a621aafafdb026587cfef07ecbbf079e9b
2022-08-14 01:14:53 +08:00

23 lines
457 B
Text

export function isPlainObject (obj) {
return Object.prototype.toString.call(obj) === '[object Object]'
}
// TODO: remove for consola@3
export function isLogObj (arg) {
// Should be plain object
if (!isPlainObject(arg)) {
return false
}
// Should contains either 'message' or 'args' field
if (!arg.message && !arg.args) {
return false
}
// Handle non-standard error objects
if (arg.stack) {
return false
}
return true
}