Files
memecoin-botV2/.pnpm-store/v10/files/25/01ed9e1a1c53ca78de5e8273bae44400de981ef8690b3b0bfb4607550fb96d9996a93eb6108f0cb8799d3412640e94266392ad7fcb036ff59f2193dfb2f4ff

34 lines
784 B
Plaintext

'use strict';
const StreamBase = require('./StreamBase');
const withParser = require('../utils/withParser');
class StreamValues extends StreamBase {
static make(options) {
return new StreamValues(options);
}
static withParser(options) {
return withParser(StreamValues.make, Object.assign({}, options, {jsonStreaming: true}));
}
constructor(options) {
super(options);
this._counter = 0;
this._level = 0;
}
_push(discard) {
if (discard) {
++this._counter;
} else {
this.push({key: this._counter++, value: this._assembler.current});
}
this._assembler.current = this._assembler.key = null;
}
}
StreamValues.streamValues = StreamValues.make;
StreamValues.make.Constructor = StreamValues;
module.exports = StreamValues;