@opendnd/genetica
Version:
This is a tool for using a simplified genetics system to generate inheritable traits for DnD characters.
14 lines • 418 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
// only push unique elements
Array.prototype.pushUnique = function (element) {
if (this.indexOf(element) === -1) {
this.push(element);
}
};
// grab a random element
Array.prototype.sample = function () {
return this[Math.floor(Math.random() * this.length)];
};
exports.default = {};
//# sourceMappingURL=extensions.js.map