(fontWeight: FontWeightType)
| 209 | } |
| 210 | |
| 211 | function getFontWeightSuffix(fontWeight: FontWeightType): string { |
| 212 | if (typeof fontWeight === 'number') { |
| 213 | fontWeight = (fontWeight + '') as any; |
| 214 | } |
| 215 | switch (fontWeight) { |
| 216 | case FontWeight.THIN: |
| 217 | return SDK_VERSION >= 16 ? '-thin' : ''; |
| 218 | case FontWeight.EXTRA_LIGHT: |
| 219 | case FontWeight.LIGHT: |
| 220 | return SDK_VERSION >= 16 ? '-light' : ''; |
| 221 | case FontWeight.NORMAL: |
| 222 | case '400': |
| 223 | case undefined: |
| 224 | case null: |
| 225 | return ''; |
| 226 | case FontWeight.MEDIUM: |
| 227 | case FontWeight.SEMI_BOLD: |
| 228 | return SDK_VERSION >= 21 ? '-medium' : ''; |
| 229 | case FontWeight.BOLD: |
| 230 | case '700': |
| 231 | case FontWeight.EXTRA_BOLD: |
| 232 | return ''; |
| 233 | case FontWeight.BLACK: |
| 234 | return SDK_VERSION >= 21 ? '-black' : ''; |
| 235 | default: |
| 236 | throw new Error(`Invalid font weight: "${fontWeight}"`); |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | function getNumericFontWeight(fontWeight: FontWeightType): number { |
| 241 | let value: number; |
no outgoing calls
no test coverage detected