UNPKG

@polyfill-io-aot/builder

Version:

This is the builder module for polyfill-io-aot.

64 lines 1.72 kB
"use strict"; var _a, _b; Object.defineProperty(exports, "__esModule", { value: true }); //tslint:disable:max-classes-per-file /** @internal */ exports.BROTLI_COMPLETE = Symbol('Brotli Complete'); const BROTLI_TOTAL = Symbol('Brotli Total'); /** @internal */ exports.ZOPFLI_COMPLETE = Symbol('Zopfli Complete'); /** @internal */ class StatImpl { constructor(numHashes) { this[_a] = 0; this[_b] = 0; this[BROTLI_TOTAL] = numHashes; } get brotliComplete() { return this[exports.BROTLI_COMPLETE]; } get brotliTotal() { return this[BROTLI_TOTAL]; } get complete() { return this.brotliComplete + this.zopfliComplete; } get done() { return this.complete === this.total; } get total() { return this.brotliTotal + this.zopfliTotal; } get zopfliComplete() { return this[exports.ZOPFLI_COMPLETE]; } get zopfliTotal() { return this.brotliTotal; } toJSON() { const props = [ 'brotliComplete', 'brotliTotal', 'complete', 'done', 'total', 'zopfliComplete', 'zopfliTotal' ]; const out = {}; for (const p of props) { out[p] = this[p]; } return out; } toString() { return [ `br: [${this.brotliComplete}/${this.brotliTotal}]`, `gz: [${this.zopfliComplete}/${this.zopfliTotal}]`, `total: [${this.complete}/${this.total}]` ].join(' | '); } } _a = exports.BROTLI_COMPLETE, _b = exports.ZOPFLI_COMPLETE; exports.StatImpl = StatImpl; //# sourceMappingURL=CompressExecutorStatImpl.js.map