Permalink
Cannot retrieve contributors at this time
28 lines (25 sloc)
562 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/lodash/uniqueId.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var toString = require('./toString'); | |
/** Used to generate unique IDs. */ | |
var idCounter = 0; | |
/** | |
* Generates a unique ID. If `prefix` is given, the ID is appended to it. | |
* | |
* @static | |
* @since 0.1.0 | |
* @memberOf _ | |
* @category Util | |
* @param {string} [prefix=''] The value to prefix the ID with. | |
* @returns {string} Returns the unique ID. | |
* @example | |
* | |
* _.uniqueId('contact_'); | |
* // => 'contact_104' | |
* | |
* _.uniqueId(); | |
* // => '105' | |
*/ | |
function uniqueId(prefix) { | |
var id = ++idCounter; | |
return toString(prefix) + id; | |
} | |
module.exports = uniqueId; |