pre-installations and preparations
This commit is contained in:
1 parent
3e5a0329cb
commit
201d621ac3
6977 files changed
+742826
No files matched your search
+22
@@ -0,0 +1,22 @@
|
||||
export default function composeClasses(slots, getUtilityClass) {
|
||||
var classes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
||||
var output = {};
|
||||
Object.keys(slots).forEach(
|
||||
// `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
|
||||
// @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
|
||||
function (slot) {
|
||||
output[slot] = slots[slot].reduce(function (acc, key) {
|
||||
if (key) {
|
||||
var utilityClass = getUtilityClass(key);
|
||||
if (utilityClass !== '') {
|
||||
acc.push(utilityClass);
|
||||
}
|
||||
if (classes && classes[key]) {
|
||||
acc.push(classes[key]);
|
||||
}
|
||||
}
|
||||
return acc;
|
||||
}, []).join(' ');
|
||||
});
|
||||
return output;
|
||||
}
|
||||
Reference in new issue
Block a user