UNPKG

llparse

Version:

[![Build Status](https://secure.travis-ci.org/indutny/llparse.svg)](http://travis-ci.org/indutny/llparse) [![NPM version](https://badge.fury.io/js/llparse.svg)](https://badge.fury.io/js/llparse)

31 lines (24 loc) 484 B
'use strict'; 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;