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:
parent
466d1f0ab2
commit
30982078e6
1 changed files with 7 additions and 5 deletions
|
@ -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>`,
|
||||||
|
|
Loading…
Reference in a new issue