Hey
I am using this module to whitelist keys that can be exposed by API. IMHO the filter should not omit key-value pairs that have null as value. As the current behavior is in place it cannot be changed. But maybe we could make a third parameter for the filter method where you could switch on/off null values omitting?
My suggestion would be to have a general property for allowing all null values. And possibility to switch separately for every type.
var result = filter(schema, document, {
allowNulls: true
// or
allowNulls: ['boolean', 'number', 'integer', 'object', 'array', 'string', 'other']
})
Would it be considerable? PR?
BR
Hey
I am using this module to whitelist keys that can be exposed by API. IMHO the filter should not omit key-value pairs that have
nullas value. As the current behavior is in place it cannot be changed. But maybe we could make a third parameter for the filter method where you could switch on/off null values omitting?My suggestion would be to have a general property for allowing all null values. And possibility to switch separately for every
type.Would it be considerable? PR?
BR