fal-js/libs/client/src/runtime.ts
Daniel Rochetti 6553779987
chore: configure new monorepo and build workflow
* 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
2023-03-29 12:49:55 -03:00

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;
}