UNPKG

modern-errors-serialize

Version:
24 lines (18 loc) 450 B
import{validateOptions}from"error-serializer"; import isPlainObject from"is-plain-obj"; export const getOptions=(options={})=>{ validateOptions(options); return options }; export const isOptions=(value)=> isPlainObject(value)&&Object.keys(value).every(isOptionKey); const isOptionKey=(key)=>OPTIONS_KEYS.has(key); const OPTIONS_KEYS=new Set([ "loose", "shallow", "include", "exclude", "transformObject", "transformArgs", "transformInstance"] );