UNPKG

markov-typescript

Version:

A Markov Chain library written in Typescript.

38 lines 1.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Collections = require("typescript-collections"); var ChainState = (function () { function ChainState(items) { if (!items) { throw new ReferenceError("Items cannot be null."); } var arr = new Array(); items.forEach(function (i) { arr.push(i); return true; }); this.items = arr; } ChainState.prototype.equals = function (other) { if (!other) { return false; } if (this.items.length !== other.items.length) { return false; } for (var x = 0; x < this.items.length; x++) { var left = this.items[x], right = other.items[x]; if (left === right) { continue; } if (Collections.util.makeString(left) !== Collections.util.makeString(right)) { return false; } } return true; }; ChainState.prototype.toString = function () { return Collections.util.makeString(this.items); }; return ChainState; }()); exports.ChainState = ChainState; ; //# sourceMappingURL=chain-state.js.map