Recursively omit empty properties from an object. Omits empty objects, arrays, strings, and optionally zero. Similar results to what you would expect with `compact` for arrays.
Hello! When omitEmpty is called with an object that has Symbols as property keys, those keys are missing from the result:
constomitEmpty=require('omit-empty')constassert=require('assert')letgte=Symbol('gte'),lt=Symbol.for('lt')test('should clean some symbols',()=>{letactual=omitEmpty({userId: 1,age: {[gte]: null,[lt]: 20}})letexpected={userId: 1,age: {[lt]: 2}}// fails: the returned object is just { userId: 1 }assert.deepEqual(actual,expected)})
This happens because Object.keys() only sees string keys, in this line: