forked from mystiq/hydrogen-web
Use array instead of Set
This commit is contained in:
parent
859449ed60
commit
76789eacf1
2 changed files with 5 additions and 5 deletions
|
@ -104,10 +104,10 @@ function populateMapWithDerivedVariables(map, cssFileLocation) {
|
||||||
*/
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const derivedVariables = new Set([
|
const derivedVariables = [
|
||||||
...([...resolvedMap.keys()].filter(v => !aliasMap.has(v))),
|
...([...resolvedMap.keys()].filter(v => !aliasMap.has(v))),
|
||||||
...([...aliasMap.entries()].map(([alias, variable]) => `${alias}=${variable}`))
|
...([...aliasMap.entries()].map(([alias, variable]) => `${alias}=${variable}`))
|
||||||
]);
|
];
|
||||||
map.set(location, { "derived-variables": derivedVariables });
|
map.set(location, { "derived-variables": derivedVariables });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,9 +131,9 @@ module.exports.tests = function tests() {
|
||||||
color: var(--my-alias--lighter-15);
|
color: var(--my-alias--lighter-15);
|
||||||
}`;
|
}`;
|
||||||
await postcss([plugin({ derive, compiledVariables })]).process(inputCSS, { from: "/foo/bar/test.css", });
|
await postcss([plugin({ derive, compiledVariables })]).process(inputCSS, { from: "/foo/bar/test.css", });
|
||||||
const actualSet = compiledVariables.get("/foo/bar")["derived-variables"];
|
const actualArray = compiledVariables.get("/foo/bar")["derived-variables"];
|
||||||
const expectedSet = new Set(["icon-color--darker-20", "my-alias=icon-color--darker-20", "my-alias--lighter-15"]);
|
const expectedArray = ["icon-color--darker-20", "my-alias=icon-color--darker-20", "my-alias--lighter-15"];
|
||||||
assert.deepEqual(actualSet, expectedSet);
|
assert.deepStrictEqual(actualArray.sort(), expectedArray.sort());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue