"use strict";
/**
 * 比较常用的工具模块
 * @date 2022-03
 * @author 何华东
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.uuid = exports.replaceAll = exports.delay = void 0;
var uuid_1 = require("uuid");
/**
 * 延迟
 */
function delay(ms) {
    return new Promise(function (resolve) {
        setTimeout(resolve, ms);
    });
}
exports.delay = delay;
/**
 * 替换所有字符串
 *
 * 不支持替换\\n
 */
function replaceAll(value, searchValue, replaceValue) {
    if (!value || !searchValue || !replaceValue)
        return value;
    return value.replace(new RegExp(searchValue, 'g'), replaceValue);
}
exports.replaceAll = replaceAll;
/**
 * uuidv4
 */
function uuid() {
    return uuid_1.v4();
}
exports.uuid = uuid;
//# sourceMappingURL=Utils.js.map