Comparing version 11.0.2 to 11.0.3
@@ -120,2 +120,4 @@ (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.Cabin = 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){ | ||
require('console-polyfill'); | ||
// eslint-disable-next-line unicorn/prefer-node-protocol | ||
const os = require('os'); | ||
@@ -212,3 +214,4 @@ const combine = require('maybe-combine-errors'); | ||
pickedFields: process.env.AXE_PICK_META_FIELDS ? process.env.AXE_PICK_META_FIELDS.split(',').map(s => s.trim()) : [], | ||
cleanupRemapping: true | ||
cleanupRemapping: true, | ||
hideHTTP: true | ||
}, typeof config.meta === 'object' ? config.meta : {}), | ||
@@ -322,5 +325,2 @@ version: pkg.version, | ||
} | ||
const { | ||
config | ||
} = this; | ||
let modifier = 0; | ||
@@ -341,3 +341,3 @@ if (isString(level) && isString(aliases[level])) { | ||
// Return early if it is not a valid logging level | ||
if (config.levels.indexOf(level) === -1) return; | ||
if (this.config.levels.indexOf(level) === -1) return; | ||
@@ -531,6 +531,6 @@ // Bunyan support (meta, message, ...args) | ||
// only invoke logger methods if it was not silent | ||
if (!config.silent) { | ||
if (!this.config.silent) { | ||
// Show stack trace if necessary (along with any metadata) | ||
if (isError(err) && config.showStack) { | ||
if (!config.meta.show || isEmpty(meta)) { | ||
if (isError(err) && this.config.showStack) { | ||
if (!this.config.meta.show || isEmpty(meta)) { | ||
this.config.logger[method](err); | ||
@@ -540,4 +540,6 @@ } else { | ||
} | ||
} else if (!config.meta.show || isEmpty(meta)) { | ||
} else if (!this.config.meta.show || isEmpty(meta)) { | ||
this.config.logger[method](message); | ||
} else if (meta.is_http && this.config.meta.hideHTTP) { | ||
this.config.logger[method](message); | ||
} else { | ||
@@ -561,3 +563,3 @@ this.config.logger[method](message, meta); | ||
"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": "11.0.0", | ||
"version": "11.0.2", | ||
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com)", | ||
@@ -593,8 +595,8 @@ "browser": { | ||
"devDependencies": { | ||
"@babel/cli": "^7.17.10", | ||
"@babel/core": "^7.18.5", | ||
"@babel/preset-env": "^7.18.2", | ||
"@commitlint/cli": "^17.0.2", | ||
"@commitlint/config-conventional": "^17.0.2", | ||
"ava": "^4.3.0", | ||
"@babel/cli": "^7.19.3", | ||
"@babel/core": "^7.20.2", | ||
"@babel/preset-env": "^7.20.2", | ||
"@commitlint/cli": "^17.3.0", | ||
"@commitlint/config-conventional": "^17.3.0", | ||
"ava": "^5.1.0", | ||
"babelify": "^10.0.0", | ||
@@ -604,22 +606,22 @@ "browserify": "^17.0.0", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^8.18.0", | ||
"eslint": "^8.28.0", | ||
"eslint-config-xo-lass": "^2.0.1", | ||
"eslint-plugin-compat": "^4.0.2", | ||
"eslint-plugin-node": "^11.1.0", | ||
"express": "^4.18.1", | ||
"express": "^4.18.2", | ||
"fixpack": "^4.0.0", | ||
"husky": "^8.0.1", | ||
"husky": "^8.0.2", | ||
"jsdom": "15.x", | ||
"koa": "^2.13.4", | ||
"lint-staged": "^13.0.2", | ||
"lint-staged": "^13.0.4", | ||
"lodash": "^4.17.21", | ||
"nyc": "^15.1.0", | ||
"pino": "^8.1.0", | ||
"remark-cli": "^10.0.1", | ||
"pino": "^8.7.0", | ||
"remark-cli": "^11.0.0", | ||
"remark-preset-github": "^4.0.4", | ||
"rimraf": "^3.0.2", | ||
"signale": "^1.4.0", | ||
"sinon": "^14.0.0", | ||
"sinon": "^14.0.2", | ||
"tinyify": "3.0.0", | ||
"xo": "^0.50.0" | ||
"xo": "^0.53.1" | ||
}, | ||
@@ -1714,3 +1716,3 @@ "engines": { | ||
"description": "Cabin is the best self-hosted JavaScript and Node.js logging service.", | ||
"version": "11.0.2", | ||
"version": "11.0.3", | ||
"author": "Titanism", | ||
@@ -1737,3 +1739,3 @@ "browser": { | ||
"parse-err": "^0.0.12", | ||
"parse-request": "^5.0.1" | ||
"parse-request": "^5.1.0" | ||
}, | ||
@@ -1747,3 +1749,3 @@ "devDependencies": { | ||
"ava": "^5.1.0", | ||
"axe": "^11.0.0", | ||
"axe": "^11.0.2", | ||
"babelify": "^10.0.0", | ||
@@ -1765,3 +1767,3 @@ "browserify": "^17.0.0", | ||
"koa-router": "^12.0.0", | ||
"lint-staged": "^13.0.3", | ||
"lint-staged": "^13.0.4", | ||
"lodash": "^4.17.21", | ||
@@ -1768,0 +1770,0 @@ "nyc": "^15.1.0", |
@@ -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).Cabin=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","%%"],g=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)},p=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,b=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),m=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 j(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return A(e).forEach(r=>{b(t,r,j(e[r]))}),t}(e):h(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return A(e).forEach(r=>{b(t,r,j(e[r]))}),t}(e):e}const O=(e,t,r,n)=>(r.forEach(r=>{void 0===t[r]&&n.ignoreUndefined||(r in e&&e[r]!==Object.getPrototypeOf(e)?b(e,r,w(e[r],t[r],n)):b(e,r,j(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)),b(n,o++,t===e?t[r]:j(t[r])));n=O(n,t,A(t).filter(e=>!i.includes(e)),r)}),n})(e,t,r):h(t)&&h(e)?O(e,t,A(t),r):j(t)}var E=function(){const e=w(j(v),this!==m&&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._},S={};const _=async(e,t)=>{const r=[];let n=0;for(const o of e)r.push(await t(await o,n++));return r};(S=_).default=_;var T={},k=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!p(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 P=e=>"object"==typeof e||"function"==typeof e,x=(e,t)=>"__proto__"==e||"constructor"==e&&"function"==typeof t.constructor;var I=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".";if(!P(e)||!t||!t.length)return e;const o=Array.isArray(t)?t:String(t).split(n);if(x(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];x(e,o)||(o=P(o[e])?o[e]:o[e]={})}return o[t[i]]=n,e})(e,o,i,r)},L=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)};function F(e,t,r){return"function"==typeof r.join?r.join(e):e[0]+t+e[1]}function M(e,t,r){return"function"!=typeof r.isValid||r.isValid(e,t)}function N(e){return L(e)||Array.isArray(e)||"function"==typeof e}var C=Object.prototype.toString;function D(e){return"function"==typeof e.constructor?e.constructor.name:null}var X=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"===D(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(D(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=C.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}},U=function(e,t,r){return!(null==(n=e)||"object"!=typeof n&&"function"!=typeof n&&!Array.isArray(n)||"string"!=typeof t&&!Array.isArray(t))&&X(function(e,t,r){if(L(r)||(r={default:r}),!N(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 M(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=F([t.slice(0,-1),c[++f]||""],s,r);if(t in e){if(!M(t,e,r))return r.default;e=e[t]}else{let n=!1,o=f+1;for(;o<a;)if(n=(t=F([t,c[o++]],s,r))in e){if(!M(t,e,r))return r.default;e=e[t],f=o-1;break}if(!n)return r.default}}while(++f<a&&N(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 R=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(U(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 K,V,q,G="11.0.0",J=K={};function $(){throw new Error("setTimeout has not been defined")}function Q(){throw new Error("clearTimeout has not been defined")}function Y(e){if(V===setTimeout)return setTimeout(e,0);if((V===$||!V)&&setTimeout)return V=setTimeout,setTimeout(e,0);try{return V(e,0)}catch(t){try{return V.call(null,e,0)}catch(t){return V.call(this,e,0)}}}!function(){try{V="function"==typeof setTimeout?setTimeout:$}catch(e){V=$}try{q="function"==typeof clearTimeout?clearTimeout:Q}catch(e){q=Q}}();var Z,ee=[],te=!1,re=-1;function ne(){te&&Z&&(te=!1,Z.length?ee=Z.concat(ee):re=-1,ee.length&&oe())}function oe(){if(!te){var e=Y(ne);te=!0;for(var t=ee.length;t;){for(Z=ee,ee=[];++re<t;)Z&&Z[re].run();re=-1,t=ee.length}Z=null,te=!1,function(e){if(q===clearTimeout)return clearTimeout(e);if((q===Q||!q)&&clearTimeout)return q=clearTimeout,clearTimeout(e);try{q(e)}catch(t){try{return q.call(null,e)}catch(t){return q.call(this,e)}}}(e)}}function ie(e,t){this.fun=e,this.array=t}function se(){}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];ee.push(new ie(e,t)),1!==ee.length||te||Y(oe)},ie.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=se,J.addListener=se,J.once=se,J.off=se,J.removeListener=se,J.removeAllListeners=se,J.emit=se,J.prependListener=se,J.prependOnceListener=se,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 ce={};(function(t){(function(){"use strict";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 h(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 y(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}function d(e){return void 0===e}function b(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function m(e){return"string"==typeof e}ce=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=E({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()):[],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 T&&T(),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(!m(e)||-1===s.indexOf(e))throw new Error(a);m(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 m(e)?m(c[e])?c[e]:-1===s.indexOf(e)?"info":e:"info"}setName(e){if(!m(e))throw new Error("`name` must be a String");m(this.config.logger.scope)?this.config.logger.scope=e:this.config.logger.name=e}log(e,t,n){const o=[],a=[];d(e)||o.push(e),d(t)||o.push(t),d(n)||o.push(n);for(var f=arguments.length,v=new Array(f>3?f-3:0),A=3;A<f;A++)v[A-3]=arguments[A];for(const r of Array.prototype.slice.call(v))o.push(r);const{config:j}=this;let O=0;if(m(e)&&m(c[e])?e=c[e]:p(e)?(n=t,t=e,e="error"):m(e)&&-1!==s.indexOf(e)||(n=t,t=e,e=this.getNormalizedLevel(e),O=-1),-1===j.levels.indexOf(e))return;let w,E=!1;if((b(t)||Array.isArray(t))&&m(n)){E=!0;const e=n;n=t,t=m(e)&&o.length>=3+O?l(...o.slice(2+O)):e}if(d(t)&&(t=e),1!==o.slice(1+O).length||m(t)||p(t))if(!E&&o.length>=4+O){t=void 0,n={};const r=[];for(const e of o)p(e)?a.push(e):m(e)&&r.push(e);0===a.length&&r.length>0?t=l(...r):a.length>0&&"log"===e&&(e="error")}else if(!E&&o.length===3+O&&m(t)&&u.some(e=>-1!==t.indexOf(e)))t=l(t,n),n={};else if(p(t)){if(p(n)){a.push(n);for(const e of o.slice(2+O))n!==e&&p(e)&&a.push(e);n={}}}else p(n)?(a.push(n),n={}):b(n)||d(n)||null===n?m(t)||(t=l(t)):(t=l(t,n),n={});else n={message:t},t=e;d(n)||b(n)?b(n)||(n={}):n={original_meta:n},p(t)&&(a.unshift(t),t=void 0),b(n.err)&&(p(n.err)&&a.push(n.err),n.original_err=p(n.err)?k(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=k(w),m(t)||(t=w.message)),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(!y(this.config.meta.remappedFields))for(const r of Object.keys(this.config.meta.remappedFields))if(I(n,this.config.meta.remappedFields[r],g(n,r)),R(n,r),this.config.meta.cleanupRemapping){const e=r.lastIndexOf(".");if(-1===e)continue;const t=r.slice(0,e);y(g(n,t))&&R(n,t)}if(!y(this.config.meta.omittedFields)||!y(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;h(i)?e(i,s):t.push(s)}}(e),t}(n);if(!y(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(!y(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=g(e,n,r);return void 0!==o?I({},n,o,r):{}}return((e,t,r,n)=>{const o={};for(let i=0;i<r;i++){const r=t[i],s=g(e,r,n);void 0!==s&&I(o,r,s,n)}return o})(e,t,o,r)}(n,e)}j.silent||(p(w)&&j.showStack?!j.meta.show||y(n)?this.config.logger[_](w):this.config.logger[_](w,n):!j.meta.show||y(n)?this.config.logger[_](t):this.config.logger[_](t,n)),S(this.config.hooks.post,e=>e(_,w,t,n)).then().catch(e=>{this.config.logger.error(e)})}}}).call(this)}).call(this,K);var ae="11.0.2",fe={isNull:function(e){return null===e},isUndefined:function(e){return void 0===e},isObject:function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},isString:function(e){return"string"==typeof e},isFunction:function(e){return"function"==typeof e}};const{isNull:le,isUndefined:ue,isObject:ge,isString:pe,isFunction:he}=fe;return class{constructor(e){var t=this;if(this.config=E({logger:console,meta:{},parseRequest:{},errorProps:[],message:T,version:ae},e),!ge(this.config.logger))throw new Error("Logger option must be a logger object such as `console` or an instance of Axe");this.config.logger instanceof ce||(this.config.logger=new ce({logger:this.config.logger})),this.parseArg=this.parseArg.bind(this);for(const r of Object.keys(this.config.logger).filter(e=>he(this.config.logger[e])))this[r]=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];n[1]&&(n[1]=t.parseArg(n[1])),t.config.logger[r](...Array.prototype.slice.call(n))};this.err=this.error,this.warning=this.warn,this.setMeta=this.setMeta.bind(this),this.setUser=this.setUser.bind(this),he(T)&&(this.middleware=T.bind(this))}parseArg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ge(e)?(Object.assign(e,this.config.meta),e):(e=ue(e)||le(e)?{}:p(e)?{err:k(e,this.config.errorProps)}:Array.isArray(e)||pe(e)||"number"==typeof e?{value:e}:he(e)?{value:e.toString()}:{},Object.assign(e,this.config.meta),e)}setMeta(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config.meta=e}setUser(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config.meta.user=e}}})); | ||
!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).Cabin=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","%%"],g=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)},h=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:y}=Object.prototype,{propertyIsEnumerable:d}=Object,b=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),m=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 j(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return A(e).forEach(r=>{b(t,r,j(e[r]))}),t}(e):p(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return A(e).forEach(r=>{b(t,r,j(e[r]))}),t}(e):e}const O=(e,t,r,n)=>(r.forEach(r=>{void 0===t[r]&&n.ignoreUndefined||(r in e&&e[r]!==Object.getPrototypeOf(e)?b(e,r,w(e[r],t[r],n)):b(e,r,j(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)),b(n,o++,t===e?t[r]:j(t[r])));n=O(n,t,A(t).filter(e=>!i.includes(e)),r)}),n})(e,t,r):p(t)&&p(e)?O(e,t,A(t),r):j(t)}var E=function(){const e=w(j(v),this!==m&&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(!p(i))throw new TypeError("`"+i+"` is not an Option Object");t=w(t,{_:i},e)}return t._},S={};const _=async(e,t)=>{const r=[];let n=0;for(const o of e)r.push(await t(await o,n++));return r};(S=_).default=_;var T={},P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!h(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,x=(e,t)=>"__proto__"==e||"constructor"==e&&"function"==typeof t.constructor;var I=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(x(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];x(e,o)||(o=k(o[e])?o[e]:o[e]={})}return o[t[i]]=n,e})(e,o,i,r)},L=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)};function F(e,t,r){return"function"==typeof r.join?r.join(e):e[0]+t+e[1]}function M(e,t,r){return"function"!=typeof r.isValid||r.isValid(e,t)}function N(e){return L(e)||Array.isArray(e)||"function"==typeof e}var C=Object.prototype.toString;function D(e){return"function"==typeof e.constructor?e.constructor.name:null}var X=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"===D(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(D(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=C.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}},U=function(e,t,r){return!(null==(n=e)||"object"!=typeof n&&"function"!=typeof n&&!Array.isArray(n)||"string"!=typeof t&&!Array.isArray(t))&&X(function(e,t,r){if(L(r)||(r={default:r}),!N(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 M(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=F([t.slice(0,-1),c[++f]||""],s,r);if(t in e){if(!M(t,e,r))return r.default;e=e[t]}else{let n=!1,o=f+1;for(;o<a;)if(n=(t=F([t,c[o++]],s,r))in e){if(!M(t,e,r))return r.default;e=e[t],f=o-1;break}if(!n)return r.default}}while(++f<a&&N(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 H=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(U(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},R={};Object.defineProperty(R,"__esModule",{value:!0}),R.boolean=void 0,R.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 R.boolean}}),Object.defineProperty(z,"isBooleanable",{enumerable:!0,get:function(){return W.isBooleanable}});var K,V,q,G="11.0.2",J=K={};function $(){throw new Error("setTimeout has not been defined")}function Q(){throw new Error("clearTimeout has not been defined")}function Y(e){if(V===setTimeout)return setTimeout(e,0);if((V===$||!V)&&setTimeout)return V=setTimeout,setTimeout(e,0);try{return V(e,0)}catch(t){try{return V.call(null,e,0)}catch(t){return V.call(this,e,0)}}}!function(){try{V="function"==typeof setTimeout?setTimeout:$}catch(e){V=$}try{q="function"==typeof clearTimeout?clearTimeout:Q}catch(e){q=Q}}();var Z,ee=[],te=!1,re=-1;function ne(){te&&Z&&(te=!1,Z.length?ee=Z.concat(ee):re=-1,ee.length&&oe())}function oe(){if(!te){var e=Y(ne);te=!0;for(var t=ee.length;t;){for(Z=ee,ee=[];++re<t;)Z&&Z[re].run();re=-1,t=ee.length}Z=null,te=!1,function(e){if(q===clearTimeout)return clearTimeout(e);if((q===Q||!q)&&clearTimeout)return q=clearTimeout,clearTimeout(e);try{q(e)}catch(t){try{return q.call(null,e)}catch(t){return q.call(this,e)}}}(e)}}function ie(e,t){this.fun=e,this.array=t}function se(){}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];ee.push(new ie(e,t)),1!==ee.length||te||Y(oe)},ie.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=se,J.addListener=se,J.once=se,J.off=se,J.removeListener=se,J.removeAllListeners=se,J.emit=se,J.prependListener=se,J.prependOnceListener=se,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 ce={};(function(t){(function(){"use strict";const{boolean:n}=z,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 p(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 y(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}function d(e){return void 0===e}function b(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function m(e){return"string"==typeof e}ce=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=E({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()):[],pickedFields:t.env.AXE_PICK_META_FIELDS?t.env.AXE_PICK_META_FIELDS.split(",").map(e=>e.trim()):[],cleanupRemapping:!0,hideHTTP:!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 T&&T(),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(!m(e)||-1===s.indexOf(e))throw new Error(a);m(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 m(e)?m(c[e])?c[e]:-1===s.indexOf(e)?"info":e:"info"}setName(e){if(!m(e))throw new Error("`name` must be a String");m(this.config.logger.scope)?this.config.logger.scope=e:this.config.logger.name=e}log(e,t,n){const o=[],a=[];d(e)||o.push(e),d(t)||o.push(t),d(n)||o.push(n);for(var f=arguments.length,v=new Array(f>3?f-3:0),A=3;A<f;A++)v[A-3]=arguments[A];for(const r of Array.prototype.slice.call(v))o.push(r);let j=0;if(m(e)&&m(c[e])?e=c[e]:h(e)?(n=t,t=e,e="error"):m(e)&&-1!==s.indexOf(e)||(n=t,t=e,e=this.getNormalizedLevel(e),j=-1),-1===this.config.levels.indexOf(e))return;let O,w=!1;if((b(t)||Array.isArray(t))&&m(n)){w=!0;const e=n;n=t,t=m(e)&&o.length>=3+j?l(...o.slice(2+j)):e}if(d(t)&&(t=e),1!==o.slice(1+j).length||m(t)||h(t))if(!w&&o.length>=4+j){t=void 0,n={};const r=[];for(const e of o)h(e)?a.push(e):m(e)&&r.push(e);0===a.length&&r.length>0?t=l(...r):a.length>0&&"log"===e&&(e="error")}else if(!w&&o.length===3+j&&m(t)&&u.some(e=>-1!==t.indexOf(e)))t=l(t,n),n={};else if(h(t)){if(h(n)){a.push(n);for(const e of o.slice(2+j))n!==e&&h(e)&&a.push(e);n={}}}else h(n)?(a.push(n),n={}):b(n)||d(n)||null===n?m(t)||(t=l(t)):(t=l(t,n),n={});else n={message:t},t=e;d(n)||b(n)?b(n)||(n={}):n={original_meta:n},h(t)&&(a.unshift(t),t=void 0),b(n.err)&&(h(n.err)&&a.push(n.err),n.original_err=h(n.err)?P(n.err):n.err),a.length>0&&(O=function(e){if(0!==(e=e.filter(i)).length)return 1===e.length?e[0]:new r(e)}(a),n.err=P(O),m(t)||(t=O.message)),n.level=e,this.appInfo&&(n.app=this.appInfo);const E=-1===j?"log":e;for(const r of this.config.hooks.pre)[O,t,n]=r(E,O,t,n);if(!y(this.config.meta.remappedFields))for(const r of Object.keys(this.config.meta.remappedFields))if(I(n,this.config.meta.remappedFields[r],g(n,r)),H(n,r),this.config.meta.cleanupRemapping){const e=r.lastIndexOf(".");if(-1===e)continue;const t=r.slice(0,e);y(g(n,t))&&H(n,t)}if(!y(this.config.meta.omittedFields)||!y(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;p(i)?e(i,s):t.push(s)}}(e),t}(n);if(!y(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(!y(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=g(e,n,r);return void 0!==o?I({},n,o,r):{}}return((e,t,r,n)=>{const o={};for(let i=0;i<r;i++){const r=t[i],s=g(e,r,n);void 0!==s&&I(o,r,s,n)}return o})(e,t,o,r)}(n,e)}this.config.silent||(h(O)&&this.config.showStack?!this.config.meta.show||y(n)?this.config.logger[E](O):this.config.logger[E](O,n):!this.config.meta.show||y(n)||n.is_http&&this.config.meta.hideHTTP?this.config.logger[E](t):this.config.logger[E](t,n)),S(this.config.hooks.post,e=>e(E,O,t,n)).then().catch(e=>{this.config.logger.error(e)})}}}).call(this)}).call(this,K);var ae="11.0.3",fe={isNull:function(e){return null===e},isUndefined:function(e){return void 0===e},isObject:function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},isString:function(e){return"string"==typeof e},isFunction:function(e){return"function"==typeof e}};const{isNull:le,isUndefined:ue,isObject:ge,isString:he,isFunction:pe}=fe;return class{constructor(e){var t=this;if(this.config=E({logger:console,meta:{},parseRequest:{},errorProps:[],message:T,version:ae},e),!ge(this.config.logger))throw new Error("Logger option must be a logger object such as `console` or an instance of Axe");this.config.logger instanceof ce||(this.config.logger=new ce({logger:this.config.logger})),this.parseArg=this.parseArg.bind(this);for(const r of Object.keys(this.config.logger).filter(e=>pe(this.config.logger[e])))this[r]=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];n[1]&&(n[1]=t.parseArg(n[1])),t.config.logger[r](...Array.prototype.slice.call(n))};this.err=this.error,this.warning=this.warn,this.setMeta=this.setMeta.bind(this),this.setUser=this.setUser.bind(this),pe(T)&&(this.middleware=T.bind(this))}parseArg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ge(e)?(Object.assign(e,this.config.meta),e):(e=ue(e)||le(e)?{}:h(e)?{err:P(e,this.config.errorProps)}:Array.isArray(e)||he(e)||"number"==typeof e?{value:e}:pe(e)?{value:e.toString()}:{},Object.assign(e,this.config.meta),e)}setMeta(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config.meta=e}setUser(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config.meta.user=e}}})); |
{ | ||
"name": "cabin", | ||
"description": "Cabin is the best self-hosted JavaScript and Node.js logging service.", | ||
"version": "11.0.2", | ||
"version": "11.0.3", | ||
"author": "Titanism", | ||
@@ -26,3 +26,3 @@ "browser": { | ||
"parse-err": "^0.0.12", | ||
"parse-request": "^5.0.1" | ||
"parse-request": "^5.1.0" | ||
}, | ||
@@ -36,3 +36,3 @@ "devDependencies": { | ||
"ava": "^5.1.0", | ||
"axe": "^11.0.0", | ||
"axe": "^11.0.2", | ||
"babelify": "^10.0.0", | ||
@@ -54,3 +54,3 @@ "browserify": "^17.0.0", | ||
"koa-router": "^12.0.0", | ||
"lint-staged": "^13.0.3", | ||
"lint-staged": "^13.0.4", | ||
"lodash": "^4.17.21", | ||
@@ -57,0 +57,0 @@ "nyc": "^15.1.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
122390
2138
Updatedparse-request@^5.1.0