import * as ld from "lodash" ; import { sortArray } from "./sort_arrays" ; const sorted = Symbol ( ) ; function compareArrays ( x , y ) { if ( ! ld . isArray ( x ) ) return ; if ( ! ld . isArray ( y ) ) return ; if ( ( x as any ) [ sorted ] && ( y as any ) [ sorted ] ) return ; if ( x . length !== y . length ) return false ; const xClone = ld . cloneDeep ( x ) ; const yClone = ld . cloneDeep ( y ) ; sortArray ( xClone ) ; sortArray ( yClone ) ; ( xClone as any ) [ sorted ] = true ; ( yClone as any ) [ sorted ] = true ; return ld . isEqualWith ( xClone , yClone , compareArrays ) ; } param obj param other export function isEqualUnorderedArrays ( obj , other ) { return ld . isEqualWith ( obj , other , compareArrays ) ; }