@hyperwatch/useragent 3.9.1 → 3.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,38 @@
1
+ {
2
+ "opencollective-2020-11": {
3
+ "total": 1525,
4
+ "hyperwatch": {
5
+ "average": 0.0123,
6
+ "miss": 14,
7
+ "missPercentage": 0.92
8
+ },
9
+ "uap": {
10
+ "average": 0.0745,
11
+ "miss": 40,
12
+ "missPercentage": 2.6
13
+ },
14
+ "combined": {
15
+ "average": 0.0196,
16
+ "miss": 0,
17
+ "missPercentage": 0
18
+ }
19
+ },
20
+ "opencollective-2022-10-14": {
21
+ "total": 2558,
22
+ "hyperwatch": {
23
+ "average": 0.0142,
24
+ "miss": 71,
25
+ "missPercentage": 2.8
26
+ },
27
+ "uap": {
28
+ "average": 0.0692,
29
+ "miss": 111,
30
+ "missPercentage": 4.3
31
+ },
32
+ "combined": {
33
+ "average": 0.0206,
34
+ "miss": 10,
35
+ "missPercentage": 0.39
36
+ }
37
+ }
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperwatch/useragent",
3
- "version": "3.9.1",
3
+ "version": "3.9.3",
4
4
  "description": "User Agent parser",
5
5
  "license": "Apache-2.0",
6
6
  "author": "François Hodierne <francois@hodierne.net>",
package/regexes/core.json CHANGED
@@ -215,6 +215,9 @@
215
215
  {
216
216
  "regex": "^(\\w+[\\w \\-\\.:\\w]{0,50})\\-v?(\\d+)\\.?(\\d+)?\\.?(\\d+)?\\.?(\\d+)?"
217
217
  },
218
+ {
219
+ "regex": "^(\\w+[\\w \\-\\.:\\w]{0,50})\\/[A-Za-z0-9]{0,50}$"
220
+ },
218
221
  {
219
222
  "regex": "^(\\w+[\\w \\-\\.]{0,50})\\/?(\\d+)?\\.?(\\d+)? \\- \\(\\+?https?:\\/\\/[A-Za-z0-9\\-\\.\\/]{0,50}\\)"
220
223
  },
@@ -228,6 +231,9 @@
228
231
  "regex": "^(Pingdom).com_bot_version_(\\d+)\\.(\\d+)",
229
232
  "family_replacement": "PingdomBot"
230
233
  },
234
+ {
235
+ "regex": "^([A-Za-z0-9\\-\\.\\/]{0,50})_bot_(\\d+)\\.(\\d+)"
236
+ },
231
237
  {
232
238
  "regex": "^^(\\w+[\\w \\-\\.]{0,50}) \\- https?:\\/\\/[\\w]+[\\w \\-\\.]{0,50}"
233
239
  },
@@ -276,7 +282,7 @@
276
282
  ],
277
283
  "mozilla5": [
278
284
  {
279
- "regex": "Mozilla/5.0 ([\\w]+[\\w \\-\\.[\\w]+]{0,50})\\/(\\d+)\\.?(\\d+)?"
285
+ "regex": "Mozilla/5.0 ([\\w]+[\\w \\-\\.[\\w]+]{0,50})\\/?(\\d+)?\\.?(\\d+)?"
280
286
  },
281
287
  {
282
288
  "regex": "^(Mozilla)/(\\d+)\\.(\\d+)$"
package/regexes/core.yml CHANGED
@@ -228,6 +228,9 @@ generic:
228
228
  # Example: mattermost-5.26.0
229
229
  - regex: '^(\w+[\w \-\.:\w]{0,50})\-v?(\d+)\.?(\d+)?\.?(\d+)?\.?(\d+)?'
230
230
 
231
+ # Example: GitHub-Hookshot/c02375a
232
+ - regex: '^(\w+[\w \-\.:\w]{0,50})\/[A-Za-z0-9]{0,50}$'
233
+
231
234
  # Example: ltx71 - (http://ltx71.com/)
232
235
  - regex: '^(\w+[\w \-\.]{0,50})\/?(\d+)?\.?(\d+)? \- \(\+?https?:\/\/[A-Za-z0-9\-\.\/]{0,50}\)'
233
236
 
@@ -244,6 +247,9 @@ generic:
244
247
  - regex: '^(Pingdom).com_bot_version_(\d+)\.(\d+)'
245
248
  family_replacement: 'PingdomBot'
246
249
 
250
+ # Example: OnlineOrNot.com_bot_1.0_(https://onlineornot.com):
251
+ - regex: '^([A-Za-z0-9\-\.\/]{0,50})_bot_(\d+)\.(\d+)'
252
+
247
253
  # Example: colly - https://github.com/gocolly/colly/v2
248
254
  - regex: '^^(\w+[\w \-\.]{0,50}) \- https?:\/\/[\w]+[\w \-\.]{0,50}'
249
255
 
@@ -294,7 +300,8 @@ mozilla5_compatible:
294
300
 
295
301
  mozilla5:
296
302
  # Example: Mozilla/5.0 zgrab/0.x
297
- - regex: 'Mozilla/5.0 ([\w]+[\w \-\.[\w]+]{0,50})\/(\d+)\.?(\d+)?'
303
+ # Example: Mozilla/5.0 scpitspi-rs
304
+ - regex: 'Mozilla/5.0 ([\w]+[\w \-\.[\w]+]{0,50})\/?(\d+)?\.?(\d+)?'
298
305
 
299
306
  # Example: Mozilla/5.0
300
307
  - regex: '^(Mozilla)/(\d+)\.(\d+)$'
@@ -45,6 +45,7 @@ function benchmarkSample(filename) {
45
45
  const combinedEnd = process.hrtime.bigint();
46
46
  if (!combinedResult.family) {
47
47
  combinedMisses.push(ua);
48
+ console.warn(`combined miss: ${ua}`);
48
49
  }
49
50
  combinedBenchmark[ua] = Number(combinedEnd - combinedStart) / 1000 / 1000;
50
51
 
@@ -52,6 +53,7 @@ function benchmarkSample(filename) {
52
53
  const hyperwatchResult = useragent.parse(ua, true, true, false);
53
54
  const hyperwatchEnd = process.hrtime.bigint();
54
55
  if (!hyperwatchResult.family) {
56
+ // console.log(`hyperwatch miss: ${ua}`);
55
57
  hyperwatchMisses.push(ua);
56
58
  }
57
59
  hyperwatchBenchmark[ua] =
@@ -61,6 +63,7 @@ function benchmarkSample(filename) {
61
63
  const uapResult = useragent.parse(ua, false, false, true);
62
64
  const uapEnd = process.hrtime.bigint();
63
65
  if (!uapResult.family) {
66
+ // console.log(`uap miss: ${ua}`);
64
67
  uapMisses.push(ua);
65
68
  }
66
69
  uapBenchmark[ua] = Number(uapEnd - uapStart) / 1000 / 1000;
@@ -998,5 +998,35 @@
998
998
  "patch": null,
999
999
  "patch_minor": null
1000
1000
  }
1001
+ ],
1002
+ [
1003
+ "Mozilla/5.0 scpitspi-rs",
1004
+ {
1005
+ "family": "scpitspi-rs",
1006
+ "major": null,
1007
+ "minor": null,
1008
+ "patch": null,
1009
+ "patch_minor": null
1010
+ }
1011
+ ],
1012
+ [
1013
+ "GitHub-Hookshot/c02375a",
1014
+ {
1015
+ "family": "GitHub-Hookshot",
1016
+ "major": null,
1017
+ "minor": null,
1018
+ "patch": null,
1019
+ "patch_minor": null
1020
+ }
1021
+ ],
1022
+ [
1023
+ "OnlineOrNot.com_bot_1.0_(https://onlineornot.com)",
1024
+ {
1025
+ "family": "OnlineOrNot.com",
1026
+ "major": "1",
1027
+ "minor": "0",
1028
+ "patch": null,
1029
+ "patch_minor": null
1030
+ }
1001
1031
  ]
1002
1032
  ]