@resk/core
Version:
An innovative TypeScript framework that empowers developers to build applications with a fully decorator-based architecture for efficient resource management. By combining the power of decorators with a resource-oriented design, DecorRes enhances code cla
19 lines (18 loc) • 894 B
TypeScript
/**
* Generates a unique identifier.
*
* This function takes three parameters: a prefix, a maximum length, and a separator.
* It generates a unique identifier with the specified prefix, length, and separator.
*
* @param {string} [prefix=""] The prefix to use for the identifier.
* @param {number} [idStrLen=16] The maximum length of the identifier.
* @param {string} [separator=""] The separator to use in the identifier.
* @returns {string} The generated unique identifier.
* @example
* ```typescript
* console.log(uniqid()); // Output: a random unique identifier
* console.log(uniqid("prefix", 16)); // Output: a unique identifier with prefix and length 16
* console.log(uniqid("prefix", 16, "-")); // Output: a unique identifier with prefix, length 16, and separator "-"
* ```
*/
export default function uniqid(prefix: string, idStrLen?: number, separator?: string): string;