@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.
@@ -0,0 +1,14 @@
1
+ // Installs the Git hooks (npm's prepare script), except where Husky isn't
2
+ // wanted (production, CI) or isn't installed (npm install --omit=dev)
3
+ if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
4
+ process.exit(0);
5
+ }
6
+
7
+ try {
8
+ const { default: husky } = await import('husky');
9
+ console.log(husky());
10
+ } catch (error) {
11
+ if (error.code !== 'ERR_MODULE_NOT_FOUND') {
12
+ throw error;
13
+ }
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperwatch/useragent",
3
- "version": "3.9.1",
3
+ "version": "4.0.0",
4
4
  "description": "User Agent parser",
5
5
  "license": "Apache-2.0",
6
6
  "author": "François Hodierne <francois@hodierne.net>",
@@ -9,46 +9,52 @@
9
9
  "url": "https://github.com/hyperwatch/useragent.git"
10
10
  },
11
11
  "main": "src/useragent.js",
12
+ "files": [
13
+ ".husky/install.mjs",
14
+ "regexes/*.json",
15
+ "regexes/index.js",
16
+ "src"
17
+ ],
12
18
  "scripts": {
13
19
  "depcheck": "depcheck",
14
- "lint": "eslint '**/*.js'",
15
- "lint:fix": "eslint '**/*.js' --fix",
16
- "test": "mocha --recursive",
20
+ "lint": "eslint",
21
+ "lint:fix": "eslint --fix",
22
+ "prepare": "node .husky/install.mjs",
17
23
  "prettier": "prettier \"**/*.@(js|json|md|yml)\"",
18
24
  "prettier:check": "npm run prettier -- --list-different",
19
25
  "prettier:write": "npm run prettier -- --write",
26
+ "test": "mocha --recursive",
20
27
  "update": "node scripts/update && npm run prettier:write"
21
28
  },
22
29
  "dependencies": {
23
- "debug": "^4.3.4",
24
- "lodash": "^4.17.21"
30
+ "debug": "^4.4.3",
31
+ "lodash": "^4.18.1"
25
32
  },
26
33
  "devDependencies": {
27
- "depcheck": "^1.4.3",
28
- "eslint": "^8.25.0",
29
- "eslint-plugin-import": "^2.26.0",
30
- "eslint-plugin-node": "^11.1.0",
31
- "husky": "^4.3.0",
32
- "lint-staged": "^11.1.1",
33
- "mocha": "^10.0.0",
34
- "node-fetch": "^2.6.7",
35
- "prettier": "^2.7.1",
36
- "prettier-package-json": "^2.7.0",
34
+ "@eslint/js": "^10.0.1",
35
+ "depcheck": "^1.4.7",
36
+ "eslint": "^10.12.0",
37
+ "eslint-plugin-import-x": "^4.17.1",
38
+ "eslint-plugin-n": "^18.4.1",
39
+ "globals": "^17.13.0",
40
+ "husky": "^9.1.7",
41
+ "lint-staged": "^17.6.0",
42
+ "mocha": "^12.0.3",
43
+ "prettier": "^3.9.9",
44
+ "prettier-package-json": "^2.8.0",
37
45
  "yamlparser": "0.0.2"
38
46
  },
39
47
  "engines": {
40
- "node": ">=12.0"
48
+ "node": ">=24"
49
+ },
50
+ "allowScripts": {
51
+ "unrs-resolver": false
41
52
  },
42
53
  "depcheck": {
43
54
  "ignores": [
44
55
  "prettier-package-json"
45
56
  ]
46
57
  },
47
- "husky": {
48
- "hooks": {
49
- "pre-commit": "lint-staged"
50
- }
51
- },
52
58
  "lint-staged": {
53
59
  "*.{js,json,md,yml}": [
54
60
  "prettier --write"
package/regexes/core.json CHANGED
@@ -209,12 +209,21 @@
209
209
  {
210
210
  "regex": "(\\w+[\\w \\-\\.]{0,50})\\/(\\d+)?\\.?(\\d+)?\\.?(\\d+)?[\\w~\\-\\+\\. ]*; ?\\+?https?:\\/\\/[A-Za-z0-9\\-\\.\\/]{0,50}"
211
211
  },
212
+ {
213
+ "regex": "^(\\w+[\\w\\-\\.]{0,50})/[A-Za-z]{1,10}\\-(\\d+)\\.(\\d+)\\.?(\\d+)?"
214
+ },
212
215
  {
213
216
  "regex": "^(\\w+[\\w \\-\\.:\\w]{0,50})\\/v?(\\d+)\\.?(\\d+)?\\.?(\\d+)?\\.?(\\d+)?"
214
217
  },
218
+ {
219
+ "regex": "^(\\w+[\\w\\-\\.]{0,50}?)\\-(?:(?=\\d*[a-f])[0-9a-f]{8}|[0-9a-f]{8}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{12})$"
220
+ },
215
221
  {
216
222
  "regex": "^(\\w+[\\w \\-\\.:\\w]{0,50})\\-v?(\\d+)\\.?(\\d+)?\\.?(\\d+)?\\.?(\\d+)?"
217
223
  },
224
+ {
225
+ "regex": "^(\\w+[\\w \\-\\.:\\w]{0,50})\\/[A-Za-z0-9]{0,50}$"
226
+ },
218
227
  {
219
228
  "regex": "^(\\w+[\\w \\-\\.]{0,50})\\/?(\\d+)?\\.?(\\d+)? \\- \\(\\+?https?:\\/\\/[A-Za-z0-9\\-\\.\\/]{0,50}\\)"
220
229
  },
@@ -228,6 +237,9 @@
228
237
  "regex": "^(Pingdom).com_bot_version_(\\d+)\\.(\\d+)",
229
238
  "family_replacement": "PingdomBot"
230
239
  },
240
+ {
241
+ "regex": "^([A-Za-z0-9\\-\\.\\/]{0,50})_bot_(\\d+)\\.(\\d+)"
242
+ },
231
243
  {
232
244
  "regex": "^^(\\w+[\\w \\-\\.]{0,50}) \\- https?:\\/\\/[\\w]+[\\w \\-\\.]{0,50}"
233
245
  },
@@ -276,7 +288,10 @@
276
288
  ],
277
289
  "mozilla5": [
278
290
  {
279
- "regex": "Mozilla/5.0 ([\\w]+[\\w \\-\\.[\\w]+]{0,50})\\/(\\d+)\\.?(\\d+)?"
291
+ "regex": "^Mozilla/5\\.0 \\([^()]{1,100}\\) (\\w+[\\w\\-\\.]{0,50})/(\\d+)\\.?(\\d+)?\\.?(\\d+)?$"
292
+ },
293
+ {
294
+ "regex": "Mozilla/5.0 ([\\w]+[\\w \\-\\.[\\w]+]{0,50})\\/?(\\d+)?\\.?(\\d+)?"
280
295
  },
281
296
  {
282
297
  "regex": "^(Mozilla)/(\\d+)\\.(\\d+)$"