import deepmerge from "deepmerge" ; function isObject ( val ) { return ( val != null && typeof val === "object" && Object . prototype . toString . call ( val ) === "[object Object]" ) ; } function isPlainObject ( o ) { if ( Array . isArray ( o ) === true ) { return true ; } if ( isObject ( o ) === false ) { return false ; } const ctor = o . constructor ; if ( typeof ctor !== "function" ) { return false ; } const prot = ctor . prototype ; if ( isObject ( prot ) === false ) { return false ; } if ( prot . hasOwnProperty ( "isPrototypeOf" ) === false ) { return false ; } return true ; } function combineMerge ( target , source ) { return target . concat ( source ) ; } function overwriteMerge ( target , source ) { target = source ; return target ; } export function overrideProps ( DefaultProps , userProps , concatArray = false ) { if ( concatArray ) { return deepmerge ( DefaultProps , userProps , { arrayMerge : combineMerge , isMergeableObject : isPlainObject , } ) ; } else { return deepmerge ( DefaultProps , userProps , { arrayMerge : overwriteMerge , isMergeableObject : isPlainObject , } ) ; } }