15 lines
519 B
TypeScript
15 lines
519 B
TypeScript
|
|
|
|
export function createClientId(): string {
|
|
// @ts-expect-error, injected by webpack
|
|
const packageVersion = __CURRENT_VERSION__; // eslint-disable-line
|
|
|
|
const platform =
|
|
typeof navigator !== "undefined"
|
|
? navigator.platform // eslint-disable-line @typescript-eslint/no-deprecated
|
|
: typeof process !== "undefined"
|
|
? process.platform
|
|
: "unknown";
|
|
|
|
return `vault-link/${packageVersion} (${Math.round(Math.random() * 1e10)}; ${platform})`;
|
|
}
|