diff --git a/packages/astro/components/Debug.astro b/packages/astro/components/Debug.astro
index b09f870a7..c25ce0f0e 100644
--- a/packages/astro/components/Debug.astro
+++ b/packages/astro/components/Debug.astro
@@ -1,144 +1,6 @@
---
const key = Object.keys(Astro.props)[0];
const value = Astro.props[key];
-
-const getType = (node: unknown) => {
- if (Array.isArray(node)) return 'array';
- if (node === null) return 'null';
- if (typeof node === 'object') {
- if ((node as any).then) return 'promise';
- }
- return typeof node;
-};
-
-const getSummary = (node: any, key: string, className: string) => {
- const type = getType(node);
- let value;
- let open;
- let close;
-
- if (type === 'function') {
- return <>
- {(key || !key && key === 0) && <>{key}:>}
- {node.name}()
- >
- }
-
- if (type === 'promise') {
- return <>
- {(key || !key && key === 0) && <>{key}:>}
- Promise
- >
- }
-
- if (type === 'array') {
- value = node.length;
- open = <>Array{'['}>;
- close = ']';
- } else if (type === 'object') {
- const keys = Object.keys(node);
- if (keys.length === 0) {
- value = 'Empty';
- } else if (keys.length > 3) {
- value = '…';
- } else {
- value = keys.slice(0, 3).join(',');
- }
- open = '{';
- close = '}';
- };
-
- return <>
- {key && <>{key}: >}
- {open && {open}}
-
- {value}
- {close && {close}}
-
- >;
-};
-
-const Details = ({ node, key, children, class: className }) => {
- const type = getType(node);
- const props = {};
-
- if (type === 'array' || type === 'object') {
- props['data-char'] = type === 'array' ? ']' : '}'
- props.open = !key && type === 'object' ? '' : undefined;
- }
-
- return (
-
- {children}
-
{JSON.stringify(value, null, 2)}- diff --git a/packages/astro/components/index.js b/packages/astro/components/index.js index 625448249..de48280ec 100644 --- a/packages/astro/components/index.js +++ b/packages/astro/components/index.js @@ -1,4 +1,4 @@ //export { default as Code } from './Code.astro'; -//export { default as Debug } from './Debug.astro'; +export { default as Debug } from './Debug.astro'; export { default as Markdown } from './Markdown.astro'; -export { default as Prism } from './Prism.astro'; \ No newline at end of file +export { default as Prism } from './Prism.astro';