undevice / undevice
Function: undevice()
undevice<
T>(extensions?):Readonly<{detect: (options) =>UndeviceResult<T>; }>
Defined in: undevice.ts:19
Creates a reusable detector with optional custom boolean flags. Each call to detect returns a new frozen result for the supplied request.
Type Parameters
T
T extends Extensions = Record<never, never>
Parameters
extensions?
T
Named callbacks, substring arrays, or checks with exclusions.
Returns
Readonly<{ detect: (options) => UndeviceResult<T>; }>
Example
ts
const { detect } = undevice({ isRawClient: ['curl', 'wget'] })
const device = detect({ userAgent: 'curl/8.0' })