From 4f965e9e6f2c89b50b88f7f50273264a606542b5 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 4 Aug 2022 22:05:06 +0200 Subject: [PATCH] fix: Don't assume named exports interop (#1154) --- src/screen.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/screen.ts b/src/screen.ts index 0b3cc8c8..9034b159 100644 --- a/src/screen.ts +++ b/src/screen.ts @@ -1,4 +1,6 @@ -import {compressToEncodedURIComponent} from 'lz-string' +// WARNING: `lz-string` only has a default export but statically we assume named exports are allowd +// TODO: Statically verify we don't rely on NodeJS implicit named imports. +import lzString from 'lz-string' import type {OptionsReceived} from 'pretty-format' import {getQueriesForElement} from './get-queries-for-element' import {getDocument} from './helpers' @@ -12,7 +14,7 @@ function unindent(string: string) { } function encode(value: string) { - return compressToEncodedURIComponent(unindent(value)) + return lzString.compressToEncodedURIComponent(unindent(value)) } function getPlaygroundUrl(markup: string) {