UNPKG

json-sql-enhanced

Version:

Node.js library for mapping MongoDB-style query objects to SQL queries with enhanced operators and multi-dialect support

33 lines (24 loc) 678 B
'use strict'; module.exports = ValuesStore; function ValuesStore(options) { options = options || {}; this._values = options.values || {}; } ValuesStore.prototype.add = function (name, value) { this._values[name] = value; }; ValuesStore.prototype.set = function (name, value) { this._values[name] = value; }; ValuesStore.prototype.get = function (name) { return this._values[name] || null; }; ValuesStore.prototype.remove = function (name) { delete this._values[name]; }; ValuesStore.prototype.has = function (name) { return Object.prototype.hasOwnProperty.call(this._values, name); }; ValuesStore.prototype.getAll = function () { return this._values; };