forked from cscott/compressjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
71 lines (66 loc) · 2.24 KB
/
main.js
File metadata and controls
71 lines (66 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
'use strict';
if (typeof console.asert !== "function") {
console.assert = function() {};
}
const BWT = require('./lib/BWT');
const BWTC = require('./lib/BWTC');
const BitStream = require('./lib/BitStream');
const Bzip2 = require('./lib/Bzip2');
const CRC32 = require('./lib/CRC32');
const Context1Model = require('./lib/Context1Model');
const DefSumModel = require('./lib/DefSumModel');
const DeflateDistanceModel = require('./lib/DeflateDistanceModel');
const Dmc = require('./lib/Dmc');
const DummyRangeCoder = require('./lib/DummyRangeCoder');
const FenwickModel = require('./lib/FenwickModel');
const Huffman = require('./lib/Huffman');
const HuffmanAllocator = require('./lib/HuffmanAllocator');
const LogDistanceModel = require('./lib/LogDistanceModel');
const Lzjb = require('./lib/Lzjb');
const LzjbR = require('./lib/LzjbR');
const Lzp3 = require('./lib/Lzp3');
const MTFModel = require('./lib/MTFModel');
const NoModel = require('./lib/NoModel');
const PPM = require('./lib/PPM');
const RangeCoder = require('./lib/RangeCoder');
const Simple = require('./lib/Simple');
const Stream = require('./lib/Stream');
const Util = require('./lib/Util');
const freeze = require('./lib/freeze');
exports.selectAlgorithm = function(algorithm) {
switch (algorithm.toLowerCase()) {
case 'bwtc': return BWTC;
case 'bzip2': return Bzip2;
case 'dmc': return Dmc;
case 'lzjb': return Lzjb;
case 'lzjbr': return LzjbR;
case 'lzp3': return Lzp3;
case 'ppm': return PPM;
default: return null;
}
}
exports.BWT = BWT;
exports.BWTC = BWTC;
exports.BitStream = BitStream;
exports.Bzip2 = Bzip2;
exports.CRC32 = CRC32;
exports.Context1Model = Context1Model;
exports.DefSumModel = DefSumModel;
exports.DeflateDistanceModel = DeflateDistanceModel;
exports.Dmc = Dmc;
exports.DummyRangeCoder = DummyRangeCoder;
exports.FenwickModel = FenwickModel;
exports.Huffman = Huffman;
exports.HuffmanAllocator = HuffmanAllocator;
exports.LogDistanceModel = LogDistanceModel;
exports.Lzjb = Lzjb;
exports.LzjbR = LzjbR;
exports.Lzp3 = Lzp3;
exports.MTFModel = MTFModel;
exports.NoModel = NoModel;
exports.PPM = PPM;
exports.RangeCoder = RangeCoder;
exports.Simple = Simple;
exports.Stream = Stream;
exports.Util = Util;
exports.freeze = freeze;