* prepare monorepo and move client to its package * create nx workspace * workspace cleanup and updates * upgrade nx workspace and fix client package * add basic codegen logic * first working build script * update nextjs app * update generated code * add koldstart core and client foundation * add basic fetch implementation to client * add stable diffusion example * remove local output image * remove keys * remove more keys * update client usage and samples * remove grpc client code and dependencies * rename base package * remove core package * continue package refactor * rename koldstart apis * refactor main function run api * add listen function stub * removed more koldstart references * build workflow added * minor doc updates - trigger workflow * nx workflow action
22 lines
605 B
TypeScript
22 lines
605 B
TypeScript
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
|
|
export function isBrowser(): boolean {
|
|
return (
|
|
typeof window !== 'undefined' && typeof window.document !== 'undefined'
|
|
);
|
|
}
|
|
|
|
let memoizedUserAgent: string | null = null;
|
|
|
|
export function getUserAgent(): string {
|
|
if (memoizedUserAgent !== null) {
|
|
return memoizedUserAgent;
|
|
}
|
|
const packageInfo = require('../package.json');
|
|
const os = require('os');
|
|
memoizedUserAgent = `${packageInfo.name}/${
|
|
packageInfo.version
|
|
} ${os.platform()}-${os.arch()} ${process.release.name}-${process.version}`;
|
|
return memoizedUserAgent;
|
|
}
|