MultiLoader-Template/node_modules/es-toolkit/dist/compat/util/uniqueId.d.mts
3944Realms 768f38fc97 feat: 可使用的构建模板
修改了脚本,使其可以推给Maven仓库
2026-05-03 13:02:19 +08:00

26 lines
825 B
TypeScript

/**
* Generates a unique identifier, optionally prefixed with a given string.
*
* @param {string} [prefix] - An optional string to prefix the unique identifier.
* If not provided or not a string, only the unique
* numeric identifier is returned.
* @returns {string} A string containing the unique identifier, with the optional
* prefix if provided.
*
* @example
* // Generate a unique ID with a prefix
* uniqueId('user_'); // => 'user_1'
*
* @example
* // Generate a unique ID without a prefix
* uniqueId(); // => '2'
*
* @example
* // Subsequent calls increment the internal counter
* uniqueId('item_'); // => 'item_3'
* uniqueId(); // => '4'
*/
declare function uniqueId(prefix?: string): string;
export { uniqueId };