CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
uniqueId.js29 linesDownload Raw Back to lodash-es
1import toString from './toString.js';2 3/** Used to generate unique IDs. */4var idCounter = 0;5 6/**7 * Generates a unique ID. If `prefix` is given, the ID is appended to it.8 *9 * @static10 * @since 0.1.011 * @memberOf _12 * @category Util13 * @param {string} [prefix=''] The value to prefix the ID with.14 * @returns {string} Returns the unique ID.15 * @example16 *17 * _.uniqueId('contact_');18 * // => 'contact_104'19 *20 * _.uniqueId();21 * // => '105'22 */23function uniqueId(prefix) {24  var id = ++idCounter;25  return toString(prefix) + id;26}27 28export default uniqueId;29 
basant307/AI_Governance_Project · CoolFace