1.0.10 • Published 4 years ago

array-refactor v1.0.10

Weekly downloads
162
License
MIT
Repository
github
Last release
4 years ago

array-refactor

Installation

npm install array-refactor --save

Usage

Hide/Show sensitive information from an object or array of objects with deep searching.

array-refactor is refactoring any sensitive data in user collection or any personal data.

By using array-refactor you can remove given sensitive data before transfer to logs or public. You can also create new array or object for sensitive data. There are many uses of array-refactor.

const arrayRefactor = require('array-refactor');

// There is no limit for array inside array

let arr = [{
    name: 'Srujal Patel',
    password: '12345678',
    userToken: 'xhfgg$3Ssf',
    Gender: 'Male',
    Address: 'address'
  }] 

// OR

let arr = {
  name: 'Srujal Patel',
  password: '12345678',
  userToken: 'xhfgg$3Ssf',
  Gender: 'Male',
  Address: 'address'
}

// keys are must be array or string for refactor

let keysArr = ['password', 'userToken']

// OR

let keysArr = 'password'

// Pop method will remove all objects given by keysArr (Object Keys)

let newArr = arrayRefactor.pop(arr, keysArr)

/* => 
      [{
        name: 'Srujal Patel',
        Gender: 'Male',
        Address: 'address'
      }]

    OR
      
      {
        name: 'Srujal Patel',
        Gender: 'Male',
        Address: 'address'
      }
*/

// Push method will remain in object or array basend on given by keysArr (Object Keys)

let newArr = arrayRefactor.push(arr, keysArr)

/* => 
      [{
        password: '12345678',
        userToken: 'xhfgg$3Ssf',
      }]

    OR

      {
        password: '12345678',
      }
*/

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Srujal Patel

License

Copyright © 2020, Srujal Patel. Released under the MIT License.

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago