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:
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
|
||||
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>`,
|
||||
|
|
Loading…
Reference in a new issue