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