/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v26.0.0
test/common/arraystream.js
23 строки
578 B
Rich Trott
test: put common lint exceptions into config file
14 июл 2021, 03:49
14 июл 2021, 03:49
c506660
Код
Авторство
О чём код?
'use strict'; const { Stream } = require('stream'); function noop() {} // A stream to push an array into a REPL function ArrayStream() { this.run = function(data) { data.forEach((line) => { this.emit('data', `${line}\n`); }); }; } Object.setPrototypeOf(ArrayStream.prototype, Stream.prototype); Object.setPrototypeOf(ArrayStream, Stream); ArrayStream.prototype.readable = true; ArrayStream.prototype.writable = true; ArrayStream.prototype.pause = noop; ArrayStream.prototype.resume = noop; ArrayStream.prototype.write = noop; module.exports = ArrayStream;