Function
encodeUnderlineStyle
(style: TextStyle["underlineStyle"] | undefined)
Source from the content-addressed store, hash-verified
| 107 | }); |
| 108 | |
| 109 | function encodeUnderlineStyle(style: TextStyle["underlineStyle"] | undefined): number { |
| 110 | switch (style) { |
| 111 | case "straight": |
| 112 | return 1; |
| 113 | case "double": |
| 114 | return 2; |
| 115 | case "curly": |
| 116 | return 3; |
| 117 | case "dotted": |
| 118 | return 4; |
| 119 | case "dashed": |
| 120 | return 5; |
| 121 | default: |
| 122 | return 0; |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | function asPackedRgb24(value: unknown): number { |
| 127 | if (typeof value !== "number" || !Number.isFinite(value)) return 0; |
Tested by
no test coverage detected