export const areArrayEqual = ( arr1 , arr2 , searchingKeys ) => { if ( arr1 . length !== arr2 . length ) { return false ; } let index = 0 ; let isSimilar = true ; while ( isSimilar && index < arr1 . length ) { if ( searchingKeys ) { isSimilar = searchingKeys . reduce < boolean > ( ( acc , key ) => acc && arr1 [ index ] [ key ] === arr2 [ index ] [ key ] , true ) ; } else { isSimilar = arr1 [ index ] === arr2 [ index ] ; } index ++ ; } return isSimilar ; } ; export const arrayInclude = ( arr , searchingObject ) => arr . some ( element => { return Object . entries ( searchingObject ) . reduce < boolean > ( ( acc , [ key , value ] ) => acc && element [ key ] === value , true ) ; } ) ; export const areMapEqual = ( map1 , map2 ) => { if ( map1 . size !== map2 . size ) { return false ; } let isSimilar = true ; map1 . forEach ( ( value , key ) => { isSimilar = map2 . has ( key ) && map2 . get ( key ) === value ; } ) ; return isSimilar ; } ;