OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.
fix(common): handle iPadOS version number
Carl-Gerhard Lindesvärdf43c875b53fb
diff --git a/packages/common/server/parser-user-agent.ts b/packages/common/server/parser-user-agent.tsindex b99d5867b..fe1f6f461 100644--- a/packages/common/server/parser-user-agent.ts+++ b/packages/common/server/parser-user-agent.ts@@ -45,6 +45,20 @@ const parse = (ua: string): UAParser.IResult => {}}+ // Mozilla/5.0 (iPad; iPadOS 18_0; like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/18.0+ if (res.device.model === 'iPad' && !res.os.version) {+ const osVersion = ua.match(/iPadOS\s*([0-9_]+)/i);+ if (osVersion) {+ return {+ ...res,+ os: {+ ...res.os,+ version: osVersion[1]!.replace('_', '.'),+ },+ };+ }+ }+return res;};