"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+$/;
var isEmptyString = function (value) {
    return Boolean(exports.EMPTY_STRING_REGEX.exec(value)) || Boolean(value === '');
};
exports.isEmptyString = isEmptyString;
var isNumber = function (value) {
    return !isNaN(parseInt(value));
};
exports.isNumber = isNumber;
var flipObject = function (obj) {
    return Object.keys(obj).reduce(function (newObj, key) {
        newObj[obj[key]] = exports.isNumber(key) ? parseInt(key) : key;
        return newObj;
    }, {});
};
exports.flipObject = flipObject;
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