MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / detectBrand

Function detectBrand

packages/common/server/parser-user-agent.ts:141–149  ·  view source on GitHub ↗
(ua: string, model?: string)

Source from the content-addressed store, hash-verified

139
140// Detect brand from UA string or model name
141function detectBrand(ua: string, model?: string): string | undefined {
142 const searchString = `${ua} ${model || ''}`;
143 for (const { pattern, brand } of BRAND_PATTERNS) {
144 if (pattern.test(searchString)) {
145 return brand;
146 }
147 }
148 return undefined;
149}
150
151// Check if a model name indicates a phone (not tablet)
152function isKnownPhoneModel(model?: string): boolean {

Callers 2

parseFunction · 0.85
getDeviceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected