Sha256: 70b49785f5d49aef3a2be52c3b0f25c0cc94b721b7b5fb225da90e88889b3e1f

Contents?: true

Size: 1.3 KB

Versions: 49

Compression:

Stored size: 1.3 KB

Contents

"use strict";
var MapPolyfill = (function () {
    function MapPolyfill() {
        this.size = 0;
        this._values = [];
        this._keys = [];
    }
    MapPolyfill.prototype.get = function (key) {
        var i = this._keys.indexOf(key);
        return i === -1 ? undefined : this._values[i];
    };
    MapPolyfill.prototype.set = function (key, value) {
        var i = this._keys.indexOf(key);
        if (i === -1) {
            this._keys.push(key);
            this._values.push(value);
            this.size++;
        }
        else {
            this._values[i] = value;
        }
        return this;
    };
    MapPolyfill.prototype.delete = function (key) {
        var i = this._keys.indexOf(key);
        if (i === -1) {
            return false;
        }
        this._values.splice(i, 1);
        this._keys.splice(i, 1);
        this.size--;
        return true;
    };
    MapPolyfill.prototype.clear = function () {
        this._keys.length = 0;
        this._values.length = 0;
        this.size = 0;
    };
    MapPolyfill.prototype.forEach = function (cb, thisArg) {
        for (var i = 0; i < this.size; i++) {
            cb.call(thisArg, this._values[i], this._keys[i]);
        }
    };
    return MapPolyfill;
}());
exports.MapPolyfill = MapPolyfill;
//# sourceMappingURL=MapPolyfill.js.map

Version data entries

49 entries across 49 versions & 4 rubygems

Version Path
govuk_publishing_components-17.8.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-17.7.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-17.6.1 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-17.6.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-17.5.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-17.4.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-17.3.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-17.2.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-17.1.1 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-17.1.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-17.0.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-16.29.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-16.28.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-16.27.1 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-16.27.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-16.26.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-16.25.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-16.24.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-16.23.0 node_modules/rxjs/util/MapPolyfill.js
govuk_publishing_components-16.22.0 node_modules/rxjs/util/MapPolyfill.js