* 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, )
| 988 | * @param suffix |
| 989 | */ |
| 990 | function normalizeSuffix( |
| 991 | value: any, |
| 992 | suffix: string | undefined | null, |
| 993 | ): string | null | undefined | boolean { |
| 994 | if (value == null || value === '') { |
| 995 | // do nothing |
| 996 | // Do not add the suffix if the value is going to be empty. |
| 997 | // As it produce invalid CSS, which the browsers will automatically omit but Domino will not. |
| 998 | // Example: `"left": "px;"` instead of `"left": ""`. |
| 999 | } else if (typeof suffix === 'string') { |
| 1000 | value = value + suffix; |
| 1001 | } else if (typeof value === 'object') { |
| 1002 | value = stringify(unwrapSafeValue(value)); |
| 1003 | } |
| 1004 | return value; |
| 1005 | } |
| 1006 | |
| 1007 | /** |
| 1008 | * Tests if the `TNode` has input shadow. |
no test coverage detected
searching dependent graphs…