0.0.3 • Published 7 years ago

object-omit-ignore-case v0.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

What you'll get?

Analog for lodash "omit", but with possibility to ignore case of omitted properties

1. Install the package

npm install object-omit-ignore-case --save

2. Use it as lodash omit, but put '/i' at the end of each property which case should be ignored

var req = {
    headers: {
        'X-HTTP-Header': 'value',
        Auth: 'value'
    },
    body: {
        LOG: {
            'Body-Param1': 1,
            'Body-Param2': 2,
        }
    }
};

var omit_ic = require('object-omit-ignore-case');

var objectToLog = omit_ic(req, ['headers.x-http-header/i', 'body.log/i.body-param1/i']);
/*
objectToLog = {
    headers: {
      Auth: 'value'
    },
    body: {
        LOG: {
            Body-Param2: 2
        }
    }
}
*/

That's it!