Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-personal-data-filter

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-personal-data-filter - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

13

index.js

@@ -54,7 +54,12 @@ "use strict";

_maskPersonalDataProperties(data, referencesCache) {
return _.reduce(data, (result, v, k) => {
if (this._personalDataProperties.indexOf(k.toString().toLowerCase()) >= 0) {
result[k] = this._mask;
// It's important to use getOwnPropertyNames here
// because if someone were to pass something with non-enumerable properties (e.g. an instance of the Error class)
// then a simple _.reduce would simply skip over the non-enumerable properties ultimately removing them from the result
const propertyNames = Object.getOwnPropertyNames(data);
return _.reduce(propertyNames, (result, key) => {
const value = data[key];
if (this._personalDataProperties.indexOf(key.toString().toLowerCase()) >= 0) {
result[key] = this._mask;
} else {
result[k] = this._filterRecursively(v, referencesCache);
result[key] = this._filterRecursively(value, referencesCache);
}

@@ -61,0 +66,0 @@

{
"name": "node-personal-data-filter",
"version": "0.2.1",
"version": "0.2.2",
"description": "node-personal-data-filter",

@@ -5,0 +5,0 @@ "main": "index.js",

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