Socket
Socket
Sign inDemoInstall

axe

Package Overview
Dependencies
Maintainers
3
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axe - npm Package Compare versions

Comparing version 10.0.4 to 10.1.0

80

dist/axe.js

@@ -783,2 +783,52 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Axe = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){

},{"is-plain-obj":14}],20:[function(require,module,exports){
exports.endianness = function () {
return 'LE';
};
exports.hostname = function () {
if (typeof location !== 'undefined') {
return location.hostname;
} else return '';
};
exports.loadavg = function () {
return [];
};
exports.uptime = function () {
return 0;
};
exports.freemem = function () {
return Number.MAX_VALUE;
};
exports.totalmem = function () {
return Number.MAX_VALUE;
};
exports.cpus = function () {
return [];
};
exports.type = function () {
return 'Browser';
};
exports.release = function () {
if (typeof navigator !== 'undefined') {
return navigator.appVersion;
}
return '';
};
exports.networkInterfaces = exports.getNetworkInterfaces = function () {
return {};
};
exports.arch = function () {
return 'javascript';
};
exports.platform = function () {
return 'browser';
};
exports.tmpdir = exports.tmpDir = function () {
return '/tmp';
};
exports.EOL = '\n';
exports.homedir = function () {
return '/';
};
},{}],21:[function(require,module,exports){
'use strict';

@@ -799,3 +849,3 @@

},{}],21:[function(require,module,exports){
},{}],22:[function(require,module,exports){
"use strict";

@@ -822,3 +872,3 @@

},{"iserror":15}],22:[function(require,module,exports){
},{"iserror":15}],23:[function(require,module,exports){
'use strict';

@@ -858,3 +908,3 @@

},{"@strikeentco/get":2,"@strikeentco/set":3}],23:[function(require,module,exports){
},{"@strikeentco/get":2,"@strikeentco/set":3}],24:[function(require,module,exports){
// shim for using process in browser

@@ -1036,3 +1086,3 @@ var process = module.exports = {};

},{}],24:[function(require,module,exports){
},{}],25:[function(require,module,exports){
/*!

@@ -1082,7 +1132,7 @@ * unset-value <https://github.com/jonschlinkert/unset-value>

},{"has-value":12,"isobject":16}],25:[function(require,module,exports){
},{"has-value":12,"isobject":16}],26:[function(require,module,exports){
module.exports={
"name": "axe",
"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.",
"version": "10.0.4",
"version": "10.1.0",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com)",

@@ -1220,6 +1270,7 @@ "browser": {

},{}],26:[function(require,module,exports){
},{}],27:[function(require,module,exports){
(function (process){(function (){
// eslint-disable-next-line import/no-unassigned-import
require('console-polyfill');
const os = require('os');
const combine = require('maybe-combine-errors');

@@ -1248,2 +1299,3 @@ const format = require('@ladjs/format-util');

const levelError = `\`level\` invalid, must be: ${levels.join(', ')}`;
const name = process.env.NODE_ENV === 'development' ? false : process.env.HOSTNAME || os.hostname();

@@ -1320,3 +1372,3 @@ // <https://github.com/sindresorhus/is-plain-obj/blob/main/index.js>

logger: console,
name: false,
name,
level: 'info',

@@ -1545,2 +1597,7 @@ levels: ['info', 'warn', 'error', 'fatal'],

// pre-hooks
for (const hook of this.config.hooks.pre) {
[err, message, meta] = hook(method, err, message, meta);
}
//

@@ -1622,7 +1679,2 @@ // NOTE: using lodash _.omit and _.pick would have been _very slow_

// pre-hooks
for (const hook of this.config.hooks.pre) {
[err, message, meta] = hook(method, err, message, meta);
}
// only invoke logger methods if it was not silent

@@ -1653,3 +1705,3 @@ if (!config.silent) {

}).call(this)}).call(this,require('_process'))
},{"../package.json":25,"@ladjs/format-util":1,"@strikeentco/get":2,"@strikeentco/set":3,"_process":23,"boolean":5,"console-polyfill":8,"format-specifiers":9,"iserror":15,"maybe-combine-errors":18,"merge-options":19,"p-map-series":20,"parse-app-info":7,"parse-err":21,"pick-deep":22,"unset-value":24}]},{},[26])(26)
},{"../package.json":26,"@ladjs/format-util":1,"@strikeentco/get":2,"@strikeentco/set":3,"_process":24,"boolean":5,"console-polyfill":8,"format-specifiers":9,"iserror":15,"maybe-combine-errors":18,"merge-options":19,"os":20,"p-map-series":21,"parse-app-info":7,"parse-err":22,"pick-deep":23,"unset-value":25}]},{},[27])(27)
});

2

dist/axe.min.js

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Axe=e()}}((function(){!function(e){"use strict";e.console||(e.console={});for(var t,r,n=e.console,o=function(){},i=["memory"],s="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=i.pop();)n[t]||(n[t]={});for(;r=s.pop();)n[r]||(n[r]=o)}("undefined"==typeof window?this:window);const e=Symbol("kErrors");class t extends Error{constructor(t){const o=new Set(t.map(i).filter(Boolean));super(Array.from(o).join("; ")),r(this,"name","CombinedError"),r(this,e,t),n(this,"stack",()=>t.map(s).join("\n\n")),n(this,"transient",()=>t.length>0&&t.every(c)),n(this,"expected",()=>t.length>0&&t.every(a))}[Symbol.iterator](){return this[e][Symbol.iterator]()}}function r(e,t,r){Object.defineProperty(e,t,{value:r})}function n(e,t,r){Object.defineProperty(e,t,{get:r})}function o(e){return null!=e}function i(e){return e.message}function s(e){return e.stack}function c(e){return!0===e.transient}function a(e){return!0===e.expected}var f=function(e){var t=Array.prototype.slice.call(arguments,1);return t.length&&(e=e.toString().replace(/(%?)(%([jds]))/g,(function(e,r,n,o){var i=t.shift();switch(o){case"s":i=""+i;break;case"d":i=Number(i);break;case"j":i=JSON.stringify(i)}return r?(t.unshift(i),e):i}))),t.length&&(e=e.toString()+" "+t.join(" ")),""+e.toString().replace(/%{2,2}/g,"%")},l=["%s","%d","%i","%f","%j","%o","%O","%%"],u=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(n=e,"[object Object]"!==Object.prototype.toString.call(n)||!t)return e;var n;const o=Array.isArray(t)?t:String(t).split(r),{length:i}=o;return i<2?e[o[0]]:((e,t,r)=>{for(let n=0;n<r;n++){if(null===e)return;const r=e[t[n]];if(void 0===r)return;e=r}return e})(e,o,i)},g=function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}},p=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype};const{hasOwnProperty:h}=Object.prototype,{propertyIsEnumerable:y}=Object,d=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),b=this,m={concatArrays:!1,ignoreUndefined:!1},v=e=>{const t=[];for(const r in e)h.call(e,r)&&t.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(e);for(const n of r)y.call(e,n)&&t.push(n)}return t};function A(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return v(e).forEach(r=>{d(t,r,A(e[r]))}),t}(e):p(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return v(e).forEach(r=>{d(t,r,A(e[r]))}),t}(e):e}const j=(e,t,r,n)=>(r.forEach(r=>{void 0===t[r]&&n.ignoreUndefined||(r in e&&e[r]!==Object.getPrototypeOf(e)?d(e,r,O(e[r],t[r],n)):d(e,r,A(t[r])))}),e);function O(e,t,r){return r.concatArrays&&Array.isArray(e)&&Array.isArray(t)?((e,t,r)=>{let n=e.slice(0,0),o=0;return[e,t].forEach(t=>{const i=[];for(let r=0;r<t.length;r++)h.call(t,r)&&(i.push(String(r)),d(n,o++,t===e?t[r]:A(t[r])));n=j(n,t,v(t).filter(e=>!i.includes(e)),r)}),n})(e,t,r):p(t)&&p(e)?j(e,t,v(t),r):A(t)}var w={};const E=async(e,t)=>{const r=[];let n=0;for(const o of e)r.push(await t(await o,n++));return r};(w=E).default=E;var S={},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!g(e))throw new Error("`err` must be an Error");if(!Array.isArray(t))throw new Error("`fields` must be an Array");var r={};return Object.getOwnPropertyNames(Object.getPrototypeOf(e)).concat(Object.getOwnPropertyNames(e)).forEach((function(t){"function"!=typeof e[t]&&(r[t]=e[t])})),!r.name&&e.constructor.name&&(r.name=e.constructor.name),Array.isArray(t)&&0!==t.length?r.filter((function(e){return t.includes(e)})):r};const T=e=>"object"==typeof e||"function"==typeof e,k=(e,t)=>"__proto__"==e||"constructor"==e&&"function"==typeof t.constructor;var P=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".";if(!T(e)||!t||!t.length)return e;const o=Array.isArray(t)?t:String(t).split(n);if(k(o[0],e))return e;const{length:i}=o;return 1===i?(e[o[0]]=r,e):((e,t,r,n)=>{let o=e,i=0;for(;i<r-1;i++){const e=t[i];k(e,o)||(o=T(o[e])?o[e]:o[e]={})}return o[t[i]]=n,e})(e,o,i,r)},x=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)};function I(e,t,r){return"function"==typeof r.join?r.join(e):e[0]+t+e[1]}function L(e,t,r){return"function"!=typeof r.isValid||r.isValid(e,t)}function F(e){return x(e)||Array.isArray(e)||"function"==typeof e}var M=Object.prototype.toString;function N(e){return"function"==typeof e.constructor?e.constructor.name:null}var C=function e(t){switch(function(e){if(void 0===e)return"undefined";if(null===e)return"null";var t=typeof e;if("boolean"===t)return"boolean";if("string"===t)return"string";if("number"===t)return"number";if("symbol"===t)return"symbol";if("function"===t)return"GeneratorFunction"===N(e)?"generatorfunction":"function";if(function(e){return Array.isArray?Array.isArray(e):e instanceof Array}(e))return"array";if(function(e){return!(!e.constructor||"function"!=typeof e.constructor.isBuffer)&&e.constructor.isBuffer(e)}(e))return"buffer";if(function(e){try{if("number"==typeof e.length&&"function"==typeof e.callee)return!0}catch(t){if(-1!==t.message.indexOf("callee"))return!0}return!1}(e))return"arguments";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";if(function(e){return e instanceof RegExp||"string"==typeof e.flags&&"boolean"==typeof e.ignoreCase&&"boolean"==typeof e.multiline&&"boolean"==typeof e.global}(e))return"regexp";switch(N(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(e){return"function"==typeof e.throw&&"function"==typeof e.return&&"function"==typeof e.next}(e))return"generator";switch(t=M.call(e)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}(t)){case"boolean":case"date":case"function":case"null":case"number":return!0;case"undefined":return!1;case"regexp":return"(?:)"!==t.source&&""!==t.source;case"buffer":return""!==t.toString();case"error":return""!==t.message;case"string":case"arguments":return 0!==t.length;case"file":case"map":case"set":return 0!==t.size;case"array":case"object":for(const r of Object.keys(t))if(e(t[r]))return!0;return!1;default:return!0}},D=function(e,t,r){return!(null==(n=e)||"object"!=typeof n&&"function"!=typeof n&&!Array.isArray(n)||"string"!=typeof t&&!Array.isArray(t))&&C(function(e,t,r){if(x(r)||(r={default:r}),!F(e))return void 0!==r.default?r.default:e;"number"==typeof t&&(t=String(t));const n=Array.isArray(t),o="string"==typeof t,i=r.separator||".",s=r.joinChar||("string"==typeof i?i:".");if(!o&&!n)return e;if(o&&t in e)return L(t,e,r)?e[t]:r.default;let c=n?t:function(e,t,r){return"function"==typeof r.split?r.split(e):e.split(t)}(t,i,r),a=c.length,f=0;do{let t=c[f];for("number"==typeof t&&(t=String(t));t&&"\\"===t.slice(-1);)t=I([t.slice(0,-1),c[++f]||""],s,r);if(t in e){if(!L(t,e,r))return r.default;e=e[t]}else{let n=!1,o=f+1;for(;o<a;)if(n=(t=I([t,c[o++]],s,r))in e){if(!L(t,e,r))return r.default;e=e[t],f=o-1;break}if(!n)return r.default}}while(++f<a&&F(e));return f===a?e:r.default}(e,t,r));var n};const X=e=>{if((e=>"__proto__"===e||"constructor"===e||"prototype"===e)(e))throw new Error(`Cannot set unsafe key: "${e}"`)};var B=function(e,t){if(null==(r=e)||"object"!=typeof r||!1!==Array.isArray(r))throw new TypeError("expected an object.");var r,n=Array.isArray(t);if(!n&&e.hasOwnProperty(t))return delete e[t],!0;if(D(e,t)){for(var o=n?t.slice():t.split("."),i=o.pop();o.length&&"\\"===o[o.length-1].slice(-1);)i=o.pop().slice(0,-1)+"."+i;for(;o.length;)t=o.shift(),X(t),e=e[t];return delete e[i]}return!0},U={};Object.defineProperty(U,"__esModule",{value:!0}),U.boolean=void 0,U.boolean=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());case"[object Number]":return 1===e.valueOf();case"[object Boolean]":return e.valueOf();default:return!1}};var W={};Object.defineProperty(W,"__esModule",{value:!0}),W.isBooleanable=void 0,W.isBooleanable=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(e.trim().toLowerCase());case"[object Number]":return[0,1].includes(e.valueOf());case"[object Boolean]":return!0;default:return!1}};var z={};Object.defineProperty(z,"__esModule",{value:!0}),z.boolean=void 0,Object.defineProperty(z,"boolean",{enumerable:!0,get:function(){return U.boolean}}),Object.defineProperty(z,"isBooleanable",{enumerable:!0,get:function(){return W.isBooleanable}});var R,H,K,V="10.0.4",G=R={};function J(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}function q(e){if(H===setTimeout)return setTimeout(e,0);if((H===J||!H)&&setTimeout)return H=setTimeout,setTimeout(e,0);try{return H(e,0)}catch(t){try{return H.call(null,e,0)}catch(t){return H.call(this,e,0)}}}!function(){try{H="function"==typeof setTimeout?setTimeout:J}catch(e){H=J}try{K="function"==typeof clearTimeout?clearTimeout:$}catch(e){K=$}}();var Q,Y=[],Z=!1,ee=-1;function te(){Z&&Q&&(Z=!1,Q.length?Y=Q.concat(Y):ee=-1,Y.length&&re())}function re(){if(!Z){var e=q(te);Z=!0;for(var t=Y.length;t;){for(Q=Y,Y=[];++ee<t;)Q&&Q[ee].run();ee=-1,t=Y.length}Q=null,Z=!1,function(e){if(K===clearTimeout)return clearTimeout(e);if((K===$||!K)&&clearTimeout)return K=clearTimeout,clearTimeout(e);try{K(e)}catch(t){try{return K.call(null,e)}catch(t){return K.call(this,e)}}}(e)}}function ne(e,t){this.fun=e,this.array=t}function oe(){}G.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Y.push(new ne(e,t)),1!==Y.length||Z||q(re)},ne.prototype.run=function(){this.fun.apply(null,this.array)},G.title="browser",G.browser=!0,G.env={},G.argv=[],G.version="",G.versions={},G.on=oe,G.addListener=oe,G.once=oe,G.off=oe,G.removeListener=oe,G.removeAllListeners=oe,G.emit=oe,G.prependListener=oe,G.prependOnceListener=oe,G.listeners=function(e){return[]},G.binding=function(e){throw new Error("process.binding is not supported")},G.cwd=function(){return"/"},G.chdir=function(e){throw new Error("process.chdir is not supported")},G.umask=function(){return 0};var ie={};return function(e){(function(){const{boolean:r}=z,n=new Set(["config","log"]),i=["trace","debug","info","warn","error","fatal"],s={warning:"warn",err:"error"},c="`level` invalid, must be: "+i.join(", ");function a(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function h(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}function y(e){return void 0===e}function d(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function v(e){return"string"==typeof e}ie=class{constructor(){var t=this;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s={};if(e.env.AXE_REMAPPED_META_FIELDS){const t=e.env.AXE_REMAPPED_META_FIELDS.split(",").map(e=>e.split(":"));for(const[e,r]of t)s[e]=r}this.config=function(){const e=O(A(m),this!==b&&this||{},m);let t={_:{}};for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];for(const i of n)if(void 0!==i){if(!p(i))throw new TypeError("`"+i+"` is not an Option Object");t=O(t,{_:i},e)}return t._}({showStack:!e.env.AXE_SHOW_STACK||r(e.env.AXE_SHOW_STACK),meta:Object.assign({show:!e.env.AXE_SHOW_META||r(e.env.AXE_SHOW_META),remappedFields:s,omittedFields:e.env.AXE_OMIT_META_FIELDS?e.env.AXE_OMIT_META_FIELDS.split(",").map(e=>e.trim()):["level","err","app","args"],pickedFields:e.env.AXE_PICK_META_FIELDS?e.env.AXE_PICK_META_FIELDS.split(",").map(e=>e.trim()):[],cleanupRemapping:!0},"object"==typeof o.meta?o.meta:{}),version:V,silent:!1,logger:console,name:!1,level:"info",levels:["info","warn","error","fatal"],appInfo:!e.env.AXE_APP_INFO||r(e.env.AXE_APP_INFO),hooks:Object.assign({pre:[],post:[]},"object"==typeof o.hooks?o.hooks:{})},o),this.appInfo=!!this.config.appInfo&&"function"==typeof S&&S(),this.log=this.log.bind(this);const c=Object.keys(this.config.logger).filter(e=>!n.has(e));for(const e of c)this[e]=this.config.logger[e];for(const e of i)"function"!=typeof this.config.logger[e]&&("fatal"===e?this.config.logger.fatal=this.config.logger.error||this.config.logger.info||this.config.logger.log:this.config.logger[e]=this.config.logger.info||this.config.logger.log),this[e]=function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.log(e,...Array.prototype.slice.call(n))};this.setLevel=this.setLevel.bind(this),this.getNormalizedLevel=this.getNormalizedLevel.bind(this),this.setName=this.setName.bind(this),this.config.name&&this.setName(this.config.name),this.setLevel(this.config.level),this.err=this.error,this.warning=this.warn,this.pre=function(e,t){this.config.hooks.pre.push((function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return e!==r?[...o]:t(...o)}))},this.post=function(e,t){this.config.hooks.post.push((function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return e!==r?[...o]:t(...o)}))}}setLevel(e){if(!v(e)||-1===i.indexOf(e))throw new Error(c);v(this.config.logger.logLevel)?this.config.logger.logLevel=e:this.config.logger.level=e,this.config.levels=i.slice(i.indexOf(e))}getNormalizedLevel(e){return v(e)?v(s[e])?s[e]:-1===i.indexOf(e)?"info":e:"info"}setName(e){if(!v(e))throw new Error("`name` must be a String");v(this.config.logger.scope)?this.config.logger.scope=e:this.config.logger.name=e}log(e,r,n){const c=[],p=[];y(e)||c.push(e),y(r)||c.push(r),y(n)||c.push(n);for(var b=arguments.length,m=new Array(b>3?b-3:0),A=3;A<b;A++)m[A-3]=arguments[A];for(const t of Array.prototype.slice.call(m))c.push(t);const{config:j}=this;let O=0;if(v(e)&&v(s[e])?e=s[e]:g(e)?(n=r,r=e,e="error"):v(e)&&-1!==i.indexOf(e)||(n=r,r=e,e=this.getNormalizedLevel(e),O=-1),-1===j.levels.indexOf(e))return;let E,S=!1;if((d(r)||Array.isArray(r))&&v(n)){S=!0;const e=n;n=r,r=v(e)&&c.length>=3+O?f(...c.slice(2+O)):e}if(y(r)&&(r=e),1!==c.slice(1+O).length||v(r)||g(r))if(!S&&c.length>=4+O){r=void 0,n={};const t=[];for(const e of c)g(e)?p.push(e):v(e)&&t.push(e);0===p.length&&t.length>0?r=f(...t):p.length>0&&"log"===e&&(e="error")}else if(!S&&c.length===3+O&&v(r)&&l.some(e=>-1!==r.indexOf(e)))r=f(r,n),n={};else if(g(r)){if(g(n)){p.push(n);for(const e of c.slice(2+O))n!==e&&g(e)&&p.push(e);n={}}}else g(n)?(p.push(n),n={}):d(n)||y(n)||null===n?v(r)||(r=f(r)):(r=f(r,n),n={});else n={message:r},r=e;y(n)||d(n)?d(n)||(n={}):n={original_meta:n},g(r)&&(p.unshift(r),r=void 0),d(n.err)&&(g(n.err)&&p.push(n.err),n.original_err=g(n.err)?_(n.err):n.err),p.length>0&&(E=function(e){if(0!==(e=e.filter(o)).length)return 1===e.length?e[0]:new t(e)}(p),n.err=_(E),v(r)||(r=E.message)),n.args=c,n.level=e,this.appInfo&&(n.app=this.appInfo);const T=-1===O?"log":e;if(!h(this.config.meta.remappedFields))for(const t of Object.keys(this.config.meta.remappedFields))if(P(n,this.config.meta.remappedFields[t],u(n,t)),B(n,t),this.config.meta.cleanupRemapping){const e=t.lastIndexOf(".");if(-1===e)continue;const r=t.slice(0,e);h(u(n,r))&&B(n,r)}if(!h(this.config.meta.omittedFields)||!h(this.config.meta.pickedFields)){const e=function(e){const t=[];return function e(r,n){for(const o of Object.keys(r)){const i=r[o],s=n?n+"."+o:o;a(i)?e(i,s):t.push(s)}}(e),t}(n);if(!h(this.config.meta.omittedFields))for(const t of this.config.meta.omittedFields){let r=e.length;for(;r--;)e[r]!==t&&0!==e[r].indexOf(t+".")||e.splice(r,1)}if(!h(this.config.meta.pickedFields))for(const t of this.config.meta.pickedFields){const r=t.indexOf("."),n=t.slice(0,r+1);if(-1!==r){let t=e.length;for(;t--;)0===e[t].indexOf(n)&&e.splice(t,1)}-1===e.indexOf(t)&&e.push(t)}n=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(n=e,"[object Object]"!==Object.prototype.toString.call(n)||!t||!Array.isArray(t)&&"string"!=typeof t)return{};var n;const{length:o}=t;if("string"==typeof t||o<2){const n="string"==typeof t?t:t[0],o=u(e,n,r);return void 0!==o?P({},n,o,r):{}}return((e,t,r,n)=>{const o={};for(let i=0;i<r;i++){const r=t[i],s=u(e,r,n);void 0!==s&&P(o,r,s,n)}return o})(e,t,o,r)}(n,e)}for(const t of this.config.hooks.pre)[E,r,n]=t(T,E,r,n);j.silent||(g(E)&&j.showStack?!j.meta.show||h(n)?this.config.logger[T](E):this.config.logger[T](E,n):!j.meta.show||h(n)?this.config.logger[T](r):this.config.logger[T](r,n)),w(this.config.hooks.post,e=>e(T,E,r,n)).then().catch(e=>{this.config.logger.error(e)})}}}).call(this)}.call(this,R),ie}));
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Axe=e()}}((function(){!function(e){"use strict";e.console||(e.console={});for(var t,r,n=e.console,o=function(){},i=["memory"],s="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=i.pop();)n[t]||(n[t]={});for(;r=s.pop();)n[r]||(n[r]=o)}("undefined"==typeof window?this:window);var e={hostname:function(){return"undefined"!=typeof location?location.hostname:""}};const t=Symbol("kErrors");class r extends Error{constructor(e){const r=new Set(e.map(s).filter(Boolean));super(Array.from(r).join("; ")),n(this,"name","CombinedError"),n(this,t,e),o(this,"stack",()=>e.map(c).join("\n\n")),o(this,"transient",()=>e.length>0&&e.every(a)),o(this,"expected",()=>e.length>0&&e.every(f))}[Symbol.iterator](){return this[t][Symbol.iterator]()}}function n(e,t,r){Object.defineProperty(e,t,{value:r})}function o(e,t,r){Object.defineProperty(e,t,{get:r})}function i(e){return null!=e}function s(e){return e.message}function c(e){return e.stack}function a(e){return!0===e.transient}function f(e){return!0===e.expected}var l=function(e){var t=Array.prototype.slice.call(arguments,1);return t.length&&(e=e.toString().replace(/(%?)(%([jds]))/g,(function(e,r,n,o){var i=t.shift();switch(o){case"s":i=""+i;break;case"d":i=Number(i);break;case"j":i=JSON.stringify(i)}return r?(t.unshift(i),e):i}))),t.length&&(e=e.toString()+" "+t.join(" ")),""+e.toString().replace(/%{2,2}/g,"%")},u=["%s","%d","%i","%f","%j","%o","%O","%%"],p=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(n=e,"[object Object]"!==Object.prototype.toString.call(n)||!t)return e;var n;const o=Array.isArray(t)?t:String(t).split(r),{length:i}=o;return i<2?e[o[0]]:((e,t,r)=>{for(let n=0;n<r;n++){if(null===e)return;const r=e[t[n]];if(void 0===r)return;e=r}return e})(e,o,i)},g=function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}},h=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype};const{hasOwnProperty:y}=Object.prototype,{propertyIsEnumerable:d}=Object,m=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),b=this,v={concatArrays:!1,ignoreUndefined:!1},A=e=>{const t=[];for(const r in e)y.call(e,r)&&t.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(e);for(const n of r)d.call(e,n)&&t.push(n)}return t};function O(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return A(e).forEach(r=>{m(t,r,O(e[r]))}),t}(e):h(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return A(e).forEach(r=>{m(t,r,O(e[r]))}),t}(e):e}const j=(e,t,r,n)=>(r.forEach(r=>{void 0===t[r]&&n.ignoreUndefined||(r in e&&e[r]!==Object.getPrototypeOf(e)?m(e,r,w(e[r],t[r],n)):m(e,r,O(t[r])))}),e);function w(e,t,r){return r.concatArrays&&Array.isArray(e)&&Array.isArray(t)?((e,t,r)=>{let n=e.slice(0,0),o=0;return[e,t].forEach(t=>{const i=[];for(let r=0;r<t.length;r++)y.call(t,r)&&(i.push(String(r)),m(n,o++,t===e?t[r]:O(t[r])));n=j(n,t,A(t).filter(e=>!i.includes(e)),r)}),n})(e,t,r):h(t)&&h(e)?j(e,t,A(t),r):O(t)}var E={};const S=async(e,t)=>{const r=[];let n=0;for(const o of e)r.push(await t(await o,n++));return r};(E=S).default=S;var _={},T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!g(e))throw new Error("`err` must be an Error");if(!Array.isArray(t))throw new Error("`fields` must be an Array");var r={};return Object.getOwnPropertyNames(Object.getPrototypeOf(e)).concat(Object.getOwnPropertyNames(e)).forEach((function(t){"function"!=typeof e[t]&&(r[t]=e[t])})),!r.name&&e.constructor.name&&(r.name=e.constructor.name),Array.isArray(t)&&0!==t.length?r.filter((function(e){return t.includes(e)})):r};const k=e=>"object"==typeof e||"function"==typeof e,P=(e,t)=>"__proto__"==e||"constructor"==e&&"function"==typeof t.constructor;var x=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".";if(!k(e)||!t||!t.length)return e;const o=Array.isArray(t)?t:String(t).split(n);if(P(o[0],e))return e;const{length:i}=o;return 1===i?(e[o[0]]=r,e):((e,t,r,n)=>{let o=e,i=0;for(;i<r-1;i++){const e=t[i];P(e,o)||(o=k(o[e])?o[e]:o[e]={})}return o[t[i]]=n,e})(e,o,i,r)},I=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)};function L(e,t,r){return"function"==typeof r.join?r.join(e):e[0]+t+e[1]}function F(e,t,r){return"function"!=typeof r.isValid||r.isValid(e,t)}function M(e){return I(e)||Array.isArray(e)||"function"==typeof e}var N=Object.prototype.toString;function C(e){return"function"==typeof e.constructor?e.constructor.name:null}var D=function e(t){switch(function(e){if(void 0===e)return"undefined";if(null===e)return"null";var t=typeof e;if("boolean"===t)return"boolean";if("string"===t)return"string";if("number"===t)return"number";if("symbol"===t)return"symbol";if("function"===t)return"GeneratorFunction"===C(e)?"generatorfunction":"function";if(function(e){return Array.isArray?Array.isArray(e):e instanceof Array}(e))return"array";if(function(e){return!(!e.constructor||"function"!=typeof e.constructor.isBuffer)&&e.constructor.isBuffer(e)}(e))return"buffer";if(function(e){try{if("number"==typeof e.length&&"function"==typeof e.callee)return!0}catch(t){if(-1!==t.message.indexOf("callee"))return!0}return!1}(e))return"arguments";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";if(function(e){return e instanceof RegExp||"string"==typeof e.flags&&"boolean"==typeof e.ignoreCase&&"boolean"==typeof e.multiline&&"boolean"==typeof e.global}(e))return"regexp";switch(C(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(e){return"function"==typeof e.throw&&"function"==typeof e.return&&"function"==typeof e.next}(e))return"generator";switch(t=N.call(e)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}(t)){case"boolean":case"date":case"function":case"null":case"number":return!0;case"undefined":return!1;case"regexp":return"(?:)"!==t.source&&""!==t.source;case"buffer":return""!==t.toString();case"error":return""!==t.message;case"string":case"arguments":return 0!==t.length;case"file":case"map":case"set":return 0!==t.size;case"array":case"object":for(const r of Object.keys(t))if(e(t[r]))return!0;return!1;default:return!0}},X=function(e,t,r){return!(null==(n=e)||"object"!=typeof n&&"function"!=typeof n&&!Array.isArray(n)||"string"!=typeof t&&!Array.isArray(t))&&D(function(e,t,r){if(I(r)||(r={default:r}),!M(e))return void 0!==r.default?r.default:e;"number"==typeof t&&(t=String(t));const n=Array.isArray(t),o="string"==typeof t,i=r.separator||".",s=r.joinChar||("string"==typeof i?i:".");if(!o&&!n)return e;if(o&&t in e)return F(t,e,r)?e[t]:r.default;let c=n?t:function(e,t,r){return"function"==typeof r.split?r.split(e):e.split(t)}(t,i,r),a=c.length,f=0;do{let t=c[f];for("number"==typeof t&&(t=String(t));t&&"\\"===t.slice(-1);)t=L([t.slice(0,-1),c[++f]||""],s,r);if(t in e){if(!F(t,e,r))return r.default;e=e[t]}else{let n=!1,o=f+1;for(;o<a;)if(n=(t=L([t,c[o++]],s,r))in e){if(!F(t,e,r))return r.default;e=e[t],f=o-1;break}if(!n)return r.default}}while(++f<a&&M(e));return f===a?e:r.default}(e,t,r));var n};const B=e=>{if((e=>"__proto__"===e||"constructor"===e||"prototype"===e)(e))throw new Error(`Cannot set unsafe key: "${e}"`)};var U=function(e,t){if(null==(r=e)||"object"!=typeof r||!1!==Array.isArray(r))throw new TypeError("expected an object.");var r,n=Array.isArray(t);if(!n&&e.hasOwnProperty(t))return delete e[t],!0;if(X(e,t)){for(var o=n?t.slice():t.split("."),i=o.pop();o.length&&"\\"===o[o.length-1].slice(-1);)i=o.pop().slice(0,-1)+"."+i;for(;o.length;)t=o.shift(),B(t),e=e[t];return delete e[i]}return!0},W={};Object.defineProperty(W,"__esModule",{value:!0}),W.boolean=void 0,W.boolean=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());case"[object Number]":return 1===e.valueOf();case"[object Boolean]":return e.valueOf();default:return!1}};var z={};Object.defineProperty(z,"__esModule",{value:!0}),z.isBooleanable=void 0,z.isBooleanable=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(e.trim().toLowerCase());case"[object Number]":return[0,1].includes(e.valueOf());case"[object Boolean]":return!0;default:return!1}};var H={};Object.defineProperty(H,"__esModule",{value:!0}),H.boolean=void 0,Object.defineProperty(H,"boolean",{enumerable:!0,get:function(){return W.boolean}}),Object.defineProperty(H,"isBooleanable",{enumerable:!0,get:function(){return z.isBooleanable}});var R,K,V,G="10.1.0",J=R={};function $(){throw new Error("setTimeout has not been defined")}function q(){throw new Error("clearTimeout has not been defined")}function Q(e){if(K===setTimeout)return setTimeout(e,0);if((K===$||!K)&&setTimeout)return K=setTimeout,setTimeout(e,0);try{return K(e,0)}catch(t){try{return K.call(null,e,0)}catch(t){return K.call(this,e,0)}}}!function(){try{K="function"==typeof setTimeout?setTimeout:$}catch(e){K=$}try{V="function"==typeof clearTimeout?clearTimeout:q}catch(e){V=q}}();var Y,Z=[],ee=!1,te=-1;function re(){ee&&Y&&(ee=!1,Y.length?Z=Y.concat(Z):te=-1,Z.length&&ne())}function ne(){if(!ee){var e=Q(re);ee=!0;for(var t=Z.length;t;){for(Y=Z,Z=[];++te<t;)Y&&Y[te].run();te=-1,t=Z.length}Y=null,ee=!1,function(e){if(V===clearTimeout)return clearTimeout(e);if((V===q||!V)&&clearTimeout)return V=clearTimeout,clearTimeout(e);try{V(e)}catch(t){try{return V.call(null,e)}catch(t){return V.call(this,e)}}}(e)}}function oe(e,t){this.fun=e,this.array=t}function ie(){}J.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Z.push(new oe(e,t)),1!==Z.length||ee||Q(ne)},oe.prototype.run=function(){this.fun.apply(null,this.array)},J.title="browser",J.browser=!0,J.env={},J.argv=[],J.version="",J.versions={},J.on=ie,J.addListener=ie,J.once=ie,J.off=ie,J.removeListener=ie,J.removeAllListeners=ie,J.emit=ie,J.prependListener=ie,J.prependOnceListener=ie,J.listeners=function(e){return[]},J.binding=function(e){throw new Error("process.binding is not supported")},J.cwd=function(){return"/"},J.chdir=function(e){throw new Error("process.chdir is not supported")},J.umask=function(){return 0};var se={};return function(t){(function(){const{boolean:n}=H,o=new Set(["config","log"]),s=["trace","debug","info","warn","error","fatal"],c={warning:"warn",err:"error"},a="`level` invalid, must be: "+s.join(", "),f=t.env.HOSTNAME||e.hostname();function y(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function d(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}function m(e){return void 0===e}function A(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function j(e){return"string"==typeof e}se=class{constructor(){var e=this;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={};if(t.env.AXE_REMAPPED_META_FIELDS){const e=t.env.AXE_REMAPPED_META_FIELDS.split(",").map(e=>e.split(":"));for(const[t,r]of e)i[t]=r}this.config=function(){const e=w(O(v),this!==b&&this||{},v);let t={_:{}};for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];for(const i of n)if(void 0!==i){if(!h(i))throw new TypeError("`"+i+"` is not an Option Object");t=w(t,{_:i},e)}return t._}({showStack:!t.env.AXE_SHOW_STACK||n(t.env.AXE_SHOW_STACK),meta:Object.assign({show:!t.env.AXE_SHOW_META||n(t.env.AXE_SHOW_META),remappedFields:i,omittedFields:t.env.AXE_OMIT_META_FIELDS?t.env.AXE_OMIT_META_FIELDS.split(",").map(e=>e.trim()):["level","err","app","args"],pickedFields:t.env.AXE_PICK_META_FIELDS?t.env.AXE_PICK_META_FIELDS.split(",").map(e=>e.trim()):[],cleanupRemapping:!0},"object"==typeof r.meta?r.meta:{}),version:G,silent:!1,logger:console,name:f,level:"info",levels:["info","warn","error","fatal"],appInfo:!t.env.AXE_APP_INFO||n(t.env.AXE_APP_INFO),hooks:Object.assign({pre:[],post:[]},"object"==typeof r.hooks?r.hooks:{})},r),this.appInfo=!!this.config.appInfo&&"function"==typeof _&&_(),this.log=this.log.bind(this);const c=Object.keys(this.config.logger).filter(e=>!o.has(e));for(const t of c)this[t]=this.config.logger[t];for(const t of s)"function"!=typeof this.config.logger[t]&&("fatal"===t?this.config.logger.fatal=this.config.logger.error||this.config.logger.info||this.config.logger.log:this.config.logger[t]=this.config.logger.info||this.config.logger.log),this[t]=function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return e.log(t,...Array.prototype.slice.call(n))};this.setLevel=this.setLevel.bind(this),this.getNormalizedLevel=this.getNormalizedLevel.bind(this),this.setName=this.setName.bind(this),this.config.name&&this.setName(this.config.name),this.setLevel(this.config.level),this.err=this.error,this.warning=this.warn,this.pre=function(e,t){this.config.hooks.pre.push((function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return e!==r?[...o]:t(...o)}))},this.post=function(e,t){this.config.hooks.post.push((function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return e!==r?[...o]:t(...o)}))}}setLevel(e){if(!j(e)||-1===s.indexOf(e))throw new Error(a);j(this.config.logger.logLevel)?this.config.logger.logLevel=e:this.config.logger.level=e,this.config.levels=s.slice(s.indexOf(e))}getNormalizedLevel(e){return j(e)?j(c[e])?c[e]:-1===s.indexOf(e)?"info":e:"info"}setName(e){if(!j(e))throw new Error("`name` must be a String");j(this.config.logger.scope)?this.config.logger.scope=e:this.config.logger.name=e}log(e,t,n){const o=[],a=[];m(e)||o.push(e),m(t)||o.push(t),m(n)||o.push(n);for(var f=arguments.length,h=new Array(f>3?f-3:0),b=3;b<f;b++)h[b-3]=arguments[b];for(const r of Array.prototype.slice.call(h))o.push(r);const{config:v}=this;let O=0;if(j(e)&&j(c[e])?e=c[e]:g(e)?(n=t,t=e,e="error"):j(e)&&-1!==s.indexOf(e)||(n=t,t=e,e=this.getNormalizedLevel(e),O=-1),-1===v.levels.indexOf(e))return;let w,S=!1;if((A(t)||Array.isArray(t))&&j(n)){S=!0;const e=n;n=t,t=j(e)&&o.length>=3+O?l(...o.slice(2+O)):e}if(m(t)&&(t=e),1!==o.slice(1+O).length||j(t)||g(t))if(!S&&o.length>=4+O){t=void 0,n={};const r=[];for(const e of o)g(e)?a.push(e):j(e)&&r.push(e);0===a.length&&r.length>0?t=l(...r):a.length>0&&"log"===e&&(e="error")}else if(!S&&o.length===3+O&&j(t)&&u.some(e=>-1!==t.indexOf(e)))t=l(t,n),n={};else if(g(t)){if(g(n)){a.push(n);for(const e of o.slice(2+O))n!==e&&g(e)&&a.push(e);n={}}}else g(n)?(a.push(n),n={}):A(n)||m(n)||null===n?j(t)||(t=l(t)):(t=l(t,n),n={});else n={message:t},t=e;m(n)||A(n)?A(n)||(n={}):n={original_meta:n},g(t)&&(a.unshift(t),t=void 0),A(n.err)&&(g(n.err)&&a.push(n.err),n.original_err=g(n.err)?T(n.err):n.err),a.length>0&&(w=function(e){if(0!==(e=e.filter(i)).length)return 1===e.length?e[0]:new r(e)}(a),n.err=T(w),j(t)||(t=w.message)),n.args=o,n.level=e,this.appInfo&&(n.app=this.appInfo);const _=-1===O?"log":e;for(const r of this.config.hooks.pre)[w,t,n]=r(_,w,t,n);if(!d(this.config.meta.remappedFields))for(const r of Object.keys(this.config.meta.remappedFields))if(x(n,this.config.meta.remappedFields[r],p(n,r)),U(n,r),this.config.meta.cleanupRemapping){const e=r.lastIndexOf(".");if(-1===e)continue;const t=r.slice(0,e);d(p(n,t))&&U(n,t)}if(!d(this.config.meta.omittedFields)||!d(this.config.meta.pickedFields)){const e=function(e){const t=[];return function e(r,n){for(const o of Object.keys(r)){const i=r[o],s=n?n+"."+o:o;y(i)?e(i,s):t.push(s)}}(e),t}(n);if(!d(this.config.meta.omittedFields))for(const t of this.config.meta.omittedFields){let r=e.length;for(;r--;)e[r]!==t&&0!==e[r].indexOf(t+".")||e.splice(r,1)}if(!d(this.config.meta.pickedFields))for(const t of this.config.meta.pickedFields){const r=t.indexOf("."),n=t.slice(0,r+1);if(-1!==r){let t=e.length;for(;t--;)0===e[t].indexOf(n)&&e.splice(t,1)}-1===e.indexOf(t)&&e.push(t)}n=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(n=e,"[object Object]"!==Object.prototype.toString.call(n)||!t||!Array.isArray(t)&&"string"!=typeof t)return{};var n;const{length:o}=t;if("string"==typeof t||o<2){const n="string"==typeof t?t:t[0],o=p(e,n,r);return void 0!==o?x({},n,o,r):{}}return((e,t,r,n)=>{const o={};for(let i=0;i<r;i++){const r=t[i],s=p(e,r,n);void 0!==s&&x(o,r,s,n)}return o})(e,t,o,r)}(n,e)}v.silent||(g(w)&&v.showStack?!v.meta.show||d(n)?this.config.logger[_](w):this.config.logger[_](w,n):!v.meta.show||d(n)?this.config.logger[_](t):this.config.logger[_](t,n)),E(this.config.hooks.post,e=>e(_,w,t,n)).then().catch(e=>{this.config.logger.error(e)})}}}).call(this)}.call(this,R),se}));

@@ -5,2 +5,3 @@ "use strict";

require('console-polyfill');
const os = require('os');
const combine = require('maybe-combine-errors');

@@ -29,2 +30,3 @@ const format = require('@ladjs/format-util');

const levelError = `\`level\` invalid, must be: ${levels.join(', ')}`;
const name = process.env.NODE_ENV === 'development' ? false : process.env.HOSTNAME || os.hostname();

@@ -101,3 +103,3 @@ // <https://github.com/sindresorhus/is-plain-obj/blob/main/index.js>

logger: console,
name: false,
name,
level: 'info',

@@ -326,2 +328,7 @@ levels: ['info', 'warn', 'error', 'fatal'],

// pre-hooks
for (const hook of this.config.hooks.pre) {
[err, message, meta] = hook(method, err, message, meta);
}
//

@@ -403,7 +410,2 @@ // NOTE: using lodash _.omit and _.pick would have been _very slow_

// pre-hooks
for (const hook of this.config.hooks.pre) {
[err, message, meta] = hook(method, err, message, meta);
}
// only invoke logger methods if it was not silent

@@ -410,0 +412,0 @@ if (!config.silent) {

{
"name": "axe",
"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.",
"version": "10.0.4",
"version": "10.1.0",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com)",

@@ -6,0 +6,0 @@ "browser": {

@@ -402,17 +402,17 @@ # Axe

| Property | Type | Default Value | Description | |
| ----------------------- | ----------------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| `showStack` | Boolean | `true` | Attempts to parse a boolean value from `process.env.AXE_SHOW_STACK`). **If this value is `true`, then if `message` is an instance of an Error, it will be invoked as the first argument to logger methods. If this is `false`, then only the `err.message` will be invoked as the first argument to logger methods.** Basically if `true` it will call `logger.method(err)` and if `false` it will call `logger.method(err.message)`. If you pass `err` as the first argument to a logger method, then it will show the stack trace via `err.stack` typically. | |
| `meta` | Object | See below | Stores all meta config information (see the following nested properties below). | |
| `meta.show` | Boolean | `true` | Attempts to parse a boolean value from `process.env.AXE_SHOW_META` – meaning you can pass a flag `AXE_SHOW_META=true node app.js` when needed for debugging), whether or not to output metadata to logger methods. If set to `false`, then fields will not be omitted nor picked; the entire meta object will be hidden from logger output. | |
| `meta.remappedFields` | Object | `{}` | Attempts to parse an Object mapping from `process.env.AXE_REMAPPED_META_FIELDS` (`,` and `:` delimited, e.g. `REMAPPED_META_FIELDS=foo:bar,beep.boop:beepBoop` to remap `meta.foo` to `meta.bar` and `meta.beep.boop` to `meta.beepBoop`). Note that this will clean up empty objects by default unless you set the option `meta.cleanupRemapping` to `false`). Supports dot-notation. | |
| `meta.omittedFields` | Array | `['level','err','app', 'args']` | Attempts to parse an array value from `process.env.AXE_OMIT_META_FIELDS` (`,` delimited) - meaning you can pass a flag `OMIT_META_FIELDS=user,id node app.js`), determining which fields to omit in the metadata passed to logger methods. Supports dot-notation. | |
| `meta.pickedFields` | Array | `[]` | Attempts to parse an array value from `process.env.AXE_PICK_META_FIELDS` (`,` delimited) - meaning you can pass a flag, e.g. `PICK_META_FIELDS=request.headers,response.headers node app.js` which would pick from `meta.request` and `meta.response` *only* `meta.request.headers` and `meta.response.headers`), **This takes precedence after fields are omitted, which means this acts as a whitelist.** Supports dot-notation. | |
| `meta.cleanupRemapping` | Boolean | `true` | Whether or not to cleanup empty objects after remapping operations are completed) | |
| `silent` | Boolean | `false` | Whether or not to invoke logger methods. Pre and post hooks will still run even if this option is set to `false`. | |
| `logger` | Object | `console` | Defaults to `console` with [console-polyfill][] added automatically, though **you can bring your own logger**. See [custom logger](#custom-logger) – you can pass an instance of `pino`, `signale`, `winston`, `bunyan`, etc. | |
| `name` | String or Boolean | `false` | The default name for the logger (defaults to `false`, which does not set `logger.name`). If you wish to pass a name such as `os.hostname()`, then set `name: os.hostname()` – this is useful if you are using a logger like `pino` which prefixes log output with the name set here. | |
| `level` | String | `"info"` | The default level of logging to invoke `logger` methods for (defaults to `info`, which includes all logs including info and higher in severity (e.g. `info`, `warn`, `error`, `fatal`) | |
| `levels` | Array | `['info','warn','error','fatal']` | An Array of logging levels to support. You usually shouldn't change this unless you want to prevent logger methods from being invoked or prevent hooks from being run for a certain log level. If an invalid log level is attempted to be invoked, and if it is not in this Array, then no hooks and no logger methods will be invoked. | |
| `appInfo` | Boolean | `true` | Attempts to parse a boolean value from `process.env.AXE_APP_INFO`) - whether or not to parse application information (using [parse-app-info][]). | |
| Property | Type | Default Value | Description | |
| ----------------------- | ----------------- | --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| `showStack` | Boolean | `true` | Attempts to parse a boolean value from `process.env.AXE_SHOW_STACK`). **If this value is `true`, then if `message` is an instance of an Error, it will be invoked as the first argument to logger methods. If this is `false`, then only the `err.message` will be invoked as the first argument to logger methods.** Basically if `true` it will call `logger.method(err)` and if `false` it will call `logger.method(err.message)`. If you pass `err` as the first argument to a logger method, then it will show the stack trace via `err.stack` typically. | |
| `meta` | Object | See below | Stores all meta config information (see the following nested properties below). | |
| `meta.show` | Boolean | `true` | Attempts to parse a boolean value from `process.env.AXE_SHOW_META` – meaning you can pass a flag `AXE_SHOW_META=true node app.js` when needed for debugging), whether or not to output metadata to logger methods. If set to `false`, then fields will not be omitted nor picked; the entire meta object will be hidden from logger output. | |
| `meta.remappedFields` | Object | `{}` | Attempts to parse an Object mapping from `process.env.AXE_REMAPPED_META_FIELDS` (`,` and `:` delimited, e.g. `REMAPPED_META_FIELDS=foo:bar,beep.boop:beepBoop` to remap `meta.foo` to `meta.bar` and `meta.beep.boop` to `meta.beepBoop`). Note that this will clean up empty objects by default unless you set the option `meta.cleanupRemapping` to `false`). Supports dot-notation. | |
| `meta.omittedFields` | Array | `['level','err','app', 'args']` | Attempts to parse an array value from `process.env.AXE_OMIT_META_FIELDS` (`,` delimited) - meaning you can pass a flag `OMIT_META_FIELDS=user,id node app.js`), determining which fields to omit in the metadata passed to logger methods. Supports dot-notation. | |
| `meta.pickedFields` | Array | `[]` | Attempts to parse an array value from `process.env.AXE_PICK_META_FIELDS` (`,` delimited) - meaning you can pass a flag, e.g. `PICK_META_FIELDS=request.headers,response.headers node app.js` which would pick from `meta.request` and `meta.response` *only* `meta.request.headers` and `meta.response.headers`), **This takes precedence after fields are omitted, which means this acts as a whitelist.** Supports dot-notation. | |
| `meta.cleanupRemapping` | Boolean | `true` | Whether or not to cleanup empty objects after remapping operations are completed) | |
| `silent` | Boolean | `false` | Whether or not to invoke logger methods. Pre and post hooks will still run even if this option is set to `false`. | |
| `logger` | Object | `console` | Defaults to `console` with [console-polyfill][] added automatically, though **you can bring your own logger**. See [custom logger](#custom-logger) – you can pass an instance of `pino`, `signale`, `winston`, `bunyan`, etc. | |
| `name` | String or Boolean | `false` if `NODE_ENV` is `"development"` otherwise the value of `process.env.HOSTNAME` or `os.hostname()` | The default name for the logger (defaults to `false` in development environments, which does not set `logger.name`) – this is useful if you are using a logger like `pino` which prefixes log output with the name set here. | |
| `level` | String | `"info"` | The default level of logging to invoke `logger` methods for (defaults to `info`, which includes all logs including info and higher in severity (e.g. `info`, `warn`, `error`, `fatal`) | |
| `levels` | Array | `['info','warn','error','fatal']` | An Array of logging levels to support. You usually shouldn't change this unless you want to prevent logger methods from being invoked or prevent hooks from being run for a certain log level. If an invalid log level is attempted to be invoked, and if it is not in this Array, then no hooks and no logger methods will be invoked. | |
| `appInfo` | Boolean | `true` | Attempts to parse a boolean value from `process.env.AXE_APP_INFO`) - whether or not to parse application information (using [parse-app-info][]). | |

@@ -588,3 +588,3 @@ ### Supported Platforms

You can add synchronous "pre" hooks and/or asynchronous/synchronous "post" hooks with Axe. Both pre and post hooks accept four arguments (`level`, `err`, `message`, and `meta`). Pre hooks are required to be synchronous.
You can add synchronous "pre" hooks and/or asynchronous/synchronous "post" hooks with Axe. Both pre and post hooks accept four arguments (`level`, `err`, `message`, and `meta`). Pre hooks are required to be synchronous. Pre hooks also run before any metadata is picked, omitted, remapped, etc.

@@ -741,26 +741,20 @@ Both pre and post hooks execute serially – and while pre hooks are blocking, post-hooks will run in the background after logger methods are invoked (you can have a post hook that's a Promise or async function).

1. You will need to install the `superagent`, `cuid`, and `fast-safe-stringify` packages:
1. You will also need to install additional packages:
```sh
npm install superagent cuid fast-safe-stringify
npm install axe fast-safe-stringify cuid superagent
```
2. Implementation example is provided below:
2. Implementation example is provided below (and you can also refer to the [Forward Email][forward-email-code] code base):
```js
const os = require('os');
const Axe = require('axe');
const safeStringify = require('fast-safe-stringify');
const cuid = require('cuid');
const superagent = require('superagent');
const cuid = require('cuid');
const safeStringify = require('fast-safe-stringify');
// create our application logger that uses hooks
const logger = new Axe({
logger: console, // optional (e.g. pino, signale, consola),
level: 'info', // optional (defaults to info)
name: process.env.HOSTNAME || os.hostname() // optional
});
const logger = new Axe();
async function hook(next, message, meta) {
// <https://github.com/cabinjs/axe/#send-logs-to-http-endpoint>
async function hook(err, message, meta) {
//

@@ -770,48 +764,35 @@ // return early if we wish to ignore this

//
if (meta.ignore_emit) return next();
if (meta.ignore_hook) return;
try {
//
// set the body used in the HTTP request to be consistent object with
// two properties sent in the payload of `message` and `meta`
// (and also remove circular references)
//
const body = safeStringify({ message, meta });
//
// send to Cabin or your own custom endpoint here
// https://cabinjs.com
//
const request = superagent
.post('https://api.cabinjs.com')
.set('X-Request-Id', cuid()) // normalize server/browser request id formatting
.post(`https://api.example.com/v1/log`)
// if the meta object already contained a request ID then re-use it
// otherwise generate one that gets re-used in the API log request
// (which normalizes server/browser request id formatting)
.set(
'X-Request-Id',
meta && meta.request && meta.request.id ? meta.request.id : cuid()
)
.set('X-Axe-Version', logger.config.version)
.timeout(5000);
// add basic auth header (e.g. if you use Cabin)
// if (config.key) request.auth('INSERT-YOUR-KEY');
// if your endpoint is protected by an API token
// note that superagent exposes `.auth()` method
// request.auth(API_TOKEN);
// set any additional headers if necessary
// request.set({ ... });
const response = await request
.type('application/json')
.retry(3)
.send(body);
.send(safeStringify({ err, message, meta }));
logger.info('log sent over HTTP', { response });
logger.info('log sent over HTTP', { response, ignore_hook: true });
} catch (err) {
logger.fatal(err, { ignore_emit: true });
logger.fatal(err, { ignore_hook: true });
}
}
// move along to the next hook
next();
for (const level of logger.config.levels) {
logger.post(level, hook);
}
// bind custom hooks for "fatal" and "error" log levels
logger.post('error', hook);
logger.post('fatal', hook);
// test out the HTTP integration
logger.error(new Error('Uh oh something went wrong!'));
```

@@ -844,4 +825,3 @@

logger: console, // optional (e.g. pino, signale, consola)
level: 'info', // optional (defaults to info)
name: process.env.HOSTNAME || os.hostname() // optional
level: 'info' // optional (defaults to info)
});

@@ -856,3 +836,3 @@

async function hook(next, message, meta) {
async function hook(err, message, meta) {
//

@@ -862,3 +842,3 @@ // return early if we wish to ignore this

//
if (meta.ignore_emit) return next();
if (meta.ignore_hook) return;

@@ -873,5 +853,5 @@ // otherwise post a message to the slack channel

{
title: meta.err && meta.err.message ? meta.err.message : message,
title: err && err.message ? err.message : message,
color: 'danger',
text: meta.err && meta.err.stack ? meta.err.stack : null,
text: err && err.stack ? err.stack : message,
fields: [

@@ -906,7 +886,4 @@ {

} catch (err) {
logger.fatal(err, { ignore_emit: true });
logger.fatal(err, { ignore_hook: true });
}
// move along to the next hook
next();
}

@@ -943,10 +920,9 @@

for (const level of logger.config.levels) {
logger.post(level, (next, message, meta) => {
logger.post(level, (err, message, meta) => {
// https://docs.sentry.io/clients/node/usage/
if (message instanceof Error) {
Sentry.captureException(message, meta);
if (err) {
Sentry.captureException(err, meta);
} else {
Sentry.captureMessage(message, meta);
}
next();
});

@@ -1069,2 +1045,4 @@ }

[forward-email-code]: https://github.com/forwardemail/forwardemail.net
[high-console]: https://github.com/tusharf5/high-console

@@ -1071,0 +1049,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc