license import { shallowEqualsPartial } from "./internal/utils/shallowEqualsPartial" ; param state param override param addlOverrides export function setWith < S , K extends keyof S > ( state , override , ... addlOverrides ) ; param state param override param addlOverrides export function setWith < S extends Record < string , any > > ( state , override , ... addlOverrides ) ; export function setWith ( state , ... overrides ) { if ( overrides . length === 1 ) { if ( shallowEqualsPartial ( state , overrides [ 0 ] ) ) { return state ; } else { return { ... state , ... overrides [ 0 ] } ; } } else { const result = Object . assign ( { } , state , ... overrides ) ; return shallowEqualsPartial ( state , result ) ? state : result ; } }