* Converts the current instance to a JSON representation. * * @example Usage * ```ts ignore * import { UserAgent } from "@std/http/user-agent"; * * Deno.serve((req) => { * const userAgent = new UserAgent(req.headers.get("user-agent") ?? ""); * return new Response(`Hello,
()
| 1155 | * @returns A JSON representation on this user agent instance. |
| 1156 | */ |
| 1157 | toJSON(): { |
| 1158 | browser: Browser; |
| 1159 | cpu: Cpu; |
| 1160 | device: Device; |
| 1161 | engine: Engine; |
| 1162 | os: Os; |
| 1163 | ua: string; |
| 1164 | } { |
| 1165 | const { browser, cpu, device, engine, os, ua } = this; |
| 1166 | return { browser, cpu, device, engine, os, ua }; |
| 1167 | } |
| 1168 | |
| 1169 | /** |
| 1170 | * Converts the current instance to a string. |
no outgoing calls
no test coverage detected