This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
/**
* react-loadable-ssr-addon
* @author Marcos Gonçalves <contact@themgoncalves.com>
* @version 1.0.1
*/
/**
* Checks if object array already contains given value
* @method hasEntry
* @function
* @param {array} target - Object array to be inspected
* @param {string} targetKey - Object key to look for
* @param {string} searchFor - Value to search existence
* @returns {boolean}
*/
export default function hasEntry(target, targetKey, searchFor) {
if (!target) { return false; }
for (let i = 0; i < target.length; i += 1) {
const file = target[i][targetKey];
if (file === searchFor) { return true; }
}
return false;
}