Socket
Socket
Sign inDemoInstall

fast-redact

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-redact - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

10

lib/modifiers.js

@@ -134,3 +134,7 @@ 'use strict'

} else {
wcov[k] = (nv === undefined && censor !== undefined) || (has(wcov, k) && nv === ov) ? wcov[k] : nv
if (wcov[k] === nv) {
exists = false
} else {
wcov[k] = (nv === undefined && censor !== undefined) || (has(wcov, k) && nv === ov) ? wcov[k] : nv
}
}

@@ -151,2 +155,6 @@ }

if (typeof n !== 'object') break
// prevent circular structure, see https://github.com/pinojs/pino/issues/1513
if (ov === oov) {
exists = false
}
}

@@ -153,0 +161,0 @@ return { value: ov, parent: oov, exists }

2

package.json
{
"name": "fast-redact",
"version": "3.1.1",
"version": "3.1.2",
"description": "very fast object redaction",

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

@@ -1251,1 +1251,30 @@ 'use strict'

})
test('handles multi wildcards with pattern repetition', ({ end, is }) => {
const redact = fastRedact({
paths: ['*.d', '*.*.d', '*.*.*.d']
})
const o = {
x: { c: { d: 'hide me', e: 'leave me be' } },
y: { c: { d: 'and me', f: 'I want to live' } },
z: { c: { d: 'and also I', g: 'I want to run in a stream' } }
}
is(redact(o), '{"x":{"c":{"d":"[REDACTED]","e":"leave me be"}},"y":{"c":{"d":"[REDACTED]","f":"I want to live"}},"z":{"c":{"d":"[REDACTED]","g":"I want to run in a stream"}}}')
end()
})
test('restores multi wildcards with pattern repetition', ({ end, is }) => {
const redact = fastRedact({
paths: ['*.d', '*.*.d', '*.*.*.d']
})
const o = {
x: { c: { d: 'hide me', e: 'leave me be' } },
y: { c: { d: 'and me', f: 'I want to live' } },
z: { c: { d: 'and also I', g: 'I want to run in a stream' } }
}
redact(o)
is(o.x.c.d, 'hide me')
is(o.y.c.d, 'and me')
is(o.z.c.d, 'and also I')
end()
})

Sorry, the diff of this file is not supported yet

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