The idea of Simple Object Handler it came with a necessity of make simple functions in a manner of be easier to read and easily handle objects in a way which hasn't as a native functions in JavaScript. It would be possible with these functions to handle objects such as check is empty or not, a lenght of keys or params, clean/remove all empty params (considering empty string, null or undefined), get an array of all keys or params values and much more.
- Create a better readable code;
- Dry your code and avoid reuse many ifs or long Object functions from JavaScript.
- Light library.
- Easy to install.
npm install simple-object-handler
You can find at simple-object-handler the functions:
- isObjectEmpty
- isObjectNotEmpty
- objectKeys
- objectValues
- countObjectKeys
- countObjectValues
- isObject
- isParamEmpty
- removeEmptyFieldsFromObject
// You can use simply desconstructor way
const {
isObjectEmpty
isObjectNotEmpty
objectKeys
objectValues
countObjectKeys
countObjectValues
isObject
isParamEmpty
removeEmptyFieldsFromObject
} = require('simple-object-handler');
Would you like to know an example in how to use those functions ? Take a look at the wiki, there you can find an example of all that list of functions.
You can run the applications tests with
npm test
Simple Object Handler is MIT licensed.