type(formItemLabel): remove unnecessary assert (#49797)

* type(formItemLabel): remove unnecessary assert

* Update components/form/FormItemLabel.tsx

Co-authored-by: lijianan <574980606@qq.com>
Signed-off-by: thinkasany <480968828@qq.com>

---------

Signed-off-by: thinkasany <480968828@qq.com>
Co-authored-by: lijianan <574980606@qq.com>
This commit is contained in:
thinkasany 2024-07-10 11:56:27 +08:00 committed by GitHub
parent e666f50878
commit 4c18036774
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,8 +93,8 @@ const FormItemLabel: React.FC<FormItemLabelProps & { required?: boolean; prefixC
const haveColon = computedColon && !vertical;
// Remove duplicated user input colon
if (haveColon && typeof label === 'string' && (label as string).trim() !== '') {
labelChildren = (label as string).replace(/[:|]\s*$/, '');
if (haveColon && typeof label === 'string' && label.trim()) {
labelChildren = label.replace(/[:|]\s*$/, '');
}
// Tooltip