mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
convert appid service to ts
This commit is contained in:
@@ -8,6 +8,15 @@ const AnalyticsIds = {
|
||||
};
|
||||
|
||||
export default class UtilsService {
|
||||
// ref: http://stackoverflow.com/a/2117523/1090359
|
||||
static newGuid(): string {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
||||
const r = Math.random() * 16 | 0;
|
||||
const v = c === 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
|
||||
static extendObject(...objects: any[]): any {
|
||||
for (let i = 1; i < objects.length; i++) {
|
||||
for (const key in objects[i]) {
|
||||
|
||||
Reference in New Issue
Block a user