mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Use startsWith instead of regex testing
This commit is contained in:
parent
a5d46bb40c
commit
41f6b6ab6b
@ -37,9 +37,8 @@ function resolveDerivedVariable(decl, variables) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function extractAlias(decl) {
|
function extractAlias(decl) {
|
||||||
const RE_VARIABLE_PROP = /--(.+)/;
|
|
||||||
const wholeVariable = decl.value.match(RE_VARIABLE_VALUE)?.[1];
|
const wholeVariable = decl.value.match(RE_VARIABLE_VALUE)?.[1];
|
||||||
if (RE_VARIABLE_PROP.test(decl.prop) && wholeVariable) {
|
if (decl.prop.startsWith("--") && wholeVariable) {
|
||||||
aliasMap.set(decl.prop, wholeVariable);
|
aliasMap.set(decl.prop, wholeVariable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user