qs
qs copied to clipboard
How to flag skip empty sring
skipNull is usefull flag https://github.com/ljharb/qs/pull/106 but i need to take it to the next level - i need to ignore empty strings, could you add this feature?
I solved this by deepMap function for now https://stackoverflow.com/a/25334280/839434
function deepMap (obj, iterator, context) {
return _.transform(obj, function (result, val, key) {
result[key] = _.isObject(val) && !_.isDate(val)
? deepMap(val, iterator, context)
: iterator.call(context, val, key, obj)
})
}
let cleanObject = deepMap(object, function (val) {
return val || null
})
I believe #226 might give you what you need?
any news for this issue?