"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shuffle = exports.flipObject = exports.isNumber = exports.isEmptyString = exports.EMPTY_STRING_REGEX = void 0;
exports.EMPTY_STRING_REGEX = /^\s+$/;
exports.isEmptyString = function (value) {
    return Boolean(value.match(exports.EMPTY_STRING_REGEX)) || Boolean(value === '');
};
exports.isNumber = function (value) {
    return !isNaN(parseInt(value));
};
exports.flipObject = function (obj) {
    return Object.keys(obj).reduce(function (newObj, key) {
        newObj[obj[key]] = exports.isNumber(key) ? parseInt(key) : key;
        return newObj;
    }, {});
};
function shuffle(a) {
    var j, x, i;
    for (i = a.length - 1; i > 0; i--) {
        j = Math.floor(Math.random() * (i + 1));
        x = a[i];
        a[i] = a[j];
        a[j] = x;
    }
    return a;
}
exports.shuffle = shuffle;
//# sourceMappingURL=object-tools.js.map