redact-axios-error
Advanced tools
Comparing version 0.1.14 to 1.0.0
@@ -1,2 +0,2 @@ | ||
import { test } from 'ava' | ||
import test from 'ava' | ||
import express from 'express' | ||
@@ -15,3 +15,2 @@ import bodyParser from 'body-parser' | ||
let axiosClient | ||
let reqHeaders | ||
@@ -96,3 +95,3 @@ let server | ||
t.is(groomedError.config.baseURL, "http://localhost:3000") | ||
t.is(groomedError.config.url, "http://localhost:3000/notFound?foo=bar") | ||
t.true(groomedError.config.url.includes('/notFound?foo=bar')) | ||
t.is(groomedError.config.data, "{\"some\":true}") | ||
@@ -114,3 +113,3 @@ t.truthy(groomedError.response.data) | ||
t.is(groomedError.config.baseURL, "http://localhost:3000") | ||
t.is(groomedError.config.url, "http://localhost:3000/notFound") | ||
t.true(groomedError.config.url.includes('/notFound')) | ||
t.is(groomedError.config.data, "{\"some\":true}") | ||
@@ -132,3 +131,3 @@ t.truthy(groomedError.response.data) | ||
t.is(groomedError.config.baseURL, "http://localhost:3000") | ||
t.is(groomedError.config.url, "http://localhost:3000/notFound?[REDACTED]") | ||
t.true(groomedError.config.url.includes('/notFound?[REDACTED]')) | ||
t.is(groomedError.config.data, "[REDACTED]") | ||
@@ -155,3 +154,3 @@ t.is(groomedError.response.data, "[REDACTED]") | ||
t.is(groomedError.config.baseURL, "http://badServer:3000") | ||
t.is(groomedError.config.url, "http://badServer:3000/?foo=bar") | ||
t.true(groomedError.config.url.includes('/?foo=bar')) | ||
t.is(groomedError.config.data, "{\"some\":true}") | ||
@@ -163,3 +162,2 @@ t.falsy(groomedError.config.headers.Authorization) | ||
t.is(groomedError.syscall, "getaddrinfo") | ||
t.is(groomedError.port, "3000") | ||
t.deepEqual({}, groomedError.response) | ||
@@ -180,3 +178,3 @@ } | ||
t.is(groomedError.config.baseURL, "http://localhost:3000") | ||
t.is(groomedError.config.url, "http://localhost:3000/errorPost?foo=bar") | ||
t.true(groomedError.config.url.includes('/errorPost?foo=bar')) | ||
t.is(groomedError.config.data, "{\"some\":true}") | ||
@@ -199,3 +197,3 @@ t.truthy(groomedError.response.data) | ||
t.is(groomedError.config.baseURL, "http://localhost:3000") | ||
t.is(groomedError.config.url, "http://localhost:3000/errorPost?foo=bar") | ||
t.true(groomedError.config.url.includes('/errorPost?foo=bar')) | ||
t.is(groomedError.config.data, "{\"some\":true}") | ||
@@ -218,3 +216,3 @@ t.truthy(groomedError.response.data) | ||
t.is(groomedError.config.baseURL, "http://localhost:3000") | ||
t.is(groomedError.config.url, "http://localhost:3000/errorPost?[REDACTED]") | ||
t.true(groomedError.config.url.includes('/errorPost?[REDACTED]')) | ||
t.is(groomedError.config.data, "[REDACTED]") | ||
@@ -241,3 +239,3 @@ t.is(groomedError.response.data, "[REDACTED]") | ||
t.is(groomedError.cause.config.baseURL, "http://localhost:3000") | ||
t.is(groomedError.cause.config.url, "http://localhost:3000/errorPost?[REDACTED]") | ||
t.true(groomedError.cause.config.url.includes('/errorPost?[REDACTED]')) | ||
t.is(groomedError.cause.config.data, "[REDACTED]") | ||
@@ -265,3 +263,3 @@ t.is(groomedError.cause.response.data, "[REDACTED]") | ||
t.is(groomedError.cause.config.baseURL, "http://localhost:3000") | ||
t.is(groomedError.cause.config.url, "http://localhost:3000/errorPost?[REDACTED]") | ||
t.true(groomedError.cause.config.url.includes('/errorPost?[REDACTED]')) | ||
t.is(groomedError.cause.config.data, "[REDACTED]") | ||
@@ -293,3 +291,3 @@ t.is(groomedError.cause.response.data, "[REDACTED]") | ||
t.is(cause.cause.config.baseURL, "http://localhost:3000") | ||
t.is(cause.cause.config.url, "http://localhost:3000/errorPost?[REDACTED]") | ||
t.true(cause.cause.config.url.includes('/errorPost?[REDACTED]')) | ||
t.is(cause.cause.config.data, "[REDACTED]") | ||
@@ -296,0 +294,0 @@ t.is(cause.cause.response.data, "[REDACTED]") |
module.exports = { | ||
"parser": "babel-eslint", | ||
"extends": "airbnb-base", | ||
"plugins": [ | ||
"import" | ||
], | ||
"rules": { | ||
"semi": [2, 'never'], | ||
"import/no-extraneous-dependencies": ['error', { devDependencies: true }], | ||
"max-len": "off", | ||
"import/prefer-default-export" : "off", | ||
"no-use-before-define": "off", | ||
"no-return-assign": ["error", "except-parens"], | ||
"no-param-reassign": "off" | ||
} | ||
}; | ||
extends: 'airbnb-base', | ||
plugins: [ | ||
'import', | ||
], | ||
rules: { | ||
semi: [2, 'never'], | ||
'import/no-extraneous-dependencies': ['error', { devDependencies: true }], | ||
'max-len': 'off', | ||
'import/prefer-default-export': 'off', | ||
'no-use-before-define': 'off', | ||
'no-return-assign': ['error', 'except-parens'], | ||
'no-param-reassign': 'off', | ||
}, | ||
} |
@@ -1,7 +0,3 @@ | ||
// for es6 install esm and switch to lines marked es6 | ||
// npm i -S esm | ||
// eslint-disable-next-line no-global-assign | ||
// require = require('esm')(module/* , options */) //es6 | ||
// module.exports = require('./lib/redact-error') // es6 | ||
// user the following for es5 | ||
module.exports = require('./dist/redact-axios-error') // es5 | ||
require = require('esm')(module/* , options */) | ||
module.exports = require('./lib/redact-axios-error') |
import traverse from 'traverse' | ||
import safeClone from 'safe-clone-deep' | ||
// import stringify from 'json-stringify-safe' | ||
@@ -63,3 +64,2 @@ export class AxiosErrorGroomer { | ||
if (err.address != null) groomedAxiosError.address = err.address | ||
if (err.port != null) groomedAxiosError.port = err.port | ||
@@ -66,0 +66,0 @@ groomedAxiosError.config = this.getClonedRedactedConfig(err.config) |
{ | ||
"name": "redact-axios-error", | ||
"version": "0.1.14", | ||
"version": "1.0.0", | ||
"engines": { | ||
"node": ">=10.13.0" | ||
}, | ||
"description": "grooms and redacts axios errors to trim them down and make them more useful for logging", | ||
@@ -10,4 +13,2 @@ "main": "index.js", | ||
"test": "npm run ava", | ||
"build": "babel lib --presets babel-preset-es2015 --out-dir dist", | ||
"prepublish": "npm run build", | ||
"watchLint": "esw . --ext=js --ignore-pattern '**/__tests__' --ignore-path .gitignore --fix --watch", | ||
@@ -32,14 +33,9 @@ "lint": "eslint . --ext=js --ignore-pattern '**/__tests__' --ignore-path .gitignore --fix" | ||
"devDependencies": { | ||
"ava": "^0.16.0", | ||
"axios": "^0.18.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-eslint": "^10.0.1", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-preset-env": "^1.7.0", | ||
"babel-register": "^6.26.0", | ||
"ava": "^3.13.0", | ||
"axios": "^0.21.0", | ||
"body-parser": "^1.18.3", | ||
"eslint": "^5.14.0", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
"eslint": "^7.12.1", | ||
"eslint-config-airbnb-base": "^14.2.0", | ||
"eslint-plugin-import": "^2.16.0", | ||
"eslint-watch": "^4.0.2", | ||
"eslint-watch": "^7.0.0", | ||
"express": "^4.16.4", | ||
@@ -50,3 +46,3 @@ "ignore-styles": "^5.0.1", | ||
"dependencies": { | ||
"babel-polyfill": "^6.26.0", | ||
"esm": "^3.2.25", | ||
"lodash": "^4.17.11", | ||
@@ -64,7 +60,5 @@ "safe-clone-deep": "^1.1.5", | ||
"ignore-styles", | ||
"babel-register", | ||
"babel-polyfill" | ||
], | ||
"babel": "inherit" | ||
"esm" | ||
] | ||
} | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10
1
24007
9
422
+ Addedesm@^3.2.25
+ Addedesm@3.2.25(transitive)
- Removedbabel-polyfill@^6.26.0
- Removedbabel-polyfill@6.26.0(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedregenerator-runtime@0.10.50.11.1(transitive)