llparse
Version:
[](http://travis-ci.org/indutny/llparse) [](https://badge.fury.io/js/llparse)
31 lines (24 loc) • 484 B
JavaScript
;
const llparse = require('../');
const Case = require('./').Case;
class Select extends Case {
constructor(next) {
super('select', next);
this.map = new Map();
}
add(key, value) {
this.map.set(key, value);
}
linearize() {
const res = [];
this.map.forEach((value, key) => {
res.push({
key: llparse.utils.toBuffer(key),
next: this.next,
value
});
});
return res;
}
}
module.exports = Select;