Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
proc.stderr.resume() // drain it!
proc.unref()
proc.stderr.unref()
proc.stdout.unref()
proc.stdin.unref()
var serializer = ldjson.serialize()
var parser = ldjson.parse()
if (process.env.DEBUG) {
serializer.pipe(debugStream('transform input: '))
dup.pipe(debugStream('transform output: '))
}
return splicer.obj([serializer, dup, parser])
}
module.exports = function(transforms) {
transforms = transforms
.map(normalize)
.map(function(t, i) {
debug('Registering transform #' + i, t)
// TODO: support more formats
if (typeof t === 'function') return t()
if (typeof t.pipe === 'function') return t
if (t.format !== 'json') throw new Error('Transform #'+i+' not a non supported format')
if (t.command) return command(t)
if (t.module) return mod(t)
throw new Error('Transform #'+i+' is not currently support')
})
return splicer.obj(transforms)
}