Download lib/compare-html-diff.ts from JARVIS-JI/CLONEU: direct link, hf CLI and curl.
- Browser
- Download file 318 Bytes
-
https://huggingface.co/spaces/JARVIS-JI/CLONEU/resolve/main/lib/compare-html-diff.ts
- Command line
-
hf download hf://spaces/JARVIS-JI/CLONEU/lib/compare-html-diff.ts
-
curl -L -o compare-html-diff.ts https://huggingface.co/spaces/JARVIS-JI/CLONEU/resolve/main/lib/compare-html-diff.ts
318 Bytes
| import { defaultHTML } from "./consts"; | |
| export const isTheSameHtml = (currentHtml: string): boolean => { | |
| const normalize = (html: string): string => | |
| html | |
| .replace(/<!--[\s\S]*?-->/g, "") | |
| .replace(/\s+/g, " ") | |
| .trim(); | |
| return normalize(defaultHTML) === normalize(currentHtml); | |
| }; | |