@asamuzakjp/css-color
Advanced tools
Comparing version 3.0.9 to 3.0.10
@@ -45,3 +45,3 @@ import { createCacheKey, getCache, CacheItem, setCache } from "./cache.js"; | ||
const AT_POSITION = `at\\s+(?:${POS_1}|${POS_2}|${POS_4})`; | ||
const TO_SIDE_CORNER = `to\\s+(?:${L_R}(?:\\s${T_B})?|${T_B}(?:\\s${L_R})?)`; | ||
const TO_SIDE_CORNER = `to\\s+(?:(?:${L_R})(?:\\s(?:${T_B}))?|(?:${T_B})(?:\\s(?:${L_R}))?)`; | ||
const IN_COLOR_SPACE = `in\\s+(?:${CS_RECT}|${CS_HUE})`; | ||
@@ -72,8 +72,8 @@ const REG_GRAD = /^(?:repeating-)?(?:conic|linear|radial)-gradient\(/; | ||
lineSyntax = [ | ||
`(?:${RAD_SHAPE})(?:\\s+(?:${RAD_SIZE}))?(\\s+${AT_POSITION})?(?:${IN_COLOR_SPACE})?`, | ||
`(?:${RAD_SIZE})(?:\\s+(?:${RAD_SHAPE}))?(\\s+${AT_POSITION})?(?:${IN_COLOR_SPACE})?`, | ||
`${AT_POSITION}(?:${IN_COLOR_SPACE})?`, | ||
`${IN_COLOR_SPACE}(?:\\s+${RAD_SHAPE})(?:\\s+(?:${RAD_SIZE}))?(\\s+${AT_POSITION})?`, | ||
`${IN_COLOR_SPACE}(?:\\s+${RAD_SIZE})(?:\\s+(?:${RAD_SHAPE}))?(\\s+${AT_POSITION})?`, | ||
`${IN_COLOR_SPACE}(\\s+${AT_POSITION})?` | ||
`(?:${RAD_SHAPE})(?:\\s+(?:${RAD_SIZE}))?(?:\\s+${AT_POSITION})?(?:\\s+${IN_COLOR_SPACE})?`, | ||
`(?:${RAD_SIZE})(?:\\s+(?:${RAD_SHAPE}))?(?:\\s+${AT_POSITION})?(?:\\s+${IN_COLOR_SPACE})?`, | ||
`${AT_POSITION}(?:\\s+${IN_COLOR_SPACE})?`, | ||
`${IN_COLOR_SPACE}(?:\\s+${RAD_SHAPE})(?:\\s+(?:${RAD_SIZE}))?(?:\\s+${AT_POSITION})?`, | ||
`${IN_COLOR_SPACE}(?:\\s+${RAD_SIZE})(?:\\s+(?:${RAD_SHAPE}))?(?:\\s+${AT_POSITION})?`, | ||
`${IN_COLOR_SPACE}(?:\\s+${AT_POSITION})?` | ||
].join("|"); | ||
@@ -88,3 +88,3 @@ } else if (/^(?:repeating-)?conic-gradient$/.test(type)) { | ||
if (lineSyntax) { | ||
const reg = new RegExp(`^${lineSyntax}$`); | ||
const reg = new RegExp(`^(?:${lineSyntax})$`); | ||
return reg.test(value); | ||
@@ -91,0 +91,0 @@ } |
@@ -73,3 +73,3 @@ { | ||
}, | ||
"version": "3.0.9" | ||
"version": "3.0.10" | ||
} |
@@ -60,3 +60,3 @@ /** | ||
const AT_POSITION = `at\\s+(?:${POS_1}|${POS_2}|${POS_4})`; | ||
const TO_SIDE_CORNER = `to\\s+(?:${L_R}(?:\\s${T_B})?|${T_B}(?:\\s${L_R})?)`; | ||
const TO_SIDE_CORNER = `to\\s+(?:(?:${L_R})(?:\\s(?:${T_B}))?|(?:${T_B})(?:\\s(?:${L_R}))?)`; | ||
const IN_COLOR_SPACE = `in\\s+(?:${CS_RECT}|${CS_HUE})`; | ||
@@ -133,8 +133,8 @@ | ||
lineSyntax = [ | ||
`(?:${RAD_SHAPE})(?:\\s+(?:${RAD_SIZE}))?(\\s+${AT_POSITION})?(?:${IN_COLOR_SPACE})?`, | ||
`(?:${RAD_SIZE})(?:\\s+(?:${RAD_SHAPE}))?(\\s+${AT_POSITION})?(?:${IN_COLOR_SPACE})?`, | ||
`${AT_POSITION}(?:${IN_COLOR_SPACE})?`, | ||
`${IN_COLOR_SPACE}(?:\\s+${RAD_SHAPE})(?:\\s+(?:${RAD_SIZE}))?(\\s+${AT_POSITION})?`, | ||
`${IN_COLOR_SPACE}(?:\\s+${RAD_SIZE})(?:\\s+(?:${RAD_SHAPE}))?(\\s+${AT_POSITION})?`, | ||
`${IN_COLOR_SPACE}(\\s+${AT_POSITION})?` | ||
`(?:${RAD_SHAPE})(?:\\s+(?:${RAD_SIZE}))?(?:\\s+${AT_POSITION})?(?:\\s+${IN_COLOR_SPACE})?`, | ||
`(?:${RAD_SIZE})(?:\\s+(?:${RAD_SHAPE}))?(?:\\s+${AT_POSITION})?(?:\\s+${IN_COLOR_SPACE})?`, | ||
`${AT_POSITION}(?:\\s+${IN_COLOR_SPACE})?`, | ||
`${IN_COLOR_SPACE}(?:\\s+${RAD_SHAPE})(?:\\s+(?:${RAD_SIZE}))?(?:\\s+${AT_POSITION})?`, | ||
`${IN_COLOR_SPACE}(?:\\s+${RAD_SIZE})(?:\\s+(?:${RAD_SHAPE}))?(?:\\s+${AT_POSITION})?`, | ||
`${IN_COLOR_SPACE}(?:\\s+${AT_POSITION})?` | ||
].join('|'); | ||
@@ -155,3 +155,3 @@ } else if (/^(?:repeating-)?conic-gradient$/.test(type)) { | ||
if (lineSyntax) { | ||
const reg = new RegExp(`^${lineSyntax}$`); | ||
const reg = new RegExp(`^(?:${lineSyntax})$`); | ||
return reg.test(value); | ||
@@ -158,0 +158,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2136477