Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add browserify deamdify support #2

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open

Conversation

tyt03538
Copy link

@tyt03538 tyt03538 commented Nov 8, 2018

Since this package is written using AMD, which is not well supported by browserify, deamdify has to be used such that this package can be built and executed on browsers. The pull request add additional key to the package.json to signal browserfiy to deamdify the package by default.

Wrap modules in AMD wrappers for browser-safety; move the files around
a bit to conform to standard node/volo package organization.  Add 'lzmajs'
binary (not yet working) and make test suite mocha-compatible.  Add README.
…on code.

Stumbled across http://code.google.com/p/js-lzma/ and realized it was
identical to the source code for the decompressor I got from upstream.
…les.

The test cases are borrowed from the bzip2 source code.
Add tests to verify that our new implementation works properly!
Also added Base class and turned some numbers into symbolic constants.
Froze 'package' objects so that (eg) RangeCoder.Encoder can be recognized
as a constant.
Reverted some 'improvements' to make this code match the Java upstream
more closely as well.  Correctness is more important than improvements
at this point.  (Once the code is working and we have test cases, we
might think about 'improving' the code further.)
This helps prevent odd node-only bugs, since the Uint8Array is zero-filled
by spec.
cscott and others added 19 commits April 9, 2013 16:39
Typo: s/typeof('Uint32Array')/typeof(Uint32Array)/
This release consists only of dependency updates.
Actual stable versions
"commander" 2.2.0
"mocha" 1.18.2

The tests are all fine

  lzma file decode
    ✓ should correctly decode sample0 
    ✓ should correctly decode sample1 (117ms)
    ✓ should correctly decode sample2 (217ms)
    ✓ should correctly decode sample3 
    ✓ should correctly decode sample4 (937ms)

  lzma file encode->decode
    ✓ encoded sample0 should correctly decode (648ms)
    ✓ encoded sample1 should correctly decode (2195ms)
    ✓ encoded sample2 should correctly decode (3769ms)
    ✓ encoded sample3 should correctly decode (883ms)
    ✓ encoded sample4 should correctly decode (14460ms)

  lzma streaming decode
    ✓ should correctly decode sample0 
    ✓ should correctly decode sample1 (329ms)
    ✓ should correctly decode sample2 (679ms)
    ✓ should correctly decode sample3 (271ms)
    ✓ should correctly decode sample4 (3200ms)

  range coder
    ✓ encodeDirectBits->decodeDirectBits should be the identity 
    ✓ encode->decodeBit (single context) 
    ✓ encode->decodeBit (1-bit context) 
    ✓ encode->decodeBit (2-bit context) 
    ✓ encode->decodeBit (3-bit context) 
    ✓ encode->decodeBit (4-bit context) 
    ✓ encode->decodeBit (5-bit context) 
    ✓ encode->decodeBit (6-bit context) 
    ✓ encode->decodeBit (7-bit context) 
    ✓ encode->decodeBit (8-bit context) 
    ✓ encode->decodeBit (9-bit context) 
    ✓ encode->decodeBit (10-bit context) 
    ✓ encode->decodeBit (11-bit context) 
    ✓ encode->decodeBit (12-bit context) 
    ✓ encode->decodeBit (13-bit context) 
    ✓ encode->decodeBit (14-bit context) 
    ✓ encode->decodeBit (15-bit context) 
    ✓ encode->decodeBit (16-bit context) 
    ✓ encode->decodeBit (bit-position-based context) 

  range encoder
    ✓ should pass a simple test 

  small sequence
    ✓ should pass bit tree 
    ✓ should pass bin tree (216ms)

  large sequence
    ✓ should pass bit tree (71ms)
    ✓ should pass bin tree (195ms)

  encode
    ✓ should pass its tests 


  40 passing (28s)
Update package.json to latest stable dependencies
The example code did not work, etc. Check out the diffs.
README.md was out of date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants