we can do sanitize_slots like this now (more correct anyway since it should be booleans)

snippet-work-cont
Simon Holthausen 1 year ago
parent 3494f4cc6b
commit 46dcfca36f

@ -322,8 +322,11 @@ export function unmount(component) {
* @returns {Record<string, any>}
*/
export function sanitize_slots(props) {
const sanitized = { ...props.$$slots };
if (props.children) sanitized.default = props.children;
/** @type {Record<string, boolean>} */
const sanitized = {};
for (const key in props.$$slots) {
sanitized[key] = true;
}
return sanitized;
}

@ -555,8 +555,11 @@ export function sanitize_props(props) {
* @returns {Record<string, any>}
*/
export function sanitize_slots(props) {
const sanitized = { ...props.$$slots };
if (props.children) sanitized.default = props.children;
/** @type {Record<string, boolean>} */
const sanitized = {};
for (const key in props.$$slots) {
sanitized[key] = true;
}
return sanitized;
}

Loading…
Cancel
Save