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.0.1 to 3.0.2

1

lib/restorer.js

@@ -11,3 +11,2 @@ 'use strict'

const paths = Object.keys(secret)
.filter((path) => secret[path].precensored === false)
const resetters = resetTmpl(secret, paths)

@@ -14,0 +13,0 @@ const hasWildcards = wcLen > 0

2

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

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

@@ -292,2 +292,18 @@ 'use strict'

test('redact.restore function places original values back in place when called twice and the first call is precensored', ({ end, is }) => {
const censor = 'test'
const redact = fastRedact({ paths: ['a'], censor, serialize: false })
const o1 = { a: censor }
const o2 = { a: 'a' }
redact(o1)
is(o1.a, censor)
redact.restore(o1)
is(o1.a, censor)
redact(o2)
is(o2.a, censor)
redact.restore(o2)
is(o2.a, 'a')
end()
})
test('masks according to supplied censor function', ({ end, is }) => {

@@ -294,0 +310,0 @@ const redact = fastRedact({ paths: ['a'], censor: censorFct, serialize: false })

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