redact-object
Advanced tools
Comparing version 2.2.0 to 2.3.0
12
index.js
@@ -11,6 +11,2 @@ 'use strict'; | ||
function isFunction (value) { | ||
return typeof value === 'function'; | ||
} | ||
/** | ||
@@ -45,3 +41,3 @@ * Checks for match | ||
* strict: boolean, do strict key matching, default true | ||
* ignoreFunctions: boolean, ignore functions instead of error, default false | ||
* ignoreUnknown: boolean, ignore unknown types instead of error, default false | ||
* } | ||
@@ -54,3 +50,3 @@ * @return {object} the new redacted object | ||
const strict = config.hasOwnProperty('strict') ? config.strict : true; | ||
const ignoreFunctions = config.hasOwnProperty('ignoreFunctions') ? config.ignoreFunctions : false; | ||
const ignoreUnknown = config.hasOwnProperty('ignoreUnknown') ? config.ignoreUnknown : false; | ||
@@ -79,4 +75,4 @@ if (!isObject(target)) { | ||
// Redaction only works on arrays, plain objects, and primitives. | ||
if (isFunction(target) && ignoreFunctions) { | ||
// ignore the function instead of throwing an error | ||
if (ignoreUnknown) { | ||
// ignore the unknown type instead of throwing an error | ||
return target; | ||
@@ -83,0 +79,0 @@ } else { |
{ | ||
"name": "redact-object", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Object redactor", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
"typings": "index.d.ts", | ||
"scripts": { | ||
@@ -10,0 +12,0 @@ "test": "npm run lint && npm run unit", |
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
8092
4
97