Initial
This commit is contained in:
18
resources/app/node_modules/localforage/src/utils/includes.js
generated
vendored
Normal file
18
resources/app/node_modules/localforage/src/utils/includes.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
const sameValue = (x, y) =>
|
||||
x === y ||
|
||||
(typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));
|
||||
|
||||
const includes = (array, searchElement) => {
|
||||
const len = array.length;
|
||||
let i = 0;
|
||||
while (i < len) {
|
||||
if (sameValue(array[i], searchElement)) {
|
||||
return true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
export default includes;
|
||||
Reference in New Issue
Block a user