streamlined
Version:
Collection of helper streams to deal with mapping/transforming object streams
20 lines (15 loc) • 372 B
JavaScript
var through2 = require('through2'),
selector = require('defunct/selector');
module.exports = missing;
function missing(selectorExpr) {
var s = through2.obj(write);
var locator = selector(selectorExpr);
function write(data, enc, cb) {
var val = locator(data);
if (typeof val === 'undefined') {
this.push(data);
}
cb();
}
return s;
}