3rd-Eden / useragent

Useragent parser for Node.js, ported from browserscope.org
MIT License
899 stars 138 forks source link

Wrong value for the patch Agent property #133

Closed orestisioakeimidis closed 2 years ago

orestisioakeimidis commented 5 years ago

The parse method of the agent is giving the wrong value for the patch property when using the following user agent string.

User agent

Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/7.0.4 Mobile/16A404 Safari/605.1.15

Result

Agent {
  family: 'Firefox iOS',
  major: '7',
  minor: '0',
  patch: '.4', <--
  source: 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/7.0.4 Mobile/16A404 Safari/605.1.15'
}

Expected

Agent {
  family: 'Firefox iOS',
  major: '7',
  minor: '0',
  patch: '4', <--
  source: 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/7.0.4 Mobile/16A404 Safari/605.1.15'
}