(value: string)
| 232 | } |
| 233 | |
| 234 | export function parseBackgroundShorthand(value: string) { |
| 235 | const result: { |
| 236 | image?: string |
| 237 | size?: string |
| 238 | repeat?: string |
| 239 | position?: string |
| 240 | } = {} |
| 241 | |
| 242 | const urlMatch = value.match(BG_URL_RE) |
| 243 | if (urlMatch) result.image = urlMatch[0] |
| 244 | |
| 245 | const sizeMatch = value.match(BG_SIZE_RE) |
| 246 | if (sizeMatch) result.size = sizeMatch[1] |
| 247 | |
| 248 | const repeatMatch = value.match(BG_REPEAT_RE) |
| 249 | if (repeatMatch) { |
| 250 | const [, repeatToken] = repeatMatch |
| 251 | result.repeat = repeatToken.trim() |
| 252 | } |
| 253 | |
| 254 | const posMatch = value.match(BG_POS_RE) |
| 255 | if (posMatch) result.position = posMatch[0].trim() |
| 256 | |
| 257 | return result |
| 258 | } |
| 259 | |
| 260 | function parseBoxValues(value: string): [string, string, string, string] { |
| 261 | const parts = value.trim().split(WHITESPACE_RE) |
no outgoing calls
no test coverage detected