mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
159c54ed37
* refactor: show save button before using the dropdown * refactor: simplify FeatureSettingsProject toast message * refactor: fix FeatureProjectSelect filter prop type * refactor: hide change project page for non-enterprise * refactor: derive move targets from projects list instead of from permissions * refactor: align frontend project compat check with backend * refactor: fix useProject object stability * refactor: disable the save button for the current project * refactor: require equal environments when moving toggles * refactor: improve arraysHaveSameItems name
13 lines
273 B
TypeScript
13 lines
273 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);
|
|
});
|
|
};
|