2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-26 00:28:28 +00:00

Validate value types for alignment and flip in React component

This commit is contained in:
Vjacheslav Trushkin 2020-12-30 16:47:10 +02:00
parent 8903221391
commit 37a60f9ef9

View File

@ -127,12 +127,16 @@ const component = (
// Flip as string: 'horizontal,vertical'
case 'flip':
flipFromString(customisations, value);
if (typeof value === 'string') {
flipFromString(customisations, value);
}
break;
// Alignment as string
case 'align':
alignmentFromString(customisations, value);
if (typeof value === 'string') {
alignmentFromString(customisations, value);
}
break;
// Color: copy to style
@ -142,9 +146,9 @@ const component = (
// Rotation as string
case 'rotate':
if (typeof value !== 'number') {
if (typeof value === 'string') {
customisations[key] = rotateFromString(value);
} else {
} else if (typeof value === 'number') {
componentProps[key] = value;
}
break;