axe 13.0.0 → 14.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/README.md +1 -1
- package/dist/axe.js +897 -105
- package/dist/axe.min.js +1 -1
- package/lib/index.js +38 -26
- package/package.json +25 -25
- package/src/index.js +29 -8
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axe",
|
|
3
3
|
"description": "Axe is a logger-agnostic wrapper that normalizes logs regardless of argument style. Great for large development teams, old and new projects, and works with Pino, Bunyan, Winston, console, and more. It is lightweight, performant, highly-configurable, and automatically adds OS, CPU, and Git information to your logs. It supports hooks (useful for masking sensitive data) and dot-notation remapping, omitting, and picking of log metadata properties. Made for Forward Email, Lad, and Cabin.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "14.0.0",
|
|
5
5
|
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com)",
|
|
6
6
|
"browser": {
|
|
7
7
|
"parse-app-info": false
|
|
@@ -23,50 +23,50 @@
|
|
|
23
23
|
"console-polyfill": "0.3.0",
|
|
24
24
|
"format-specifiers": "^1.0.0",
|
|
25
25
|
"is-buffer": "^2.0.5",
|
|
26
|
-
"is-symbol": "^1.
|
|
26
|
+
"is-symbol": "^1.1.1",
|
|
27
27
|
"iserror": "0.0.2",
|
|
28
28
|
"merge-options": "3.0.4",
|
|
29
|
-
"p-map-series": "2",
|
|
30
29
|
"parse-app-info": "^6.0.0",
|
|
31
30
|
"parse-err": "^1.0.0",
|
|
32
31
|
"pick-deep": "1.0.0",
|
|
33
32
|
"unset-value": "2.0.1"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
|
-
"@babel/cli": "^7.
|
|
37
|
-
"@babel/core": "^7.
|
|
38
|
-
"@babel/preset-env": "^7.
|
|
39
|
-
"@commitlint/cli": "^19.
|
|
40
|
-
"@commitlint/config-conventional": "^19.
|
|
35
|
+
"@babel/cli": "^7.29.7",
|
|
36
|
+
"@babel/core": "^7.29.7",
|
|
37
|
+
"@babel/preset-env": "^7.29.7",
|
|
38
|
+
"@commitlint/cli": "^19.8.1",
|
|
39
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
41
40
|
"ava": "5.3.1",
|
|
42
41
|
"babelify": "^10.0.0",
|
|
43
|
-
"browserify": "^17.0.
|
|
44
|
-
"consola": "^3.2
|
|
42
|
+
"browserify": "^17.0.1",
|
|
43
|
+
"consola": "^3.4.2",
|
|
45
44
|
"cross-env": "^7.0.3",
|
|
46
|
-
"eslint": "8.
|
|
45
|
+
"eslint": "8.57.1",
|
|
47
46
|
"eslint-config-xo-lass": "^2.0.1",
|
|
48
|
-
"eslint-plugin-compat": "
|
|
47
|
+
"eslint-plugin-compat": "6.0.0",
|
|
49
48
|
"eslint-plugin-node": "^11.1.0",
|
|
50
|
-
"express": "^
|
|
49
|
+
"express": "^5.2.1",
|
|
51
50
|
"fixpack": "^4.0.0",
|
|
52
|
-
"husky": "^9.
|
|
53
|
-
"jsdom": "
|
|
54
|
-
"koa": "^2.
|
|
55
|
-
"lint-staged": "^15.2
|
|
56
|
-
"lodash": "^4.
|
|
51
|
+
"husky": "^9.1.7",
|
|
52
|
+
"jsdom": "26",
|
|
53
|
+
"koa": "^3.2.1",
|
|
54
|
+
"lint-staged": "^15.5.2",
|
|
55
|
+
"lodash": "^4.18.1",
|
|
57
56
|
"nyc": "^17.1.0",
|
|
58
|
-
"pino": "
|
|
57
|
+
"pino": "10.1.0",
|
|
59
58
|
"remark-cli": "11.0.0",
|
|
60
59
|
"remark-preset-github": "^4.0.4",
|
|
61
|
-
"rimraf": "^5.0.
|
|
60
|
+
"rimraf": "^5.0.10",
|
|
62
61
|
"signale": "^1.4.0",
|
|
63
|
-
"sinon": "^
|
|
62
|
+
"sinon": "^22.1.0",
|
|
64
63
|
"tinyify": "3.0.0",
|
|
65
|
-
"tsd": "^0.
|
|
66
|
-
"
|
|
64
|
+
"tsd": "^0.33.0",
|
|
65
|
+
"typescript": "5.9.3",
|
|
66
|
+
"xo": "0.60.0"
|
|
67
67
|
},
|
|
68
68
|
"engines": {
|
|
69
|
-
"node": ">=
|
|
69
|
+
"node": ">=18.18"
|
|
70
70
|
},
|
|
71
71
|
"files": [
|
|
72
72
|
"lib",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"lint-build": "npm run lint-lib && npm run lint-dist",
|
|
129
129
|
"lint-dist": "eslint --no-inline-config -c .dist.eslintrc.json dist",
|
|
130
130
|
"lint-lib": "eslint --no-inline-config -c .lib.eslintrc.json lib",
|
|
131
|
-
"minify": "cross-env NODE_ENV=production browserify src/index.js -o dist/axe.min.js -s Axe -g [ babelify --configFile ./.dist.babelrc.json ] -p tinyify",
|
|
131
|
+
"minify": "cross-env NODE_ENV=production browserify src/index.js -o dist/axe.min.js -s Axe -g [ babelify --configFile ./.dist.babelrc.json ] -p [ tinyify --no-flat ]",
|
|
132
132
|
"nyc": "cross-env NODE_ENV=test nyc ava",
|
|
133
133
|
"prepare": "husky install",
|
|
134
134
|
"pretest": "npm run lint",
|
package/src/index.js
CHANGED
|
@@ -10,7 +10,6 @@ const isError = require('iserror');
|
|
|
10
10
|
const isSymbol = require('is-symbol');
|
|
11
11
|
const isBuffer = require('is-buffer');
|
|
12
12
|
const mergeOptions = require('merge-options');
|
|
13
|
-
const pMapSeries = require('p-map-series');
|
|
14
13
|
const parseAppInfo = require('parse-app-info');
|
|
15
14
|
const parseErr = require('parse-err');
|
|
16
15
|
const pickDeep = require('pick-deep');
|
|
@@ -29,6 +28,26 @@ const name =
|
|
|
29
28
|
? false
|
|
30
29
|
: process.env.HOSTNAME || os.hostname();
|
|
31
30
|
|
|
31
|
+
async function mapSeries(iterable, mapper) {
|
|
32
|
+
const values = [...iterable];
|
|
33
|
+
const results = [];
|
|
34
|
+
async function map(index) {
|
|
35
|
+
if (index === values.length) return results;
|
|
36
|
+
results.push(await mapper(values[index]));
|
|
37
|
+
return map(index + 1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return map(0);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function runPostHooks({ hooks, method, err, message, meta, logger }) {
|
|
44
|
+
try {
|
|
45
|
+
return await mapSeries(hooks, (hook) => hook(method, err, message, meta));
|
|
46
|
+
} catch (err_) {
|
|
47
|
+
logger.error(err_);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
32
51
|
// <https://github.com/sindresorhus/is-plain-obj/blob/main/index.js>
|
|
33
52
|
function isPlainObject(value) {
|
|
34
53
|
if (typeof value !== 'object' || value === null) {
|
|
@@ -353,6 +372,7 @@ class Axe {
|
|
|
353
372
|
!isBunyan &&
|
|
354
373
|
originalArgs.length === 3 + modifier &&
|
|
355
374
|
isString(message) &&
|
|
375
|
+
!(meta && meta.is_http) &&
|
|
356
376
|
formatSpecifiers.some((t) => message.indexOf(t) !== -1)
|
|
357
377
|
) {
|
|
358
378
|
// Otherwise if there are three args and if the `message` contains
|
|
@@ -630,13 +650,14 @@ class Axe {
|
|
|
630
650
|
// post-hooks
|
|
631
651
|
if (this.config.hooks.post.length === 0)
|
|
632
652
|
return { method, err, message, meta };
|
|
633
|
-
return
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
653
|
+
return runPostHooks({
|
|
654
|
+
hooks: this.config.hooks.post,
|
|
655
|
+
method,
|
|
656
|
+
err,
|
|
657
|
+
message,
|
|
658
|
+
meta,
|
|
659
|
+
logger: this.config.logger
|
|
660
|
+
});
|
|
640
661
|
}
|
|
641
662
|
}
|
|
642
663
|
|