Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(async (material) => {
const { dispose, getSigner } = getEncryptHelper(material)
const { getCipher, messageHeader, rawHeader } = getEncryptionInfo(material, frameLength)
wrappingStream.emit('MessageHeader', messageHeader)
const encryptStream = getFramedEncryptStream(getCipher, messageHeader, dispose, plaintextLength)
const signatureStream = new SignatureStream(getSigner)
pipeline(encryptStream, signatureStream)
wrappingStream.setReadable(signatureStream)
// Flush the rawHeader through the signatureStream
rawHeader.forEach(buff => signatureStream.write(buff))
// @ts-ignore until readable-stream exports v3 types...
wrappingStream.setWritable(encryptStream)
})
.catch(err => wrappingStream.emit('error', err))
session.cipherSuites = supportedCiphers;
}
session.retransmitter.once('close', () => {
this.emit('timeout');
});
const onerror = err => {
if (err) {
this.emit('error', err);
}
};
const isdtls = streamfilter(chunkFilter);
pipeline(writer, socket, onerror);
pipeline(socket, isdtls, decoder, reorder, defrag, protocol, onerror);
this[_session] = session;
this[_queue] = [];
this[_protocol] = protocol;
this[_socket] = socket;
this[_timeout] = null;
session.on('data', packet => {
this[_resetTimer]();
this.push(packet);
});
session.once('handshake:finish', () => {
process.nextTick(() => this.emit('connect'));
function html(directory) {
return pipeline(gulp.src('src/**/*.html'), htmlMinify(htmlMinifyConfig), gulp.dest(`dist/${directory}`));
}
gulp.task('compress', function () {
return pipeline(
gulp.src([
'**/*.js',
'!adguard/adguard-content.js',
'!gulpfile.js',
'!node_modules/**'
]),
babel({
presets: [
'@babel/preset-env'
],
compact: true,
sourceType: 'script',
}),
uglify({
mangle: true,
}),
function popupJs(directory) {
return pipeline(gulp.src('src/popup/popup.js'), babel(), webpack(webpackConfig('popup.js')), gulp.dest(`dist/${directory}/popup/`));
}
function js(){
return pipeline(
gulp.src('website/js/*.js'),
uglify(),
gulp.dest('docs/js')
);
}
function manifest(directory) {
return pipeline(gulp.src(`src/${directory}/manifest.json`), jsonMinify(), gulp.dest(`dist/${directory}/`));
}
}
}
callback();
},
flush(callback) {
if (!endedArray) {
this.push("]");
}
this.push("}");
callback();
}
}));
let first = true;
const resultsStream = stream.pipeline(
docsObjectStream,
new stream.Transform({
writableObjectMode: true,
readableObjectMode: false,
write(chunk, enc, callback) {
const json = JSON.stringify(chunk["value"]);
if (first) {
first = false;
this.push(`{"results":[${json}`);
} else {
this.push(`,${json}`);
}
callback();
},
flush(callback) {
function settingsJs(directory) {
return pipeline(gulp.src('src/settings/settings.ctrl.js'), babel(), webpack(webpackConfig('settings.ctrl.js')),
gulp.dest(`dist/${directory}/settings/`));
}
function locales(directory) {
return pipeline(gulp.src('src/_locales/**/*.json'), jsonMinify(), gulp.dest(`dist/${directory}/_locales`));
}