1.0.5 • Published 9 years ago

blur v1.0.5

Weekly downloads
17
License
ISC
Repository
github
Last release
9 years ago

Blur

A library for filtering information from objects such as credit card information or other things which may be logged

Usage

var obj = {
    creditcard: {
        number: 'ABCDEFGHIJKLMNOP',
        year: 17,
        month: 4
    }
};

var result = Blur(obj, { number: Blur.creditCard });

Will result in

{
    creditcard: {
        number: 'XXXXXXXXXXXXMNOP',
        year: 17,
        month: 4
    }
}

Blur(object, options)

Recursively operate on keys in an object to censor, remove or modify values in some way to make it safe for logging.

  • object - Object to operated on
  • options - object describing keys to be modified where:
    • <keyName> - name of key to be modified, and value is type of operation to be performed.

Operation types:

  • Blur.creditCard - This option is used to set any string to show only the last four characters and blur out the rest with X's
  • Blur.remove - Completely removes all matching keys
  • Blur.censor - Replaces all values matching keys with the string [BLURRED]
1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago