Your IP : 216.73.216.17


Current Path : /etc/kibana/node_modules/redact-secrets/
Upload File :
Current File : //etc/kibana/node_modules/redact-secrets/index.js

'use strict'

var traverse = require('traverse')
var isSecret = require('is-secret')

module.exports = function (redacted) {
  return {
    map: map,
    forEach: forEach
  }

  function map (obj) {
    return traverse(obj).map(function (val) {
      if (isSecret.key(this.key) || isSecret.value(val)) this.update(redacted)
    })
  }

  function forEach (obj) {
    traverse(obj).forEach(function (val) {
      if (isSecret.key(this.key) || isSecret.value(val)) this.update(redacted)
    })
  }
}