0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -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
if (Object.keys(islandProps).length > 0) {
// Display the props if we have any
// 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({
title: 'Props',
content: `<pre><code>${JSON.stringify(
Object.fromEntries(
Object.entries(islandProps).map((prop: any) => [prop[0], prop[1][1]])
),
Object.fromEntries(islandPropsEntries.map((prop: any) => [prop[0], prop[1][1]])),
undefined,
2
)}</code></pre>`,