%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
const Minipass = require('minipass') class SizeError extends Error { constructor (found, expect) { super(`Bad data size: expected ${expect} bytes, but got ${found}`) this.expect = expect this.found = found this.code = 'EBADSIZE' Error.captureStackTrace(this, this.constructor) } get name () { return 'SizeError' } } class MinipassSized extends Minipass { constructor (options = {}) { super(options) if (options.objectMode) throw new TypeError(`${ this.constructor.name } streams only work with string and buffer data`) this.found = 0 this.expect = options.size if (typeof this.expect !== 'number' || this.expect > Number.MAX_SAFE_INTEGER || isNaN(this.expect) || this.expect < 0 || !isFinite(this.expect) || this.expect !== Math.floor(this.expect)) throw new Error('invalid expected size: ' + this.expect) } write (chunk, encoding, cb) { const buffer = Buffer.isBuffer(chunk) ? chunk : typeof chunk === 'string' ? Buffer.from(chunk, typeof encoding === 'string' ? encoding : 'utf8') : chunk if (!Buffer.isBuffer(buffer)) { this.emit('error', new TypeError(`${ this.constructor.name } streams only work with string and buffer data`)) return false } this.found += buffer.length if (this.found > this.expect) this.emit('error', new SizeError(this.found, this.expect)) return super.write(chunk, encoding, cb) } emit (ev, ...data) { if (ev === 'end') { if (this.found !== this.expect) this.emit('error', new SizeError(this.found, this.expect)) } return super.emit(ev, ...data) } } MinipassSized.SizeError = SizeError module.exports = MinipassSized