1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-15 15:53:51 +00:00

Add eslint (#610)

This commit is contained in:
Oscar Hinton
2022-02-22 15:39:11 +01:00
committed by GitHub
parent 479d5db5f1
commit 60878cd4ed
333 changed files with 4509 additions and 3043 deletions

View File

@@ -1,13 +1,12 @@
function newGuid() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
// tslint:disable:no-bitwise
const r = (Math.random() * 16) | 0;
const v = c === "x" ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
export function GetUniqueString(prefix: string = "") {
export function GetUniqueString(prefix = "") {
return prefix + "_" + newGuid();
}