"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeInputValue = normalizeInputValue;
/**
 * 标准化输入框的值
 */
function normalizeInputValue(value, componentProps) {
    if (value === null || value === undefined) {
        return value;
    }
    // 转换为字符串
    const strValue = String(value);
    // 如果设置了 maxLength，截断字符串
    const maxLength = componentProps === null || componentProps === void 0 ? void 0 : componentProps.maxLength;
    if (maxLength && maxLength > 0 && strValue.length > maxLength) {
        return strValue.slice(0, maxLength);
    }
    return strValue;
}
