Redacts values in xml. Useful when sending data to external logging services such as Sentry.
Install the package via npm
:
$ npm install mask-xml
collection
(Array): An array of keys to redact.[options]
(Object): An optional object with the following options:
Option | Default value | Description |
---|---|---|
ignoreCase | false | Whether to ignore case sensitivity when matching keys |
replacement | --REDACTED-- | The default value to replace |
(Function): Returns a function that will redact values from a given xml string.
var blacklist = ['password', 'username'];
var maskXml = require('mask-xml')(blacklist);
maskXml(`<xml><password>foo</password><username>bar</username></xml>`);
// => '<xml><password>--REDACTED--</password><username>--REDACTED--</username></xml>'
$ npm test
npm version [<new version> | major | minor | patch] -m "Release %s"
MIT