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

fast-redact

Package Overview
Dependencies
Maintainers
1
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 1.1.4 to 1.1.5

1

example/default-usage.js

@@ -15,2 +15,1 @@ 'use strict'

console.log(redact(fauxRequest))

2

example/intermediate-wildcard-array.js

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

}
console.log(redact(obj))
console.log(redact(obj))
'use strict'
const fastRedact = require('..')
const redact = fastRedact({
paths: ['a'],
paths: ['a'],
serialize: false

@@ -11,2 +11,2 @@ })

console.log(redact.restore(o) === o)
console.log(o)
console.log(o)
'use strict'
const fastRedact = require('..')
const redact = fastRedact({paths: ['a'], serialize: (o) => JSON.stringify(o, 0, 2)})
console.log(redact({a: 1, b: 2}))
console.log(redact({a: 1, b: 2}))

@@ -9,2 +9,2 @@ 'use strict'

}
console.log(redact(obj))
console.log(redact(obj))

@@ -23,4 +23,4 @@ 'use strict'

const serialize = 'serialize' in opts ? (
opts.serialize === false ? opts.serialize :
(typeof opts.serialize === 'function' ? opts.serialize : JSON.stringify)
opts.serialize === false ? opts.serialize
: (typeof opts.serialize === 'function' ? opts.serialize : JSON.stringify)
) : JSON.stringify

@@ -31,5 +31,5 @@ const remove = opts.remove

}
const censor = remove === true ?
undefined :
'censor' in opts ? opts.censor : DEFAULT_CENSOR
const censor = remove === true
? undefined
: 'censor' in opts ? opts.censor : DEFAULT_CENSOR

@@ -36,0 +36,0 @@ if (paths.length === 0) return serialize || noop

@@ -32,6 +32,6 @@ 'use strict'

o[strPath] = {
path: path,
val: null,
path: path,
val: null,
precensored: false,
circle: '',
circle: '',
escPath: JSON.stringify(strPath)

@@ -38,0 +38,0 @@ }

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

if (/\/\*/.test(expr)) throw Error()
/* eslint-disable-next-line */
runInContext(`

@@ -35,3 +34,3 @@ (function (

Int16Array, Int32Array, Int8Array, Intl, JSON, Map,
Math, NaN, Number, Object, Promise, Proxy, RangeError,
Math, Number, Object, Promise, Proxy, RangeError,
ReferenceError, Reflect, RegExp, Set, SharedArrayBuffer,

@@ -38,0 +37,0 @@ String, Symbol, SyntaxError, TypeError, URIError,

{
"name": "fast-redact",
"version": "1.1.4",
"version": "1.1.5",
"description": "very fast object redaction",

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

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

test('removes during serialization instead of redacting when remove option is true', ({end, is}) => {

@@ -192,0 +191,0 @@ const redact = fastRedact({paths: ['a'], remove: true})

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