mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
* ensure that eslint runs on all frontend code * remove tslint from `design-system` * enable prettier and eslint-prettier for `design-system` * Delete tslint.json * use a single editorconfig for the repo * enable prettier for all code in `design-system` * more linting fixes on design-system * ignore coverage for git and prettier * lintfix on editor-ui
9 lines
310 B
TypeScript
9 lines
310 B
TypeScript
/**
|
|
* Math.random should be unique because of its seeding algorithm.
|
|
* Convert it to base 36 (numbers + letters), and grab the first 9 characters after the decimal.
|
|
*
|
|
*/
|
|
export function uid(baseId?: string): string {
|
|
return `${baseId ? `${baseId}-` : ''}${Math.random().toString(36).substring(2, 11)}`;
|
|
}
|