CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
_replaceHolders.js30 linesDownload Raw Back to lodash
1/** Used as the internal argument placeholder. */2var PLACEHOLDER = '__lodash_placeholder__';3 4/**5 * Replaces all `placeholder` elements in `array` with an internal placeholder6 * and returns an array of their indexes.7 *8 * @private9 * @param {Array} array The array to modify.10 * @param {*} placeholder The placeholder to replace.11 * @returns {Array} Returns the new array of placeholder indexes.12 */13function replaceHolders(array, placeholder) {14  var index = -1,15      length = array.length,16      resIndex = 0,17      result = [];18 19  while (++index < length) {20    var value = array[index];21    if (value === placeholder || value === PLACEHOLDER) {22      array[index] = PLACEHOLDER;23      result[resIndex++] = index;24    }25  }26  return result;27}28 29module.exports = replaceHolders;30 
basant307/AI_Governance_Project · CoolFace