Add Robot_JoyIt driver
This commit is contained in:
33
node_modules/stream-json/streamers/StreamValues.js
generated
vendored
Normal file
33
node_modules/stream-json/streamers/StreamValues.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
'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;
|
||||
Reference in New Issue
Block a user