0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

filter out internal island props (#9304)

This commit is contained in:
Fred K. Schott 2023-12-05 04:14:04 -08:00 committed by GitHub
parent 466d1f0ab2
commit 30982078e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -153,14 +153,16 @@ export default {
}); });
} }
// Add the props if we have any // Display the props if we have any
if (Object.keys(islandProps).length > 0) { // Ignore the "data-astro-cid-XXXXXX" prop (internal)
const islandPropsEntries = Object.entries(islandProps).filter(
(prop: any) => !prop[0].startsWith('data-astro-cid-')
);
if (islandPropsEntries.length > 0) {
tooltip.sections.push({ tooltip.sections.push({
title: 'Props', title: 'Props',
content: `<pre><code>${JSON.stringify( content: `<pre><code>${JSON.stringify(
Object.fromEntries( Object.fromEntries(islandPropsEntries.map((prop: any) => [prop[0], prop[1][1]])),
Object.entries(islandProps).map((prop: any) => [prop[0], prop[1][1]])
),
undefined, undefined,
2 2
)}</code></pre>`, )}</code></pre>`,