2018-09-07 23:04:47 +00:00
|
|
|
import * as plugins from './nodehash.plugins';
|
2016-08-16 01:37:40 +00:00
|
|
|
|
2018-09-07 23:04:47 +00:00
|
|
|
export let hashStreamPipeStop = resolveFuntion => {
|
|
|
|
let forEach = (chunk: Buffer, enc, cb) => {
|
|
|
|
resolveFuntion(chunk.toString('utf8'));
|
|
|
|
cb(null, chunk);
|
|
|
|
};
|
2016-08-16 01:37:40 +00:00
|
|
|
|
2018-09-07 23:04:47 +00:00
|
|
|
let atEnd = cb => {
|
|
|
|
cb();
|
|
|
|
};
|
2016-08-16 01:37:40 +00:00
|
|
|
|
2018-09-07 23:04:47 +00:00
|
|
|
return plugins.through2(forEach, atEnd);
|
|
|
|
};
|