mirror of
https://github.com/Unleash/unleash.git
synced 2024-11-01 19:07:38 +01:00
8c1d4838b8
* fix: apply query from checkProjectsCompatibility * fix: require equal environments when moving toggles * refactor: clean up project service tests * refactor: add test for project compatibility check * refactor: improve arraysHaveSameItems name
13 lines
275 B
TypeScript
13 lines
275 B
TypeScript
export const arraysHaveSameItems = <T>(a: T[], b: T[]): boolean => {
|
|
const setA = new Set(a);
|
|
const setB = new Set(b);
|
|
|
|
if (setA.size !== setB.size) {
|
|
return false;
|
|
}
|
|
|
|
return [...setA].every((itemA) => {
|
|
return setB.has(itemA);
|
|
});
|
|
};
|