Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function wireSegment() {
// setup integrity checks (later signatures)
var wire = msgproto.WireProtocol(Message)
var intg = integrity.Protocol()
connect(wire.buffers, intg.payloads)
var enc = scope(wire.messages, intg.frames, '/payload')
var dec = scope(intg.frames, wire.messages, '/payload')
var o = {objectMode: true, highWaterMark: 16}
return segment({
// scoped because we need to convert only the payload
messages: duplexer2(o, enc, dec),
buffers: duplexer2(o, dec, enc),
wire: wire,
// messages: scope(wire.messages, intg.frames, '/payload'),
// buffers: scope(intg.frames, wire.messages, '/payload'),
})
}
function wireSegment() {
// setup integrity checks (later signatures)
var wire = msgproto.WireProtocol(Message)
var intg = integrity.Protocol()
connect(wire.buffers, intg.payloads)
var enc = scope(wire.messages, intg.frames, '/payload')
var dec = scope(intg.frames, wire.messages, '/payload')
var o = {objectMode: true, highWaterMark: 16}
return segment({
// scoped because we need to convert only the payload
messages: duplexer2(o, enc, dec),
buffers: duplexer2(o, dec, enc),
wire: wire,
// messages: scope(wire.messages, intg.frames, '/payload'),
// buffers: scope(intg.frames, wire.messages, '/payload'),
})
}
function separator(match) {
return _.merge(
defaultSeparator(match),
{
indent: chunk.indent,
}
);
}
const tokenizerOptions = { leaveBehind: `${WHITESPACE_GROUP}`, source, token, separator };
const linkRegExp = _.get(options, 'linkRegExp') || defaultTokenRegExp;
const tokenizer = regexpTokenizer(tokenizerOptions, linkRegExp);
trimmer.pipe(tokenizer).pipe(resolver).pipe(inflater);
return duplexer({ objectMode: true }, trimmer, inflater);
}