* Normalizes and/or adds a suffix to the value. * * If value is `null`/`undefined` no suffix is added * @param value * @param suffix
( value: any, suffix: string | undefined | null, )
| 1025 | * @param suffix |
| 1026 | */ |
| 1027 | function normalizeSuffix( |
| 1028 | value: any, |
| 1029 | suffix: string | undefined | null, |
| 1030 | ): string | null | undefined | boolean { |
| 1031 | if (value == null || value === '') { |
| 1032 | // do nothing |
| 1033 | // Do not add the suffix if the value is going to be empty. |
| 1034 | // As it produce invalid CSS, which the browsers will automatically omit but Domino will not. |
| 1035 | // Example: `"left": "px;"` instead of `"left": ""`. |
| 1036 | } else if (typeof suffix === 'string') { |
| 1037 | value = unwrapSafeValue(value) + suffix; |
| 1038 | } else if (typeof value === 'object') { |
| 1039 | value = stringify(unwrapSafeValue(value)); |
| 1040 | } |
| 1041 | return value; |
| 1042 | } |
| 1043 | |
| 1044 | /** |
| 1045 | * Tests if the `TNode` has input shadow. |
no test coverage detected