Your IP : 216.73.216.86


Current Path : /home/emeraadmin/www/4d695/
Upload File :
Current File : /home/emeraadmin/www/4d695/minipass-collect.zip

PK�[�\I��@@package.jsonnu�[���{
  "_id": "minipass-collect@2.0.1",
  "_inBundle": true,
  "_location": "/npm/minipass-collect",
  "_phantomChildren": {},
  "_requiredBy": [
    "/npm/cacache"
  ],
  "author": {
    "name": "Isaac Z. Schlueter",
    "email": "i@izs.me",
    "url": "https://izs.me"
  },
  "bugs": {
    "url": "https://github.com/isaacs/minipass-collect/issues"
  },
  "dependencies": {
    "minipass": "^7.0.3"
  },
  "description": "A Minipass stream that collects all the data into a single chunk",
  "devDependencies": {
    "tap": "^16.3.8"
  },
  "engines": {
    "node": ">=16 || 14 >=14.17"
  },
  "files": [
    "index.js"
  ],
  "homepage": "https://github.com/isaacs/minipass-collect#readme",
  "license": "ISC",
  "name": "minipass-collect",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/isaacs/minipass-collect.git"
  },
  "scripts": {
    "postversion": "npm publish",
    "prepublishOnly": "git push origin --follow-tags",
    "preversion": "npm test",
    "snap": "tap",
    "test": "tap"
  },
  "tap": {
    "check-coverage": true
  },
  "version": "2.0.1"
}
PK�[�\����LICENSEnu�[���The ISC License

Copyright (c) 2019-2023 Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
PK�[�\&����index.jsnu�[���const { Minipass } = require('minipass')
const _data = Symbol('_data')
const _length = Symbol('_length')
class Collect extends Minipass {
  constructor (options) {
    super(options)
    this[_data] = []
    this[_length] = 0
  }
  write (chunk, encoding, cb) {
    if (typeof encoding === 'function')
      cb = encoding, encoding = 'utf8'

    if (!encoding)
      encoding = 'utf8'

    const c = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding)
    this[_data].push(c)
    this[_length] += c.length
    if (cb)
      cb()
    return true
  }
  end (chunk, encoding, cb) {
    if (typeof chunk === 'function')
      cb = chunk, chunk = null
    if (typeof encoding === 'function')
      cb = encoding, encoding = 'utf8'
    if (chunk)
      this.write(chunk, encoding)
    const result = Buffer.concat(this[_data], this[_length])
    super.write(result)
    return super.end(cb)
  }
}
module.exports = Collect

// it would be possible to DRY this a bit by doing something like
// this.collector = new Collect() and listening on its data event,
// but it's not much code, and we may as well save the extra obj
class CollectPassThrough extends Minipass {
  constructor (options) {
    super(options)
    this[_data] = []
    this[_length] = 0
  }
  write (chunk, encoding, cb) {
    if (typeof encoding === 'function')
      cb = encoding, encoding = 'utf8'

    if (!encoding)
      encoding = 'utf8'

    const c = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding)
    this[_data].push(c)
    this[_length] += c.length
    return super.write(chunk, encoding, cb)
  }
  end (chunk, encoding, cb) {
    if (typeof chunk === 'function')
      cb = chunk, chunk = null
    if (typeof encoding === 'function')
      cb = encoding, encoding = 'utf8'
    if (chunk)
      this.write(chunk, encoding)
    const result = Buffer.concat(this[_data], this[_length])
    this.emit('collect', result)
    return super.end(cb)
  }
}
module.exports.PassThrough = CollectPassThrough
PK�[�\I��@@package.jsonnu�[���PK�[�\����|LICENSEnu�[���PK�[�\&�����index.jsnu�[���PK��