@hyperwatch/useragent 3.9.1 → 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.
@@ -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
- ]