beautiful-error
Version:
💣 Prettify error messages and stacks 💥
20 lines (13 loc) • 335 B
JavaScript
import{excludeKeys}from"filter-obj";
export const applyDefaultOpts=(opts={})=>({
...DEFAULT_OPTS,
...removeUndefined(opts)
});
export const DEFAULT_OPTS={
stack:true,
props:true,
icon:"cross",
header:"red bold"
};
const removeUndefined=(object)=>excludeKeys(object,isUndefined);
const isUndefined=(key,value)=>value===undefined;