@hyperwatch/useragent 3.9.3 → 4.0.0
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.
- package/.husky/install.mjs +14 -0
- package/package.json +28 -22
- package/regexes/core.json +9 -0
- package/regexes/uap-core-agent.json +349 -27
- package/regexes/uap-core-device.json +56 -8
- package/regexes/uap-core-os.json +72 -5
- package/src/useragent.js +2 -3
- package/.eslintrc.json +0 -75
- package/.prettierrc +0 -4
- package/data/benchmark-results.json +0 -38
- package/docs/API.md +0 -178
- package/regexes/core.yml +0 -359
- package/regexes/extra.yml +0 -68
- package/regexes/first.yml +0 -12
- package/regexes/uap-core.yml +0 -5799
- package/scripts/compare-hyperwatch-uap.js +0 -95
- package/scripts/sample-benchmark.js +0 -102
- package/scripts/sample-parse.js +0 -37
- package/scripts/update.js +0 -67
- package/test/lib/useragent-combined.js +0 -31
- package/test/lib/useragent-combined.json +0 -12
- package/test/lib/useragent-core.js +0 -31
- package/test/lib/useragent-core.json +0 -1032
- package/test/lib/useragent-extra.js +0 -31
- package/test/lib/useragent-extra.json +0 -92
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/* eslint-env mocha */
|
|
2
|
-
|
|
3
|
-
const assert = require('assert');
|
|
4
|
-
|
|
5
|
-
const { pick } = require('lodash');
|
|
6
|
-
|
|
7
|
-
const useragent = require('../../src/useragent');
|
|
8
|
-
|
|
9
|
-
const tests = require('./useragent-extra.json');
|
|
10
|
-
|
|
11
|
-
const fields = ['family', 'major', 'minor', 'patch', 'patch_minor'];
|
|
12
|
-
|
|
13
|
-
describe('useragent extra', () => {
|
|
14
|
-
for (const [ua, json] of tests) {
|
|
15
|
-
it(`should parse ${ua}`, () => {
|
|
16
|
-
const agent = useragent.parse(ua, true, true, false);
|
|
17
|
-
assert.deepStrictEqual(pick(agent.toJSON(), fields), json);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
it('should re-construct from JSON', () => {
|
|
22
|
-
for (const [ua] of tests) {
|
|
23
|
-
const agentJson = useragent.parse(ua, true, true, false).toJSON();
|
|
24
|
-
const agent = useragent.fromJSON(agentJson);
|
|
25
|
-
assert.deepStrictEqual(
|
|
26
|
-
pick(agent.toJSON(), fields),
|
|
27
|
-
pick(agentJson, fields)
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/69.0.3494.0 Safari/537.36 WordPress.com mShots",
|
|
4
|
-
{
|
|
5
|
-
"family": "WordPress.com mShots",
|
|
6
|
-
"major": null,
|
|
7
|
-
"minor": null,
|
|
8
|
-
"patch": null,
|
|
9
|
-
"patch_minor": null
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
[
|
|
13
|
-
"Mozilla/5.0 (Windows NT 6.1; WOW64) SkypeUriPreview Preview/0.5",
|
|
14
|
-
{
|
|
15
|
-
"family": "SkypeUriPreview",
|
|
16
|
-
"major": null,
|
|
17
|
-
"minor": null,
|
|
18
|
-
"patch": null,
|
|
19
|
-
"patch_minor": null
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
[
|
|
23
|
-
"Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)",
|
|
24
|
-
{
|
|
25
|
-
"family": "GoogleImageProxy",
|
|
26
|
-
"major": null,
|
|
27
|
-
"minor": null,
|
|
28
|
-
"patch": null,
|
|
29
|
-
"patch_minor": null
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
[
|
|
33
|
-
"Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via Fastmail)",
|
|
34
|
-
{
|
|
35
|
-
"family": "Fastmail",
|
|
36
|
-
"major": null,
|
|
37
|
-
"minor": null,
|
|
38
|
-
"patch": null,
|
|
39
|
-
"patch_minor": null
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
[
|
|
43
|
-
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36 Google Favicon",
|
|
44
|
-
{
|
|
45
|
-
"family": "Google Favicon",
|
|
46
|
-
"major": null,
|
|
47
|
-
"minor": null,
|
|
48
|
-
"patch": null,
|
|
49
|
-
"patch_minor": null
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
[
|
|
53
|
-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36; 360Spider",
|
|
54
|
-
{
|
|
55
|
-
"family": "360Spider",
|
|
56
|
-
"major": null,
|
|
57
|
-
"minor": null,
|
|
58
|
-
"patch": null,
|
|
59
|
-
"patch_minor": null
|
|
60
|
-
}
|
|
61
|
-
],
|
|
62
|
-
[
|
|
63
|
-
"Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)",
|
|
64
|
-
{
|
|
65
|
-
"family": "GoogleImageProxy",
|
|
66
|
-
"major": null,
|
|
67
|
-
"minor": null,
|
|
68
|
-
"patch": null,
|
|
69
|
-
"patch_minor": null
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
[
|
|
73
|
-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.4000.0 Iron Safari/537.36",
|
|
74
|
-
{
|
|
75
|
-
"family": "Iron",
|
|
76
|
-
"major": "77",
|
|
77
|
-
"minor": "0",
|
|
78
|
-
"patch": "4000",
|
|
79
|
-
"patch_minor": null
|
|
80
|
-
}
|
|
81
|
-
],
|
|
82
|
-
[
|
|
83
|
-
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 SketchUp Pro/20.2 (Mac) Safari/537.36",
|
|
84
|
-
{
|
|
85
|
-
"family": "SketchUp Pro",
|
|
86
|
-
"major": "20",
|
|
87
|
-
"minor": "2",
|
|
88
|
-
"patch": null,
|
|
89
|
-
"patch_minor": null
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
]
|