Socket
Socket
Sign inDemoInstall

redact-object

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redact-object - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

index.d.ts

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",

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