Grabbed dndbeyond's source code
``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
export default function composeClasses(slots, getUtilityClass, classes = undefined) {
|
||||
const 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
|
||||
slot => {
|
||||
output[slot] = slots[slot].reduce((acc, key) => {
|
||||
if (key) {
|
||||
const 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