{"repo":"bluet/obj-filter","free":true,"listed":false,"github":"https://github.com/bluet/obj-filter","clone":"git clone https://github.com/bluet/obj-filter.git","description":"JavaScript Object Filter. Deep filtering key/content recursively. Support wildcard, nested, and filter function in template.","language":"JavaScript","stars":16,"topics":["object","filter","template","javascript","nodejs","wildcard","nested","function","browser","fossa-status"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"obj-filter - JavaScript Object Filter / Merger. JavaScript Object Filter. Deep filtering key/content recursively . Support type checking , wildcard , nested , and filter function in template . INSTALL npm i obj-filter Or find help from: - https://www.npmjs.com/package/obj-filter - https://github.com/BlueT/obj-filter SYNOPSIS js \"use strict\"; const {filter, merge, exist, ArrayIter} = require('obj-filter'); const template = { \"runtime\": { \"connectionState\": undefined, // excluded \"powerState\": function (args) {return \"HELLO WORLD \" + args}, // pass into the checker function \"bootTime\": \"my boot time\", // included \"paused\": false, \"snapshotInBackground\": 1111111, \"numbers\": ArrayIter(filter, Number), // value of \"numbers\" must be an array, and will check all elements in the array }, \"running\": Boolean }; let clean data = filter( template, fetchData() ); let updated data = filter.merge( clean data, newUpdates() ); let clean full data = filter.exist( template, fetchData() ); Template Object According to the Template Object structure , obj-filter supports the following types of value with different behaviors to build the result object. undefined If the value of the key is undefined , the key will be filtered (skipped) and will not included in result object. object If the value of the key is an object , obj-filter will dive into it and check the deeper level of keys . function If the value of the key is an function , obj-filter will pass the value of the same key in input data to th","default_branch":null,"files":null,"tree":[],"storefront":"/r/bluet","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/bluet/obj-filter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}