Skip to content

Commit

Permalink
Use fast-deep-equal
Browse files Browse the repository at this point in the history
  • Loading branch information
kreafox committed Nov 14, 2022
1 parent 97a34a6 commit 2f3fa84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions searchlib/lib/search/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* to facilitate debugging
*/

import deepEqual from 'deep-equal';
import equal from 'fast-deep-equal/es6/react';
import { getDefaultFilters } from '@eeacms/search/lib/utils';

/**
Expand Down Expand Up @@ -112,7 +112,7 @@ export function doFilterValuesMatch(filterValue1, filterValue2) {
getFilterValueDisplay(filterValue2)
);
// We use 'strict = true' to do a '===' of leaves, rather than '=='
return deepEqual(filterValue1, filterValue2, { strict: true });
return equal(filterValue1, filterValue2, { strict: true });
}

// Mix unique filter type from one array into the other
Expand Down Expand Up @@ -173,7 +173,7 @@ export function hasNonDefaultFilters(filters, appConfig) {
...defaultFiltersList.map((f) => ({ [f.field]: f })),
);

return !deepEqual(activeFilters, defaultFilters);
return !equal(activeFilters, defaultFilters);
}

/**
Expand All @@ -191,7 +191,7 @@ export function isFilterValueDefaultValue(filter, appConfig) {
}));
const defaultFilterValue = defaultFiltersList[0];

return deepEqual(filter, defaultFilterValue);
return equal(filter, defaultFilterValue);
}

/**
Expand Down

0 comments on commit 2f3fa84

Please sign in to comment.