[JIT] Support animation lists (#5252)

* Support animation lists

* Update tests
This commit is contained in:
Brad Cornes 2021-08-21 03:39:06 +01:00 • committed by GitHub
parent ca1a167a83
commit b56b4c0b14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 248 additions and 80 deletions

View file

@ -20,9 +20,10 @@ const DIGIT = /^(\d+)$/
export default function parseAnimationValue(input) {
let animations = input.split(COMMA)
let result = animations.map((animation) => {
let result = {}
let parts = animation.trim().split(SPACE)
return animations.map((animation) => {
let value = animation.trim()
let result = { value }
let parts = value.split(SPACE)
let seen = new Set()
for (let part of parts) {
@ -58,6 +59,4 @@ export default function parseAnimationValue(input) {
return result
})
return animations.length > 1 ? result : result[0]
}