Closed Panthro closed 5 years ago
You can use filters as a workaround:
var Xray = require('x-ray');
var x = Xray({
filters: {
nullify: function(value) { return value.length ? value : null; }
}
});
x('https://google.com', {
empty: 'empty | nullify'
});
Having the same issue myself and tried a filter with no joy. Tried yours out of interest. No such luck. Have you tried this yourself with any luck?
Dupe of #202. Merging.
Subject of the issue
Add an option to return null when empty for schema strict applications
Expected behaviour
When an element return empty, add the element as a null
Eg: