export var isOneOf = function (target, array) {
    if (Array.isArray(array)) {
        return array.includes(target);
    }
    return array === target;
};
export var camelCaseToDash = function (str) {
    var regex = /[A-Z]/g;
    return str.replace(regex, function (word) {
        return '-' + word.toLowerCase();
    });
};
export var convertHexToRGBA = function (color, opacity) {
    if (opacity === void 0) { opacity = 1; }
    if (/^#[0-9A-F]{6}$/i.test(color)) {
        var hex = color.replace('#', '');
        var r = parseInt(hex.substring(0, 2), 16);
        var g = parseInt(hex.substring(2, 4), 16);
        var b = parseInt(hex.substring(4, 6), 16);
        return "rgba(" + r + "," + g + "," + b + "," + opacity + ")";
    }
    return color;
};
export var getPrefixCls = function (suffixCls, contextPrefix, customisedCls) {
    if (customisedCls) {
        return customisedCls;
    }
    return contextPrefix ? contextPrefix + "-" + suffixCls : "ty-" + suffixCls;
};
//# sourceMappingURL=general.js.map