MCPcopy Create free account
hub / github.com/bunnyxt/lcid / compareStringArray

Function compareStringArray

src/components/ProblemsTable.jsx:126–141  ·  view source on GitHub ↗
(arr1, arr2)

Source from the content-addressed store, hash-verified

124 }, []);
125
126 const compareStringArray = (arr1, arr2) => {
127 if (typeof(arr1) !== 'string' || typeof(arr2) !== 'string') {
128 return false;
129 }
130 if (arr1.length !== arr2.length) {
131 return false;
132 }
133 const arr1_sorted = [...arr1].sort();
134 const arr2_sorted = [...arr2].sort();
135 for (let i = 0; i < arr1_sorted.length; i++) {
136 if (arr1_sorted[i] !== arr2_sorted[i]) {
137 return false;
138 }
139 }
140 return true;
141 };
142
143 const handleChange = (_, filters) => {
144 if (!compareStringArray(filters.difficulty, filteredDifficulty)) {

Callers 1

handleChangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected