simple-object-handler
v0.0.1
Published
Simple object handler where it is possible to clean params from object, verify if object is empty, get object keys, params, and much more.
Downloads
25
Maintainers
Readme
Simple Object Handler
Table of Contents
1. Intro
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.
2. 🚀 Why should you use ?
- Create a better readable code;
- Dry your code and avoid reuse many ifs or long Object functions from JavaScript.
- Light library.
- Easy to install.
3. 📦 Installation
npm install simple-object-handler
4. 📖 Usage
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.
5. 📄 Tests
You can find more examples how to use the library in test folder.
You can run the applications tests with
npm test
6. 📄 License
Simple Object Handler is MIT licensed.