File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ See [docs](https://aureooms.github.io/js-lempel-ziv/index.html).
77> :warning : The code requires ` regeneratorRuntime ` to be defined, for instance by importing
88> [ regenerator-runtime/runtime] ( https://www.npmjs.com/package/regenerator-runtime ) .
99
10+ ``` js
11+ import {dict , encode , decode } from ' @aureooms/js-lempel-ziv/lz78' ;
12+ [... decode (dict (), encode (dict (), ' abcd' ))].join (' ' ); // abcd
13+ ```
14+
1015[ ![ License] ( https://img.shields.io/github/license/aureooms/js-lempel-ziv.svg )] ( https://raw.githubusercontent.com/aureooms/js-lempel-ziv/master/LICENSE )
1116[ ![ Version] ( https://img.shields.io/npm/v/@aureooms/js-lempel-ziv.svg )] ( https://www.npmjs.org/package/@aureooms/js-lempel-ziv )
1217[ ![ Build] ( https://img.shields.io/travis/aureooms/js-lempel-ziv/master.svg )] ( https://travis-ci.org/aureooms/js-lempel-ziv/branches )
Original file line number Diff line number Diff line change 1+ import test from 'ava' ;
2+
3+ import { dict , encode , decode } from '../../src/lz78' ;
4+ test ( 'README' , ( t ) => {
5+ const input = 'abcd' ;
6+ t . is ( input , [ ...decode ( dict ( ) , encode ( dict ( ) , input ) ) ] . join ( '' ) ) ;
7+ } ) ;
You can’t perform that action at this time.
0 commit comments