mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Remove stray "--" from code
This commit is contained in:
parent
19a6d669a9
commit
5d4323cd1d
@ -21,7 +21,7 @@ let resolvedMap;
|
|||||||
let baseVariables;
|
let baseVariables;
|
||||||
|
|
||||||
function getValueFromAlias(alias) {
|
function getValueFromAlias(alias) {
|
||||||
const derivedVariable = aliasMap.get(`--${alias}`);
|
const derivedVariable = aliasMap.get(alias);
|
||||||
return baseVariables.get(derivedVariable) ?? resolvedMap.get(derivedVariable);
|
return baseVariables.get(derivedVariable) ?? resolvedMap.get(derivedVariable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,13 +39,13 @@ function parseDeclarationValue(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resolveDerivedVariable(decl, derive) {
|
function resolveDerivedVariable(decl, derive) {
|
||||||
const RE_VARIABLE_VALUE = /--(.+)--(.+)-(.+)/;
|
const RE_VARIABLE_VALUE = /(--.+)--(.+)-(.+)/;
|
||||||
const variableCollection = parseDeclarationValue(decl.value);
|
const variableCollection = parseDeclarationValue(decl.value);
|
||||||
for (const variable of variableCollection) {
|
for (const variable of variableCollection) {
|
||||||
const matches = variable.match(RE_VARIABLE_VALUE);
|
const matches = variable.match(RE_VARIABLE_VALUE);
|
||||||
if (matches) {
|
if (matches) {
|
||||||
const [wholeVariable, baseVariable, operation, argument] = matches;
|
const [wholeVariable, baseVariable, operation, argument] = matches;
|
||||||
const value = baseVariables.get(`--${baseVariable}`) ?? getValueFromAlias(baseVariable);
|
const value = baseVariables.get(baseVariable) ?? getValueFromAlias(baseVariable);
|
||||||
if (!value) {
|
if (!value) {
|
||||||
throw new Error(`Cannot derive from ${baseVariable} because it is neither defined in config nor is it an alias!`);
|
throw new Error(`Cannot derive from ${baseVariable} because it is neither defined in config nor is it an alias!`);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user