UNPKG

tsmaz

Version:

TypeScript port of the smaz string compression library

22 lines 574 B
import defaultDictionary from './dictionary'; import Smaz from './factory'; let SMAZ = null; export function decompress(array) { if (SMAZ === null) { SMAZ = new Smaz(defaultDictionary); } return SMAZ.decompress(array); } export function compress(str) { if (SMAZ === null) { SMAZ = new Smaz(defaultDictionary); } return SMAZ.compress(str); } export function getCompressedSize(str) { if (SMAZ === null) { SMAZ = new Smaz(defaultDictionary); } return SMAZ.getCompressedSize(str); } //# sourceMappingURL=default.js.map