mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25:52 +01:00
Use array instead of Set
This commit is contained in:
parent
859449ed60
commit
76789eacf1
@ -104,10 +104,10 @@ function populateMapWithDerivedVariables(map, cssFileLocation) {
|
||||
*/
|
||||
return;
|
||||
}
|
||||
const derivedVariables = new Set([
|
||||
const derivedVariables = [
|
||||
...([...resolvedMap.keys()].filter(v => !aliasMap.has(v))),
|
||||
...([...aliasMap.entries()].map(([alias, variable]) => `${alias}=${variable}`))
|
||||
]);
|
||||
];
|
||||
map.set(location, { "derived-variables": derivedVariables });
|
||||
}
|
||||
|
||||
|
@ -131,9 +131,9 @@ module.exports.tests = function tests() {
|
||||
color: var(--my-alias--lighter-15);
|
||||
}`;
|
||||
await postcss([plugin({ derive, compiledVariables })]).process(inputCSS, { from: "/foo/bar/test.css", });
|
||||
const actualSet = compiledVariables.get("/foo/bar")["derived-variables"];
|
||||
const expectedSet = new Set(["icon-color--darker-20", "my-alias=icon-color--darker-20", "my-alias--lighter-15"]);
|
||||
assert.deepEqual(actualSet, expectedSet);
|
||||
const actualArray = compiledVariables.get("/foo/bar")["derived-variables"];
|
||||
const expectedArray = ["icon-color--darker-20", "my-alias=icon-color--darker-20", "my-alias--lighter-15"];
|
||||
assert.deepStrictEqual(actualArray.sort(), expectedArray.sort());
|
||||
}
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user