Skip to content

Commit 4f965e9

Browse files
authored
fix: Don't assume named exports interop (#1154)
1 parent 73a5694 commit 4f965e9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/screen.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import {compressToEncodedURIComponent} from 'lz-string'
1+
// WARNING: `lz-string` only has a default export but statically we assume named exports are allowd
2+
// TODO: Statically verify we don't rely on NodeJS implicit named imports.
3+
import lzString from 'lz-string'
24
import type {OptionsReceived} from 'pretty-format'
35
import {getQueriesForElement} from './get-queries-for-element'
46
import {getDocument} from './helpers'
@@ -12,7 +14,7 @@ function unindent(string: string) {
1214
}
1315

1416
function encode(value: string) {
15-
return compressToEncodedURIComponent(unindent(value))
17+
return lzString.compressToEncodedURIComponent(unindent(value))
1618
}
1719

1820
function getPlaygroundUrl(markup: string) {

0 commit comments

Comments
 (0)