fast-redact
Advanced tools
Comparing version 1.5.0 to 2.0.0
'use strict' | ||
module.exports = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))$/g | ||
module.exports = /[^.[\]]+|\[((?:.)*?)\]/g |
{ | ||
"name": "fast-redact", | ||
"version": "1.5.0", | ||
"version": "2.0.0", | ||
"description": "very fast object redaction", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"test": "tap test", | ||
"pretest": "standard index.js 'lib/*.js' 'example/*.js' benchmark/index.js test/index.js | snazzy", | ||
"posttest": "standard index.js 'lib/*.js' 'example/*.js' benchmark/index.js test/index.js | snazzy", | ||
"cov": "tap --cov test", | ||
@@ -11,0 +11,0 @@ "cov-ui": "tap --coverage-report=html test", |
@@ -951,1 +951,15 @@ 'use strict' | ||
}) | ||
test('handles keys with dots', ({ end, is }) => { | ||
const redactSingleQ = fastRedact({ paths: [`a['b.c']`], serialize: false }) | ||
const redactDoubleQ = fastRedact({ paths: [`a["b.c"]`], serialize: false }) | ||
const redactBacktickQ = fastRedact({ paths: ['a[`b.c`]'], serialize: false }) | ||
const redactNum = fastRedact({ paths: [`a[-1.2]`], serialize: false }) | ||
const redactLeading = fastRedact({ paths: [`["b.c"]`], serialize: false }) | ||
is(redactSingleQ({ a: { 'b.c': 'x', '-1.2': 'x' } }).a['b.c'], censor) | ||
is(redactDoubleQ({ a: { 'b.c': 'x', '-1.2': 'x' } }).a['b.c'], censor) | ||
is(redactBacktickQ({ a: { 'b.c': 'x', '-1.2': 'x' } }).a['b.c'], censor) | ||
is(redactNum({ a: { 'b.c': 'x', '-1.2': 'x' } }).a['-1.2'], censor) | ||
is(redactLeading({ 'b.c': 'x', '-1.2': 'x' })['b.c'], censor) | ||
end() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64413
1426