From 44cc6c25ffaec67571f24df5b0976b007f58a500 Mon Sep 17 00:00:00 2001 From: Michael Stramel Date: Tue, 1 Oct 2024 23:39:39 -0500 Subject: [PATCH] add comment explaining the code for backwards compat --- packages/astro/src/assets/runtime.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/astro/src/assets/runtime.ts b/packages/astro/src/assets/runtime.ts index 50da762ef5d4..c19483f2c277 100644 --- a/packages/astro/src/assets/runtime.ts +++ b/packages/astro/src/assets/runtime.ts @@ -44,10 +44,12 @@ export function createSvgComponent({ meta, attributes, children }: SvgComponentP makeNonEnumerable(Component); if (import.meta.env.DEV) { + // Maintaining the current `console.log` output for SVG imports Object.defineProperty(Component, Symbol.for('nodejs.util.inspect.custom'), { value: (_: any, opts: any, inspect: any) => inspect(meta, opts), }); } + // Attaching the metadata to the component to maintain current functionality return Object.assign(Component, meta); }