fix: safeguards against invalid values

This commit is contained in:
Igor Randjelovic
2021-02-26 18:49:50 +01:00
committed by Nathan Walker
parent 9f710411bf
commit 6f875b2eb7
2 changed files with 14 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ const isLength = (v) => v === '0' || LENGTH_RE.test(v);
* @param value
*/
export function parseCSSShadow(value: string): CSSShadow {
const parts = value.split(PARTS_RE);
const parts = value.trim().split(PARTS_RE);
const inset = parts.includes('inset');
const first = parts[0];
const last = parts[parts.length - 1];