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

Function extractAppStyleInfo

packages/common/server/parser-user-agent.ts:127–138  ·  view source on GitHub ↗
(ua: string)

Source from the content-addressed store, hash-verified

125
126// Extract app-style UA info (e.g., "Model=Redmi Note 8 Pro; Manufacturer=Xiaomi")
127function extractAppStyleInfo(ua: string): {
128 model?: string;
129 manufacturer?: string;
130} {
131 const modelMatch = ua.match(APP_MODEL_REGEX);
132 const manufacturerMatch = ua.match(APP_MANUFACTURER_REGEX);
133
134 return {
135 model: modelMatch?.[1]?.trim(),
136 manufacturer: manufacturerMatch?.[1]?.trim(),
137 };
138}
139
140// Detect brand from UA string or model name
141function detectBrand(ua: string, model?: string): string | undefined {

Callers 2

parseFunction · 0.85
getDeviceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected