@nex-ui/react
Version:
🎉 A beautiful, modern, and reliable React component library.
17 lines (15 loc) • 400 B
JavaScript
function toSlots(object, ...slotNames) {
const result = {};
for(const key in object){
// @ts-ignore
result[key] = {};
if (Object.prototype.hasOwnProperty.call(object, key)) {
slotNames.forEach((slot)=>{
// @ts-ignore
result[key][slot] = object[key];
});
}
}
return result;
}
export { toSlots };