PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/stream-chain/utils

Просмотр файла: comp.js

'use strict';

const {Transform} = require('stream');
const {next} = require('./asFun');
const {sanitize} = require('../index');

const comp = (...fns) => {
  fns = fns.filter(fn => fn);
  return fns.length
    ? new Transform({
        writableObjectMode: true,
        readableObjectMode: true,
        transform(chunk, encoding, callback) {
          next(chunk, fns, 0, value => sanitize(value, this)).then(() => callback(null), error => callback(error));
        }
      })
    : null;
};

module.exports = comp;

Выполнить команду


Для локальной разработки. Не используйте в интернете!