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/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": "13.0.0",
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.0.4",
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.25.9",
37
- "@babel/core": "^7.26.0",
38
- "@babel/preset-env": "^7.26.0",
39
- "@commitlint/cli": "^19.6.0",
40
- "@commitlint/config-conventional": "^19.6.0",
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.0",
44
- "consola": "^3.2.3",
42
+ "browserify": "^17.0.1",
43
+ "consola": "^3.4.2",
45
44
  "cross-env": "^7.0.3",
46
- "eslint": "8.49.0",
45
+ "eslint": "8.57.1",
47
46
  "eslint-config-xo-lass": "^2.0.1",
48
- "eslint-plugin-compat": "^4.2.0",
47
+ "eslint-plugin-compat": "6.0.0",
49
48
  "eslint-plugin-node": "^11.1.0",
50
- "express": "^4.21.1",
49
+ "express": "^5.2.1",
51
50
  "fixpack": "^4.0.0",
52
- "husky": "^9.0.11",
53
- "jsdom": "15",
54
- "koa": "^2.15.3",
55
- "lint-staged": "^15.2.10",
56
- "lodash": "^4.17.21",
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": "^9.5.0",
57
+ "pino": "10.1.0",
59
58
  "remark-cli": "11.0.0",
60
59
  "remark-preset-github": "^4.0.4",
61
- "rimraf": "^5.0.5",
60
+ "rimraf": "^5.0.10",
62
61
  "signale": "^1.4.0",
63
- "sinon": "^18.0.0",
62
+ "sinon": "^22.1.0",
64
63
  "tinyify": "3.0.0",
65
- "tsd": "^0.31.2",
66
- "xo": "0.56.0"
64
+ "tsd": "^0.33.0",
65
+ "typescript": "5.9.3",
66
+ "xo": "0.60.0"
67
67
  },
68
68
  "engines": {
69
- "node": ">=14"
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 pMapSeries(this.config.hooks.post, (hook) =>
634
- hook(method, err, message, meta)
635
- )
636
- .then()
637
- .catch((err) => {
638
- this.config.logger.error(err);
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