From 5ef7cf3824bba4dd2bf9f6181e9bdd07cc407eea Mon Sep 17 00:00:00 2001 From: leowrites Date: Sat, 19 Oct 2024 17:21:03 -0400 Subject: [PATCH] Add type to val and remove unused --- memory-viz/src/plugins/pretty_svg.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/memory-viz/src/plugins/pretty_svg.ts b/memory-viz/src/plugins/pretty_svg.ts index 5fc9e02..2cb5c8a 100644 --- a/memory-viz/src/plugins/pretty_svg.ts +++ b/memory-viz/src/plugins/pretty_svg.ts @@ -1,8 +1,11 @@ -import type { NewPlugin, OldPlugin } from "pretty-format"; +// Custom pretty-format plugin for serializing SVG elements +// See https://github.com/jestjs/jest/tree/main/packages/pretty-format#writing-plugins for more information + +import type { NewPlugin } from "pretty-format"; import pretty from "pretty"; -import { parse } from "node-html-parser"; +import { parse, HTMLElement } from "node-html-parser"; -export const serialize: NewPlugin["serialize"] = (val) => { +export const serialize: NewPlugin["serialize"] = (val: HTMLElement) => { return pretty(val); };