UNPKG

dynamicsnode

Version:

Create simple scripts to interact with Dynamics CRM using Node.js

35 lines 1.04 kB
"use strict"; var KeyValuePair = (function () { function KeyValuePair() { } return KeyValuePair; }()); exports.KeyValuePair = KeyValuePair; var Dictionary = (function () { function Dictionary() { this._items = new Array(); } Dictionary.prototype.push = function (key, value) { var ndx = this.indexOf(key); if (ndx > -1) this._items[ndx].value = value; else this._items.push({ key: key, value: value }); }; Dictionary.prototype.indexOf = function (key) { for (var i = 0; i < this._items.length; i++) { if (this._items[i].key === key) return i; } return -1; }; Dictionary.prototype.exist = function (key) { return this.indexOf(key) > -1; }; Dictionary.prototype.getValue = function (index) { return this._items[index].value; }; return Dictionary; }()); exports.Dictionary = Dictionary; //# sourceMappingURL=Dictionary.js.map