UNPKG
shrink-string-typescript
Version:
latest (3.0.12)
3.0.12
Tiny string compression module for Node.
github.com/MrlolDev/shrink-string
MrlolDev/shrink-string
shrink-string-typescript
/
index.test.js
11 lines
(9 loc)
•
295 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
const
test = require(
'tape-async'
)
const
{ compress, decompress } = require(
'./lib'
) test(
'shrink'
,
async
(t) => {
const
s =
'asdfλ'
.repeat(
16
)
const
shrunk =
await
compress(s)
const
expanded =
await
decompress(shrunk) t.equal(s, expanded) t.
true
(shrunk.length < expanded.length) })