UNPKG

siliconflow-serverless-client

Version:

![@siliconflow/siliconflow-js npm package](https://img.shields.io/npm/v/@siliconflow/siliconflow-js?color=%25237527D7&label=@siliconflow/siliconflow-js&style=flat-square)

19 lines (15 loc) 514 B
/* 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'); memoizedUserAgent = `${packageInfo.name}/${packageInfo.version}`; return memoizedUserAgent; }