diff options
author | Rebecca Turner <me@re-becca.org> | 2018-04-12 23:46:12 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2018-04-12 23:46:13 +0300 |
commit | 0573d91e57c068635a3ad4187b9792afd7b5e22f (patch) | |
tree | 6ed4095080a0197f3bbdcd41fa7b56049bd1fbb6 /node_modules | |
parent | 3c0bbcb8e5440a3b90fabcce85d7a1d31e2ecbe7 (diff) |
cacache@11.0.1
PR-URL: https://github.com/zkat/cacache/pull/128
Credit: @zkat
Diffstat (limited to 'node_modules')
119 files changed, 1816 insertions, 6103 deletions
diff --git a/node_modules/cacache/CHANGELOG.md b/node_modules/cacache/CHANGELOG.md index 5c3e7911d..f332a94e1 100644 --- a/node_modules/cacache/CHANGELOG.md +++ b/node_modules/cacache/CHANGELOG.md @@ -2,6 +2,31 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="11.0.1"></a> +## [11.0.1](https://github.com/zkat/cacache/compare/v11.0.0...v11.0.1) (2018-04-10) + + + +<a name="11.0.0"></a> +# [11.0.0](https://github.com/zkat/cacache/compare/v10.0.4...v11.0.0) (2018-04-09) + + +### Features + +* **opts:** use figgy-pudding for opts ([#128](https://github.com/zkat/cacache/issues/128)) ([33d4eed](https://github.com/zkat/cacache/commit/33d4eed)) + + +### meta + +* drop support for node@4 ([529f347](https://github.com/zkat/cacache/commit/529f347)) + + +### BREAKING CHANGES + +* node@4 is no longer supported + + + <a name="10.0.4"></a> ## [10.0.4](https://github.com/zkat/cacache/compare/v10.0.3...v10.0.4) (2018-02-16) diff --git a/node_modules/cacache/get.js b/node_modules/cacache/get.js index 2bb3afa52..7bafe128e 100644 --- a/node_modules/cacache/get.js +++ b/node_modules/cacache/get.js @@ -2,6 +2,7 @@ const BB = require('bluebird') +const figgyPudding = require('figgy-pudding') const fs = require('fs') const index = require('./lib/entry-index') const memo = require('./lib/memoization') @@ -10,6 +11,12 @@ const pipeline = require('mississippi').pipeline const read = require('./lib/content/read') const through = require('mississippi').through +const GetOpts = figgyPudding({ + integrity: {}, + memoize: {}, + size: {} +}) + module.exports = function get (cache, key, opts) { return getData(false, cache, key, opts) } @@ -17,11 +24,11 @@ module.exports.byDigest = function getByDigest (cache, digest, opts) { return getData(true, cache, digest, opts) } function getData (byDigest, cache, key, opts) { - opts = opts || {} + opts = GetOpts(opts) const memoized = ( byDigest - ? memo.get.byDigest(cache, key, opts) - : memo.get(cache, key, opts) + ? memo.get.byDigest(cache, key, opts) + : memo.get(cache, key, opts) ) if (memoized && opts.memoize !== false) { return BB.resolve(byDigest ? memoized : { @@ -58,7 +65,7 @@ function getData (byDigest, cache, key, opts) { module.exports.stream = getStream function getStream (cache, key, opts) { - opts = opts || {} + opts = GetOpts(opts) let stream = through() const memoized = memo.get(cache, key, opts) if (memoized && opts.memoize !== false) { @@ -91,7 +98,6 @@ function getStream (cache, key, opts) { } else { memoStream = through() } - opts.size = opts.size == null ? entry.size : opts.size stream.emit('metadata', entry.metadata) stream.emit('integrity', entry.integrity) stream.emit('size', entry.size) @@ -101,7 +107,9 @@ function getStream (cache, key, opts) { ev === 'size' && cb(entry.size) }) pipe( - read.readStream(cache, entry.integrity, opts), + read.readStream(cache, entry.integrity, opts.concat({ + size: opts.size == null ? entry.size : opts.size + })), memoStream, stream ) @@ -111,7 +119,7 @@ function getStream (cache, key, opts) { module.exports.stream.byDigest = getStreamDigest function getStreamDigest (cache, integrity, opts) { - opts = opts || {} + opts = GetOpts(opts) const memoized = memo.get.byDigest(cache, integrity, opts) if (memoized && opts.memoize !== false) { const stream = through() @@ -143,7 +151,7 @@ function getStreamDigest (cache, integrity, opts) { module.exports.info = info function info (cache, key, opts) { - opts = opts || {} + opts = GetOpts(opts) const memoized = memo.get(cache, key, opts) if (memoized && opts.memoize !== false) { return BB.resolve(memoized.entry) @@ -161,7 +169,7 @@ module.exports.copy.byDigest = function cpDigest (cache, digest, dest, opts) { return copy(true, cache, digest, dest, opts) } function copy (byDigest, cache, key, dest, opts) { - opts = opts || {} + opts = GetOpts(opts) if (read.copy) { return ( byDigest ? BB.resolve(null) : index.find(cache, key, opts) @@ -180,11 +188,11 @@ function copy (byDigest, cache, key, dest, opts) { } else { return getData(byDigest, cache, key, opts).then(res => { return fs.writeFileAsync(dest, byDigest ? res : res.data) - .then(() => byDigest ? key : { - metadata: res.metadata, - size: res.size, - integrity: res.integrity - }) + .then(() => byDigest ? key : { + metadata: res.metadata, + size: res.size, + integrity: res.integrity + }) }) } } diff --git a/node_modules/cacache/lib/content/read.js b/node_modules/cacache/lib/content/read.js index 7a4da3beb..5c1a6f2f2 100644 --- a/node_modules/cacache/lib/content/read.js +++ b/node_modules/cacache/lib/content/read.js @@ -3,6 +3,7 @@ const BB = require('bluebird') const contentPath = require('./path') +const figgyPudding = require('figgy-pudding') const fs = require('graceful-fs') const PassThrough = require('stream').PassThrough const pipe = BB.promisify(require('mississippi').pipe) @@ -11,9 +12,13 @@ const Y = require('../util/y.js') BB.promisifyAll(fs) +const ReadOpts = figgyPudding({ + size: {} +}) + module.exports = read function read (cache, integrity, opts) { - opts = opts || {} + opts = ReadOpts(opts) return pickContentSri(cache, integrity).then(content => { const sri = content.sri const cpath = contentPath(cache, sri) @@ -32,7 +37,7 @@ function read (cache, integrity, opts) { module.exports.stream = readStream module.exports.readStream = readStream function readStream (cache, integrity, opts) { - opts = opts || {} + opts = ReadOpts(opts) const stream = new PassThrough() pickContentSri( cache, integrity @@ -56,7 +61,7 @@ if (fs.copyFile) { module.exports.copy = copy } function copy (cache, integrity, dest, opts) { - opts = opts || {} + opts = ReadOpts(opts) return pickContentSri(cache, integrity).then(content => { const sri = content.sri const cpath = contentPath(cache, sri) @@ -68,17 +73,17 @@ module.exports.hasContent = hasContent function hasContent (cache, integrity) { if (!integrity) { return BB.resolve(false) } return pickContentSri(cache, integrity) - .catch({code: 'ENOENT'}, () => false) - .catch({code: 'EPERM'}, err => { - if (process.platform !== 'win32') { - throw err - } else { - return false - } - }).then(content => { - if (!content.sri) return false - return ({ sri: content.sri, size: content.stat.size }) - }) + .catch({code: 'ENOENT'}, () => false) + .catch({code: 'EPERM'}, err => { + if (process.platform !== 'win32') { + throw err + } else { + return false + } + }).then(content => { + if (!content.sri) return false + return ({ sri: content.sri, size: content.stat.size }) + }) } module.exports._pickContentSri = pickContentSri @@ -95,16 +100,16 @@ function pickContentSri (cache, integrity) { return BB.any(sri[sri.pickAlgorithm()].map(meta => { return pickContentSri(cache, meta) })) - .catch(err => { - if ([].some.call(err, e => e.code === 'ENOENT')) { - throw Object.assign( - new Error('No matching content found for ' + sri.toString()), - {code: 'ENOENT'} - ) - } else { - throw err[0] - } - }) + .catch(err => { + if ([].some.call(err, e => e.code === 'ENOENT')) { + throw Object.assign( + new Error('No matching content found for ' + sri.toString()), + {code: 'ENOENT'} + ) + } else { + throw err[0] + } + }) } } diff --git a/node_modules/cacache/lib/content/write.js b/node_modules/cacache/lib/content/write.js index a79ae9290..c71363413 100644 --- a/node_modules/cacache/lib/content/write.js +++ b/node_modules/cacache/lib/content/write.js @@ -28,7 +28,9 @@ function write (cache, data, opts) { if (typeof opts.size === 'number' && data.length !== opts.size) { return BB.reject(sizeError(opts.size, data.length)) } - const sri = ssri.fromData(data, opts) + const sri = ssri.fromData(data, { + algorithms: opts.algorithms + }) if (opts.integrity && !ssri.checkData(data, opts.integrity, opts)) { return BB.reject(checksumError(opts.integrity, sri)) } diff --git a/node_modules/cacache/lib/entry-index.js b/node_modules/cacache/lib/entry-index.js index fe1cd0645..43fa7b95b 100644 --- a/node_modules/cacache/lib/entry-index.js +++ b/node_modules/cacache/lib/entry-index.js @@ -4,6 +4,7 @@ const BB = require('bluebird') const contentPath = require('./content/path') const crypto = require('crypto') +const figgyPudding = require('figgy-pudding') const fixOwner = require('./util/fix-owner') const fs = require('graceful-fs') const hashToSegments = require('./util/hash-to-segments') @@ -29,9 +30,16 @@ module.exports.NotFoundError = class NotFoundError extends Error { } } +const IndexOpts = figgyPudding({ + metadata: {}, + size: {}, + uid: {}, + gid: {} +}) + module.exports.insert = insert function insert (cache, key, integrity, opts) { - opts = opts || {} + opts = IndexOpts(opts) const bucket = bucketPath(cache, key) const entry = { key, @@ -197,9 +205,9 @@ function hashEntry (str) { function hash (str, digest) { return crypto - .createHash(digest) - .update(str) - .digest('hex') + .createHash(digest) + .update(str) + .digest('hex') } function formatEntry (cache, entry) { @@ -217,8 +225,8 @@ function formatEntry (cache, entry) { function readdirOrEmpty (dir) { return readdirAsync(dir) - .catch({code: 'ENOENT'}, () => []) - .catch({code: 'ENOTDIR'}, () => []) + .catch({code: 'ENOENT'}, () => []) + .catch({code: 'ENOTDIR'}, () => []) } function nop () { diff --git a/node_modules/cacache/lib/util/tmp.js b/node_modules/cacache/lib/util/tmp.js index 4fc4512cc..65fc4b297 100644 --- a/node_modules/cacache/lib/util/tmp.js +++ b/node_modules/cacache/lib/util/tmp.js @@ -2,14 +2,21 @@ const BB = require('bluebird') +const figgyPudding = require('figgy-pudding') const fixOwner = require('./fix-owner') const path = require('path') const rimraf = BB.promisify(require('rimraf')) const uniqueFilename = require('unique-filename') +const TmpOpts = figgyPudding({ + tmpPrefix: {}, + uid: {}, + gid: {} +}) + module.exports.mkdir = mktmpdir function mktmpdir (cache, opts) { - opts = opts || {} + opts = TmpOpts(opts) const tmpTarget = uniqueFilename(path.join(cache, 'tmp'), opts.tmpPrefix) return fixOwner.mkdirfix(tmpTarget, opts.uid, opts.gid).then(() => { return tmpTarget @@ -22,11 +29,12 @@ function withTmp (cache, opts, cb) { cb = opts opts = null } - opts = opts || {} + opts = TmpOpts(opts) return BB.using(mktmpdir(cache, opts).disposer(rimraf), cb) } module.exports.fix = fixtmpdir function fixtmpdir (cache, opts) { + opts = TmpOpts(opts) return fixOwner(path.join(cache, 'tmp'), opts.uid, opts.gid) } diff --git a/node_modules/cacache/lib/verify.js b/node_modules/cacache/lib/verify.js index 6a01004c9..80d59bdc5 100644 --- a/node_modules/cacache/lib/verify.js +++ b/node_modules/cacache/lib/verify.js @@ -3,6 +3,7 @@ const BB = require('bluebird') const contentPath = require('./content/path') +const figgyPudding = require('figgy-pudding') const finished = BB.promisify(require('mississippi').finished) const fixOwner = require('./util/fix-owner') const fs = require('graceful-fs') @@ -14,10 +15,22 @@ const ssri = require('ssri') BB.promisifyAll(fs) +const VerifyOpts = figgyPudding({ + concurrency: { + default: 20 + }, + filter: {}, + log: { + default: { silly () {} } + }, + uid: {}, + gid: {} +}) + module.exports = verify function verify (cache, opts) { - opts = opts || {} - opts.log && opts.log.silly('verify', 'verifying cache at', cache) + opts = VerifyOpts(opts) + opts.log.silly('verify', 'verifying cache at', cache) return BB.reduce([ markStartTime, fixPerms, @@ -40,7 +53,7 @@ function verify (cache, opts) { }) }, {}).tap(stats => { stats.runTime.total = stats.endTime - stats.startTime - opts.log && opts.log.silly('verify', 'verification finished for', cache, 'in', `${stats.runTime.total}ms`) + opts.log.silly('verify', 'verification finished for', cache, 'in', `${stats.runTime.total}ms`) }) } @@ -53,7 +66,7 @@ function markEndTime (cache, opts) { } function fixPerms (cache, opts) { - opts.log && opts.log.silly('verify', 'fixing cache permissions') + opts.log.silly('verify', 'fixing cache permissions') return fixOwner.mkdirfix(cache, opts.uid, opts.gid).then(() => { // TODO - fix file permissions too return fixOwner.chownr(cache, opts.uid, opts.gid) @@ -70,11 +83,11 @@ function fixPerms (cache, opts) { // 5. If content is not marked as live, rimraf it. // function garbageCollect (cache, opts) { - opts.log && opts.log.silly('verify', 'garbage collecting content') + opts.log.silly('verify', 'garbage collecting content') const indexStream = index.lsStream(cache) const liveContent = new Set() indexStream.on('data', entry => { - if (opts && opts.filter && !opts.filter(entry)) { return } + if (opts.filter && !opts.filter(entry)) { return } liveContent.add(entry.integrity.toString()) }) return finished(indexStream).then(() => { @@ -117,7 +130,7 @@ function garbageCollect (cache, opts) { }) }) } - }, {concurrency: opts.concurrency || 20})) + }, {concurrency: opts.concurrency})) }) }) } @@ -141,7 +154,7 @@ function verifyContent (filepath, sri) { } function rebuildIndex (cache, opts) { - opts.log && opts.log.silly('verify', 'rebuilding index') + opts.log.silly('verify', 'rebuilding index') return index.ls(cache).then(entries => { const stats = { missingContent: 0, @@ -153,7 +166,7 @@ function rebuildIndex (cache, opts) { if (entries.hasOwnProperty(k)) { const hashed = index._hashKey(k) const entry = entries[k] - const excluded = opts && opts.filter && !opts.filter(entry) + const excluded = opts.filter && !opts.filter(entry) excluded && stats.rejectedEntries++ if (buckets[hashed] && !excluded) { buckets[hashed].push(entry) @@ -170,7 +183,7 @@ function rebuildIndex (cache, opts) { } return BB.map(Object.keys(buckets), key => { return rebuildBucket(cache, buckets[key], stats, opts) - }, {concurrency: opts.concurrency || 20}).then(() => stats) + }, {concurrency: opts.concurrency}).then(() => stats) }) } @@ -195,13 +208,13 @@ function rebuildBucket (cache, bucket, stats, opts) { } function cleanTmp (cache, opts) { - opts.log && opts.log.silly('verify', 'cleaning tmp directory') + opts.log.silly('verify', 'cleaning tmp directory') return rimraf(path.join(cache, 'tmp')) } function writeVerifile (cache, opts) { const verifile = path.join(cache, '_lastverified') - opts.log && opts.log.silly('verify', 'writing verifile to ' + verifile) + opts.log.silly('verify', 'writing verifile to ' + verifile) return fs.writeFileAsync(verifile, '' + (+(new Date()))) } diff --git a/node_modules/cacache/node_modules/figgy-pudding/CHANGELOG.md b/node_modules/cacache/node_modules/figgy-pudding/CHANGELOG.md new file mode 100644 index 000000000..02cf10f49 --- /dev/null +++ b/node_modules/cacache/node_modules/figgy-pudding/CHANGELOG.md @@ -0,0 +1,66 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +<a name="3.1.0"></a> +# [3.1.0](https://github.com/zkat/figgy-pudding/compare/v3.0.0...v3.1.0) (2018-04-08) + + +### Features + +* **opts:** allow direct option fetching without .get() ([ca77aad](https://github.com/zkat/figgy-pudding/commit/ca77aad)) + + + +<a name="3.0.0"></a> +# [3.0.0](https://github.com/zkat/figgy-pudding/compare/v2.0.1...v3.0.0) (2018-04-06) + + +### Bug Fixes + +* **ci:** oops -- forgot to update CI config ([7a40563](https://github.com/zkat/figgy-pudding/commit/7a40563)) +* **get:** make provider lookup order like Object.assign ([33ff89b](https://github.com/zkat/figgy-pudding/commit/33ff89b)) + + +### Features + +* **concat:** add .concat() method to opts ([d310fce](https://github.com/zkat/figgy-pudding/commit/d310fce)) + + +### meta + +* drop support for node@4 and node@7 ([9f8a61c](https://github.com/zkat/figgy-pudding/commit/9f8a61c)) + + +### BREAKING CHANGES + +* node@4 and node@7 are no longer supported +* **get:** shadow order for properties in providers is reversed + + + +<a name="2.0.1"></a> +## [2.0.1](https://github.com/zkat/figgy-pudding/compare/v2.0.0...v2.0.1) (2018-03-16) + + +### Bug Fixes + +* **opts:** ignore non-object providers ([7b9c0f8](https://github.com/zkat/figgy-pudding/commit/7b9c0f8)) + + + +<a name="2.0.0"></a> +# [2.0.0](https://github.com/zkat/figgy-pudding/compare/v1.0.0...v2.0.0) (2018-03-16) + + +### Features + +* **api:** overhauled API with new opt handling concept ([e6cc929](https://github.com/zkat/figgy-pudding/commit/e6cc929)) +* **license:** relicense to ISC ([87479aa](https://github.com/zkat/figgy-pudding/commit/87479aa)) + + +### BREAKING CHANGES + +* **license:** the license has been changed from CC0-1.0 to ISC. +* **api:** this is a completely different approach than previously +used by this library. See the readme for the new API and an explanation. diff --git a/node_modules/cacache/node_modules/figgy-pudding/LICENSE.md b/node_modules/cacache/node_modules/figgy-pudding/LICENSE.md new file mode 100644 index 000000000..8d28acf86 --- /dev/null +++ b/node_modules/cacache/node_modules/figgy-pudding/LICENSE.md @@ -0,0 +1,16 @@ +ISC License + +Copyright (c) npm, Inc. + +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 COPYRIGHT HOLDER DISCLAIMS +ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +COPYRIGHT HOLDER 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. diff --git a/node_modules/cacache/node_modules/figgy-pudding/README.md b/node_modules/cacache/node_modules/figgy-pudding/README.md new file mode 100644 index 000000000..8fbc9e15a --- /dev/null +++ b/node_modules/cacache/node_modules/figgy-pudding/README.md @@ -0,0 +1,149 @@ +# figgy-pudding [![npm version](https://img.shields.io/npm/v/figgy-pudding.svg)](https://npm.im/figgy-pudding) [![license](https://img.shields.io/npm/l/figgy-pudding.svg)](https://npm.im/figgy-pudding) [![Travis](https://img.shields.io/travis/zkat/figgy-pudding.svg)](https://travis-ci.org/zkat/figgy-pudding) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/figgy-pudding?svg=true)](https://ci.appveyor.com/project/zkat/figgy-pudding) [![Coverage Status](https://coveralls.io/repos/github/zkat/figgy-pudding/badge.svg?branch=latest)](https://coveralls.io/github/zkat/figgy-pudding?branch=latest) + +# Death to the God Object! Now Bring Us Some Figgy Pudding! + +[`figgy-pudding`](https://github.com/zkat/figgy-pudding) is a simple JavaScript library for managing and composing cascading options objects -- hiding what needs to be hidden from each layer, without having to do a lot of manual munging and passing of options. + +## Install + +`$ npm install figgy-pudding` + +## Table of Contents + +* [Example](#example) +* [Features](#features) +* [API](#api) + * [`figgyPudding(spec)`](#figgy-pudding) + * [`Opts(values)`](#opts) + * [`opts.get()`](#opts-get) + * [`opts.concat()`](#opts-concat) + +### Example + +```javascript +const puddin = require('figgyPudding') + +const RequestOpts = puddin({ + follow: { + default: true + }, + streaming: { + default: false + }, + log: { + default: require('npmlog') + } +}) + +const MyAppOpts = puddin({ + log: { + default: require('npmlog') + }, + cache: { + default: './cache' + } +}) + +function start (opts) { + opts = MyAppOpts(opts) + initCache(opts.get('cache')) + opts.get('streaming') // => undefined + reqStuff('https://npm.im/figgy-pudding', opts) +} + +function reqStuff (uri, opts) { + opts = RequestOpts(opts) + require('request').get(uri, opts) // can't see `cache` +} +``` + +### Features + +* Hide options from layer that didn't ask for it +* Shared multi-layer options + +### API + +#### <a name="figgy-pudding"></a> `> figgyPudding({ key: { default: val } | String }, [opts])` + +Defines an Options constructor that can be used to collect only the needed +options. + +An optional `default` property for specs can be used to specify default values +if nothing was passed in. + +If the value for a spec is a string, it will be treated as an alias to that +other key. + +##### Example + +```javascript +const MyAppOpts = figgyPudding({ + lg: 'log', + log: { + default: () => require('npmlog') + }, + cache: {} +}) +``` + +#### <a name="opts"></a> `> Opts(...providers)` + +Instantiates an options object defined by `figgyPudding()`, which uses +`providers`, in order, to find requested properties. + +Each provider can be either a plain object, a `Map`-like object (that is, one +with a `.get()` method) or another figgyPudding `Opts` object. + +When nesting `Opts` objects, their properties will not become available to the +new object, but any further nested `Opts` that reference that property _will_ be +able to read from their grandparent, as long as they define that key. Default +values for nested `Opts` parents will be used, if found. + +##### Example + +```javascript +const ReqOpts = figgyPudding({ + follow: {} +}) + +const opts = ReqOpts({ + follow: true, + log: require('npmlog') +}) + +opts.get('follow') // => true +opts.get('log') // => Error: ReqOpts does not define `log` + +const MoreOpts = figgyPudding({ + log: {} +}) +MoreOpts(opts).get('log') // => npmlog object (passed in from original plain obj) +MoreOpts(opts).get('follow') // => Error: MoreOpts does not define `follow` +``` + +#### <a name="opts-get"></a> `> opts.get(key)` + +Gets a value from the options object. + +##### Example + +```js +const opts = MyOpts(config) +opts.get('foo') // value of `foo` +``` + +#### <a name="opts-concat"></a> `> opts.concat(...moreProviders)` + +Creates a new opts object of the same type as `opts` with additional providers. +Providers further to the right shadow providers to the left, with properties in +the original `opts` being shadows by the new providers. + +##### Example + +```js +const opts = MyOpts({x: 1}) +opts.get('x') // 1 +opts.concat({x: 2}).get('x') // 2 +opts.get('x') // 1 (original opts object left intact) +``` diff --git a/node_modules/cacache/node_modules/figgy-pudding/index.js b/node_modules/cacache/node_modules/figgy-pudding/index.js new file mode 100644 index 000000000..a3c9c94eb --- /dev/null +++ b/node_modules/cacache/node_modules/figgy-pudding/index.js @@ -0,0 +1,101 @@ +'use strict' + +class FiggyPudding { + constructor (specs, opts, providers) { + this.__specs = specs || {} + this.__opts = opts || (() => false) + this.__providers = reverse((providers || []).filter( + x => x != null && typeof x === 'object' + )) + this.__isFiggyPudding = true + } + get (key) { + return pudGet(this, key, true) + } + concat (...moreConfig) { + return new FiggyPudding( + this.__specs, + this.__opts, + reverse(this.__providers).concat(moreConfig) + ) + } +} + +function pudGet (pud, key, validate) { + let spec = pud.__specs[key] + if (typeof spec === 'string') { + key = spec + spec = pud.__specs[key] + } + if (validate && !spec && (!pud.__opts.other || !pud.__opts.other(key))) { + throw new Error(`invalid config key requested: ${key}`) + } else { + if (!spec) { spec = {} } + let ret + for (let p of pud.__providers) { + if (p.__isFiggyPudding) { + ret = pudGet(p, key, false) + } else if (typeof p.get === 'function') { + ret = p.get(key) + } else { + ret = p[key] + } + if (ret !== undefined) { + break + } + } + if (ret === undefined && spec.default !== undefined) { + if (typeof spec.default === 'function') { + return spec.default() + } else { + return spec.default + } + } else { + return ret + } + } +} + +const proxyHandler = { + has (obj, prop) { + return pudGet(obj, prop, false) !== undefined + }, + get (obj, prop) { + if ( + prop === 'concat' || + prop === 'get' || + prop.slice(0, 2) === '__' + ) { + return obj[prop] + } + return obj.get(prop) + }, + set (obj, prop, value) { + if (prop.slice(0, 2) === '__') { + obj[prop] = value + } else { + throw new Error('figgyPudding options cannot be modified. Use .concat() instead.') + } + }, + delete () { + throw new Error('figgyPudding options cannot be deleted. Use .concat() and shadow them instead.') + } +} + +module.exports = figgyPudding +function figgyPudding (specs, opts) { + function factory (...providers) { + return new Proxy(new FiggyPudding( + specs, + opts, + providers + ), proxyHandler) + } + return factory +} + +function reverse (arr) { + const ret = [] + arr.forEach(x => ret.unshift(x)) + return ret +} diff --git a/node_modules/cacache/node_modules/figgy-pudding/package.json b/node_modules/cacache/node_modules/figgy-pudding/package.json new file mode 100644 index 000000000..b4c4f4d24 --- /dev/null +++ b/node_modules/cacache/node_modules/figgy-pudding/package.json @@ -0,0 +1,70 @@ +{ + "_from": "figgy-pudding@^3.1.0", + "_id": "figgy-pudding@3.1.0", + "_inBundle": false, + "_integrity": "sha512-Gi2vIue0ec6P/7LNpueGhLuvfF2ztuterl8YFBQn1yKgIS46noGxCbi+vviPdObNYtgUSh5FpHy5q0Cw9XhxKQ==", + "_location": "/cacache/figgy-pudding", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "figgy-pudding@^3.1.0", + "name": "figgy-pudding", + "escapedName": "figgy-pudding", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/cacache" + ], + "_resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.1.0.tgz", + "_shasum": "a77ed2284175976c424b390b298569e9df86dd1e", + "_spec": "figgy-pudding@^3.1.0", + "_where": "/Users/rebecca/code/npm/node_modules/cacache", + "author": { + "name": "Kat Marchán", + "email": "kzm@sykosomatic.org" + }, + "bugs": { + "url": "https://github.com/zkat/figgy-pudding/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Delicious, festive, cascading config/opts definitions", + "devDependencies": { + "standard": "^11.0.1", + "standard-version": "^4.3.0", + "tap": "^11.1.2", + "weallbehave": "^1.2.0", + "weallcontribute": "^1.0.8" + }, + "files": [ + "*.js", + "lib" + ], + "homepage": "https://github.com/zkat/figgy-pudding#readme", + "keywords": [ + "config", + "options", + "yummy" + ], + "license": "ISC", + "main": "index.js", + "name": "figgy-pudding", + "repository": { + "type": "git", + "url": "git+https://github.com/zkat/figgy-pudding.git" + }, + "scripts": { + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --coverage test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + }, + "version": "3.1.0" +} diff --git a/node_modules/cacache/node_modules/mississippi/changelog.md b/node_modules/cacache/node_modules/mississippi/changelog.md deleted file mode 100644 index 93430828f..000000000 --- a/node_modules/cacache/node_modules/mississippi/changelog.md +++ /dev/null @@ -1,7 +0,0 @@ -# mississippi Change Log -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -## 2.0.0 - 2018-01-30 -* Update to pump@2.0.1. (Use the individual modules to avoid potentially unnecessary major updates in your project) -* Pin engines support to >= Node 4.0.0. Run Node LTS or greater. diff --git a/node_modules/cacache/node_modules/mississippi/index.js b/node_modules/cacache/node_modules/mississippi/index.js deleted file mode 100644 index d635b29c5..000000000 --- a/node_modules/cacache/node_modules/mississippi/index.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports.pipe = require('pump') -module.exports.each = require('stream-each') -module.exports.pipeline = require('pumpify') -module.exports.duplex = require('duplexify') -module.exports.through = require('through2') -module.exports.concat = require('concat-stream') -module.exports.finished = require('end-of-stream') -module.exports.from = require('from2') -module.exports.to = require('flush-write-stream') -module.exports.parallel = require('parallel-transform') diff --git a/node_modules/cacache/node_modules/mississippi/license b/node_modules/cacache/node_modules/mississippi/license deleted file mode 100644 index e34763968..000000000 --- a/node_modules/cacache/node_modules/mississippi/license +++ /dev/null @@ -1,7 +0,0 @@ -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/LICENSE b/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/LICENSE deleted file mode 100644 index 99c130e1d..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License - -Copyright (c) 2013 Max Ogden - -Permission is hereby granted, free of charge, -to any person obtaining a copy of this software and -associated documentation files (the "Software"), to -deal in the Software without restriction, including -without limitation the rights to use, copy, modify, -merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom -the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/index.js deleted file mode 100644 index b16ad1343..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/index.js +++ /dev/null @@ -1,143 +0,0 @@ -var Writable = require('readable-stream').Writable -var inherits = require('inherits') - -if (typeof Uint8Array === 'undefined') { - var U8 = require('typedarray').Uint8Array -} else { - var U8 = Uint8Array -} - -function ConcatStream(opts, cb) { - if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb) - - if (typeof opts === 'function') { - cb = opts - opts = {} - } - if (!opts) opts = {} - - var encoding = opts.encoding - var shouldInferEncoding = false - - if (!encoding) { - shouldInferEncoding = true - } else { - encoding = String(encoding).toLowerCase() - if (encoding === 'u8' || encoding === 'uint8') { - encoding = 'uint8array' - } - } - - Writable.call(this, { objectMode: true }) - - this.encoding = encoding - this.shouldInferEncoding = shouldInferEncoding - - if (cb) this.on('finish', function () { cb(this.getBody()) }) - this.body = [] -} - -module.exports = ConcatStream -inherits(ConcatStream, Writable) - -ConcatStream.prototype._write = function(chunk, enc, next) { - this.body.push(chunk) - next() -} - -ConcatStream.prototype.inferEncoding = function (buff) { - var firstBuffer = buff === undefined ? this.body[0] : buff; - if (Buffer.isBuffer(firstBuffer)) return 'buffer' - if (typeof Uint8Array !== 'undefined' && firstBuffer instanceof Uint8Array) return 'uint8array' - if (Array.isArray(firstBuffer)) return 'array' - if (typeof firstBuffer === 'string') return 'string' - if (Object.prototype.toString.call(firstBuffer) === "[object Object]") return 'object' - return 'buffer' -} - -ConcatStream.prototype.getBody = function () { - if (!this.encoding && this.body.length === 0) return [] - if (this.shouldInferEncoding) this.encoding = this.inferEncoding() - if (this.encoding === 'array') return arrayConcat(this.body) - if (this.encoding === 'string') return stringConcat(this.body) - if (this.encoding === 'buffer') return bufferConcat(this.body) - if (this.encoding === 'uint8array') return u8Concat(this.body) - return this.body -} - -var isArray = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]' -} - -function isArrayish (arr) { - return /Array\]$/.test(Object.prototype.toString.call(arr)) -} - -function isBufferish (p) { - return typeof p === 'string' || isArrayish(p) || (p && typeof p.subarray === 'function') -} - -function stringConcat (parts) { - var strings = [] - var needsToString = false - for (var i = 0; i < parts.length; i++) { - var p = parts[i] - if (typeof p === 'string') { - strings.push(p) - } else if (Buffer.isBuffer(p)) { - strings.push(p) - } else if (isBufferish(p)) { - strings.push(new Buffer(p)) - } else { - strings.push(new Buffer(String(p))) - } - } - if (Buffer.isBuffer(parts[0])) { - strings = Buffer.concat(strings) - strings = strings.toString('utf8') - } else { - strings = strings.join('') - } - return strings -} - -function bufferConcat (parts) { - var bufs = [] - for (var i = 0; i < parts.length; i++) { - var p = parts[i] - if (Buffer.isBuffer(p)) { - bufs.push(p) - } else if (isBufferish(p)) { - bufs.push(new Buffer(p)) - } else { - bufs.push(new Buffer(String(p))) - } - } - return Buffer.concat(bufs) -} - -function arrayConcat (parts) { - var res = [] - for (var i = 0; i < parts.length; i++) { - res.push.apply(res, parts[i]) - } - return res -} - -function u8Concat (parts) { - var len = 0 - for (var i = 0; i < parts.length; i++) { - if (typeof parts[i] === 'string') { - parts[i] = new Buffer(parts[i]) - } - len += parts[i].length - } - var u8 = new U8(len) - for (var i = 0, offset = 0; i < parts.length; i++) { - var part = parts[i] - for (var j = 0; j < part.length; j++) { - u8[offset++] = part[j] - } - } - return u8 -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/.travis.yml b/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/.travis.yml deleted file mode 100644 index cc4dba29d..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/LICENSE b/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/LICENSE deleted file mode 100644 index 11adfaec9..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/LICENSE +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (c) 2010, Linden Research, Inc. - Copyright (c) 2012, Joshua Bell - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - $/LicenseInfo$ - */ - -// Original can be found at: -// https://bitbucket.org/lindenlab/llsd -// Modifications by Joshua Bell inexorabletash@gmail.com -// https://github.com/inexorabletash/polyfill - -// ES3/ES5 implementation of the Krhonos Typed Array Specification -// Ref: http://www.khronos.org/registry/typedarray/specs/latest/ -// Date: 2011-02-01 -// -// Variations: -// * Allows typed_array.get/set() as alias for subscripts (typed_array[]) diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/example/tarray.js b/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/example/tarray.js deleted file mode 100644 index 8423d7c9b..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/example/tarray.js +++ /dev/null @@ -1,4 +0,0 @@ -var Uint8Array = require('../').Uint8Array; -var ua = new Uint8Array(5); -ua[1] = 256 + 55; -console.log(ua[1]); diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/index.js deleted file mode 100644 index 5e540841f..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/index.js +++ /dev/null @@ -1,630 +0,0 @@ -var undefined = (void 0); // Paranoia - -// Beyond this value, index getters/setters (i.e. array[0], array[1]) are so slow to -// create, and consume so much memory, that the browser appears frozen. -var MAX_ARRAY_LENGTH = 1e5; - -// Approximations of internal ECMAScript conversion functions -var ECMAScript = (function() { - // Stash a copy in case other scripts modify these - var opts = Object.prototype.toString, - ophop = Object.prototype.hasOwnProperty; - - return { - // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues: - Class: function(v) { return opts.call(v).replace(/^\[object *|\]$/g, ''); }, - HasProperty: function(o, p) { return p in o; }, - HasOwnProperty: function(o, p) { return ophop.call(o, p); }, - IsCallable: function(o) { return typeof o === 'function'; }, - ToInt32: function(v) { return v >> 0; }, - ToUint32: function(v) { return v >>> 0; } - }; -}()); - -// Snapshot intrinsics -var LN2 = Math.LN2, - abs = Math.abs, - floor = Math.floor, - log = Math.log, - min = Math.min, - pow = Math.pow, - round = Math.round; - -// ES5: lock down object properties -function configureProperties(obj) { - if (getOwnPropNames && defineProp) { - var props = getOwnPropNames(obj), i; - for (i = 0; i < props.length; i += 1) { - defineProp(obj, props[i], { - value: obj[props[i]], - writable: false, - enumerable: false, - configurable: false - }); - } - } -} - -// emulate ES5 getter/setter API using legacy APIs -// http://blogs.msdn.com/b/ie/archive/2010/09/07/transitioning-existing-code-to-the-es5-getter-setter-apis.aspx -// (second clause tests for Object.defineProperty() in IE<9 that only supports extending DOM prototypes, but -// note that IE<9 does not support __defineGetter__ or __defineSetter__ so it just renders the method harmless) -var defineProp -if (Object.defineProperty && (function() { - try { - Object.defineProperty({}, 'x', {}); - return true; - } catch (e) { - return false; - } - })()) { - defineProp = Object.defineProperty; -} else { - defineProp = function(o, p, desc) { - if (!o === Object(o)) throw new TypeError("Object.defineProperty called on non-object"); - if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) { Object.prototype.__defineGetter__.call(o, p, desc.get); } - if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) { Object.prototype.__defineSetter__.call(o, p, desc.set); } - if (ECMAScript.HasProperty(desc, 'value')) { o[p] = desc.value; } - return o; - }; -} - -var getOwnPropNames = Object.getOwnPropertyNames || function (o) { - if (o !== Object(o)) throw new TypeError("Object.getOwnPropertyNames called on non-object"); - var props = [], p; - for (p in o) { - if (ECMAScript.HasOwnProperty(o, p)) { - props.push(p); - } - } - return props; -}; - -// ES5: Make obj[index] an alias for obj._getter(index)/obj._setter(index, value) -// for index in 0 ... obj.length -function makeArrayAccessors(obj) { - if (!defineProp) { return; } - - if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError("Array too large for polyfill"); - - function makeArrayAccessor(index) { - defineProp(obj, index, { - 'get': function() { return obj._getter(index); }, - 'set': function(v) { obj._setter(index, v); }, - enumerable: true, - configurable: false - }); - } - - var i; - for (i = 0; i < obj.length; i += 1) { - makeArrayAccessor(i); - } -} - -// Internal conversion functions: -// pack<Type>() - take a number (interpreted as Type), output a byte array -// unpack<Type>() - take a byte array, output a Type-like number - -function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; } -function as_unsigned(value, bits) { var s = 32 - bits; return (value << s) >>> s; } - -function packI8(n) { return [n & 0xff]; } -function unpackI8(bytes) { return as_signed(bytes[0], 8); } - -function packU8(n) { return [n & 0xff]; } -function unpackU8(bytes) { return as_unsigned(bytes[0], 8); } - -function packU8Clamped(n) { n = round(Number(n)); return [n < 0 ? 0 : n > 0xff ? 0xff : n & 0xff]; } - -function packI16(n) { return [(n >> 8) & 0xff, n & 0xff]; } -function unpackI16(bytes) { return as_signed(bytes[0] << 8 | bytes[1], 16); } - -function packU16(n) { return [(n >> 8) & 0xff, n & 0xff]; } -function unpackU16(bytes) { return as_unsigned(bytes[0] << 8 | bytes[1], 16); } - -function packI32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; } -function unpackI32(bytes) { return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } - -function packU32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; } -function unpackU32(bytes) { return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } - -function packIEEE754(v, ebits, fbits) { - - var bias = (1 << (ebits - 1)) - 1, - s, e, f, ln, - i, bits, str, bytes; - - function roundToEven(n) { - var w = floor(n), f = n - w; - if (f < 0.5) - return w; - if (f > 0.5) - return w + 1; - return w % 2 ? w + 1 : w; - } - - // Compute sign, exponent, fraction - if (v !== v) { - // NaN - // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping - e = (1 << ebits) - 1; f = pow(2, fbits - 1); s = 0; - } else if (v === Infinity || v === -Infinity) { - e = (1 << ebits) - 1; f = 0; s = (v < 0) ? 1 : 0; - } else if (v === 0) { - e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0; - } else { - s = v < 0; - v = abs(v); - - if (v >= pow(2, 1 - bias)) { - e = min(floor(log(v) / LN2), 1023); - f = roundToEven(v / pow(2, e) * pow(2, fbits)); - if (f / pow(2, fbits) >= 2) { - e = e + 1; - f = 1; - } - if (e > bias) { - // Overflow - e = (1 << ebits) - 1; - f = 0; - } else { - // Normalized - e = e + bias; - f = f - pow(2, fbits); - } - } else { - // Denormalized - e = 0; - f = roundToEven(v / pow(2, 1 - bias - fbits)); - } - } - - // Pack sign, exponent, fraction - bits = []; - for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = floor(f / 2); } - for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = floor(e / 2); } - bits.push(s ? 1 : 0); - bits.reverse(); - str = bits.join(''); - - // Bits to bytes - bytes = []; - while (str.length) { - bytes.push(parseInt(str.substring(0, 8), 2)); - str = str.substring(8); - } - return bytes; -} - -function unpackIEEE754(bytes, ebits, fbits) { - - // Bytes to bits - var bits = [], i, j, b, str, - bias, s, e, f; - - for (i = bytes.length; i; i -= 1) { - b = bytes[i - 1]; - for (j = 8; j; j -= 1) { - bits.push(b % 2 ? 1 : 0); b = b >> 1; - } - } - bits.reverse(); - str = bits.join(''); - - // Unpack sign, exponent, fraction - bias = (1 << (ebits - 1)) - 1; - s = parseInt(str.substring(0, 1), 2) ? -1 : 1; - e = parseInt(str.substring(1, 1 + ebits), 2); - f = parseInt(str.substring(1 + ebits), 2); - - // Produce number - if (e === (1 << ebits) - 1) { - return f !== 0 ? NaN : s * Infinity; - } else if (e > 0) { - // Normalized - return s * pow(2, e - bias) * (1 + f / pow(2, fbits)); - } else if (f !== 0) { - // Denormalized - return s * pow(2, -(bias - 1)) * (f / pow(2, fbits)); - } else { - return s < 0 ? -0 : 0; - } -} - -function unpackF64(b) { return unpackIEEE754(b, 11, 52); } -function packF64(v) { return packIEEE754(v, 11, 52); } -function unpackF32(b) { return unpackIEEE754(b, 8, 23); } -function packF32(v) { return packIEEE754(v, 8, 23); } - - -// -// 3 The ArrayBuffer Type -// - -(function() { - - /** @constructor */ - var ArrayBuffer = function ArrayBuffer(length) { - length = ECMAScript.ToInt32(length); - if (length < 0) throw new RangeError('ArrayBuffer size is not a small enough positive integer'); - - this.byteLength = length; - this._bytes = []; - this._bytes.length = length; - - var i; - for (i = 0; i < this.byteLength; i += 1) { - this._bytes[i] = 0; - } - - configureProperties(this); - }; - - exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer; - - // - // 4 The ArrayBufferView Type - // - - // NOTE: this constructor is not exported - /** @constructor */ - var ArrayBufferView = function ArrayBufferView() { - //this.buffer = null; - //this.byteOffset = 0; - //this.byteLength = 0; - }; - - // - // 5 The Typed Array View Types - // - - function makeConstructor(bytesPerElement, pack, unpack) { - // Each TypedArray type requires a distinct constructor instance with - // identical logic, which this produces. - - var ctor; - ctor = function(buffer, byteOffset, length) { - var array, sequence, i, s; - - if (!arguments.length || typeof arguments[0] === 'number') { - // Constructor(unsigned long length) - this.length = ECMAScript.ToInt32(arguments[0]); - if (length < 0) throw new RangeError('ArrayBufferView size is not a small enough positive integer'); - - this.byteLength = this.length * this.BYTES_PER_ELEMENT; - this.buffer = new ArrayBuffer(this.byteLength); - this.byteOffset = 0; - } else if (typeof arguments[0] === 'object' && arguments[0].constructor === ctor) { - // Constructor(TypedArray array) - array = arguments[0]; - - this.length = array.length; - this.byteLength = this.length * this.BYTES_PER_ELEMENT; - this.buffer = new ArrayBuffer(this.byteLength); - this.byteOffset = 0; - - for (i = 0; i < this.length; i += 1) { - this._setter(i, array._getter(i)); - } - } else if (typeof arguments[0] === 'object' && - !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) { - // Constructor(sequence<type> array) - sequence = arguments[0]; - - this.length = ECMAScript.ToUint32(sequence.length); - this.byteLength = this.length * this.BYTES_PER_ELEMENT; - this.buffer = new ArrayBuffer(this.byteLength); - this.byteOffset = 0; - - for (i = 0; i < this.length; i += 1) { - s = sequence[i]; - this._setter(i, Number(s)); - } - } else if (typeof arguments[0] === 'object' && - (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) { - // Constructor(ArrayBuffer buffer, - // optional unsigned long byteOffset, optional unsigned long length) - this.buffer = buffer; - - this.byteOffset = ECMAScript.ToUint32(byteOffset); - if (this.byteOffset > this.buffer.byteLength) { - throw new RangeError("byteOffset out of range"); - } - - if (this.byteOffset % this.BYTES_PER_ELEMENT) { - // The given byteOffset must be a multiple of the element - // size of the specific type, otherwise an exception is raised. - throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size."); - } - - if (arguments.length < 3) { - this.byteLength = this.buffer.byteLength - this.byteOffset; - - if (this.byteLength % this.BYTES_PER_ELEMENT) { - throw new RangeError("length of buffer minus byteOffset not a multiple of the element size"); - } - this.length = this.byteLength / this.BYTES_PER_ELEMENT; - } else { - this.length = ECMAScript.ToUint32(length); - this.byteLength = this.length * this.BYTES_PER_ELEMENT; - } - - if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) { - throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); - } - } else { - throw new TypeError("Unexpected argument type(s)"); - } - - this.constructor = ctor; - - configureProperties(this); - makeArrayAccessors(this); - }; - - ctor.prototype = new ArrayBufferView(); - ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement; - ctor.prototype._pack = pack; - ctor.prototype._unpack = unpack; - ctor.BYTES_PER_ELEMENT = bytesPerElement; - - // getter type (unsigned long index); - ctor.prototype._getter = function(index) { - if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); - - index = ECMAScript.ToUint32(index); - if (index >= this.length) { - return undefined; - } - - var bytes = [], i, o; - for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; - i < this.BYTES_PER_ELEMENT; - i += 1, o += 1) { - bytes.push(this.buffer._bytes[o]); - } - return this._unpack(bytes); - }; - - // NONSTANDARD: convenience alias for getter: type get(unsigned long index); - ctor.prototype.get = ctor.prototype._getter; - - // setter void (unsigned long index, type value); - ctor.prototype._setter = function(index, value) { - if (arguments.length < 2) throw new SyntaxError("Not enough arguments"); - - index = ECMAScript.ToUint32(index); - if (index >= this.length) { - return undefined; - } - - var bytes = this._pack(value), i, o; - for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; - i < this.BYTES_PER_ELEMENT; - i += 1, o += 1) { - this.buffer._bytes[o] = bytes[i]; - } - }; - - // void set(TypedArray array, optional unsigned long offset); - // void set(sequence<type> array, optional unsigned long offset); - ctor.prototype.set = function(index, value) { - if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); - var array, sequence, offset, len, - i, s, d, - byteOffset, byteLength, tmp; - - if (typeof arguments[0] === 'object' && arguments[0].constructor === this.constructor) { - // void set(TypedArray array, optional unsigned long offset); - array = arguments[0]; - offset = ECMAScript.ToUint32(arguments[1]); - - if (offset + array.length > this.length) { - throw new RangeError("Offset plus length of array is out of range"); - } - - byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT; - byteLength = array.length * this.BYTES_PER_ELEMENT; - - if (array.buffer === this.buffer) { - tmp = []; - for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) { - tmp[i] = array.buffer._bytes[s]; - } - for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) { - this.buffer._bytes[d] = tmp[i]; - } - } else { - for (i = 0, s = array.byteOffset, d = byteOffset; - i < byteLength; i += 1, s += 1, d += 1) { - this.buffer._bytes[d] = array.buffer._bytes[s]; - } - } - } else if (typeof arguments[0] === 'object' && typeof arguments[0].length !== 'undefined') { - // void set(sequence<type> array, optional unsigned long offset); - sequence = arguments[0]; - len = ECMAScript.ToUint32(sequence.length); - offset = ECMAScript.ToUint32(arguments[1]); - - if (offset + len > this.length) { - throw new RangeError("Offset plus length of array is out of range"); - } - - for (i = 0; i < len; i += 1) { - s = sequence[i]; - this._setter(offset + i, Number(s)); - } - } else { - throw new TypeError("Unexpected argument type(s)"); - } - }; - - // TypedArray subarray(long begin, optional long end); - ctor.prototype.subarray = function(start, end) { - function clamp(v, min, max) { return v < min ? min : v > max ? max : v; } - - start = ECMAScript.ToInt32(start); - end = ECMAScript.ToInt32(end); - - if (arguments.length < 1) { start = 0; } - if (arguments.length < 2) { end = this.length; } - - if (start < 0) { start = this.length + start; } - if (end < 0) { end = this.length + end; } - - start = clamp(start, 0, this.length); - end = clamp(end, 0, this.length); - - var len = end - start; - if (len < 0) { - len = 0; - } - - return new this.constructor( - this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len); - }; - - return ctor; - } - - var Int8Array = makeConstructor(1, packI8, unpackI8); - var Uint8Array = makeConstructor(1, packU8, unpackU8); - var Uint8ClampedArray = makeConstructor(1, packU8Clamped, unpackU8); - var Int16Array = makeConstructor(2, packI16, unpackI16); - var Uint16Array = makeConstructor(2, packU16, unpackU16); - var Int32Array = makeConstructor(4, packI32, unpackI32); - var Uint32Array = makeConstructor(4, packU32, unpackU32); - var Float32Array = makeConstructor(4, packF32, unpackF32); - var Float64Array = makeConstructor(8, packF64, unpackF64); - - exports.Int8Array = exports.Int8Array || Int8Array; - exports.Uint8Array = exports.Uint8Array || Uint8Array; - exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray; - exports.Int16Array = exports.Int16Array || Int16Array; - exports.Uint16Array = exports.Uint16Array || Uint16Array; - exports.Int32Array = exports.Int32Array || Int32Array; - exports.Uint32Array = exports.Uint32Array || Uint32Array; - exports.Float32Array = exports.Float32Array || Float32Array; - exports.Float64Array = exports.Float64Array || Float64Array; -}()); - -// -// 6 The DataView View Type -// - -(function() { - function r(array, index) { - return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index]; - } - - var IS_BIG_ENDIAN = (function() { - var u16array = new(exports.Uint16Array)([0x1234]), - u8array = new(exports.Uint8Array)(u16array.buffer); - return r(u8array, 0) === 0x12; - }()); - - // Constructor(ArrayBuffer buffer, - // optional unsigned long byteOffset, - // optional unsigned long byteLength) - /** @constructor */ - var DataView = function DataView(buffer, byteOffset, byteLength) { - if (arguments.length === 0) { - buffer = new exports.ArrayBuffer(0); - } else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) { - throw new TypeError("TypeError"); - } - - this.buffer = buffer || new exports.ArrayBuffer(0); - - this.byteOffset = ECMAScript.ToUint32(byteOffset); - if (this.byteOffset > this.buffer.byteLength) { - throw new RangeError("byteOffset out of range"); - } - - if (arguments.length < 3) { - this.byteLength = this.buffer.byteLength - this.byteOffset; - } else { - this.byteLength = ECMAScript.ToUint32(byteLength); - } - - if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) { - throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); - } - - configureProperties(this); - }; - - function makeGetter(arrayType) { - return function(byteOffset, littleEndian) { - - byteOffset = ECMAScript.ToUint32(byteOffset); - - if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { - throw new RangeError("Array index out of range"); - } - byteOffset += this.byteOffset; - - var uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), - bytes = [], i; - for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { - bytes.push(r(uint8Array, i)); - } - - if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { - bytes.reverse(); - } - - return r(new arrayType(new exports.Uint8Array(bytes).buffer), 0); - }; - } - - DataView.prototype.getUint8 = makeGetter(exports.Uint8Array); - DataView.prototype.getInt8 = makeGetter(exports.Int8Array); - DataView.prototype.getUint16 = makeGetter(exports.Uint16Array); - DataView.prototype.getInt16 = makeGetter(exports.Int16Array); - DataView.prototype.getUint32 = makeGetter(exports.Uint32Array); - DataView.prototype.getInt32 = makeGetter(exports.Int32Array); - DataView.prototype.getFloat32 = makeGetter(exports.Float32Array); - DataView.prototype.getFloat64 = makeGetter(exports.Float64Array); - - function makeSetter(arrayType) { - return function(byteOffset, value, littleEndian) { - - byteOffset = ECMAScript.ToUint32(byteOffset); - if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { - throw new RangeError("Array index out of range"); - } - - // Get bytes - var typeArray = new arrayType([value]), - byteArray = new exports.Uint8Array(typeArray.buffer), - bytes = [], i, byteView; - - for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { - bytes.push(r(byteArray, i)); - } - - // Flip if necessary - if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { - bytes.reverse(); - } - - // Write them - byteView = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT); - byteView.set(bytes); - }; - } - - DataView.prototype.setUint8 = makeSetter(exports.Uint8Array); - DataView.prototype.setInt8 = makeSetter(exports.Int8Array); - DataView.prototype.setUint16 = makeSetter(exports.Uint16Array); - DataView.prototype.setInt16 = makeSetter(exports.Int16Array); - DataView.prototype.setUint32 = makeSetter(exports.Uint32Array); - DataView.prototype.setInt32 = makeSetter(exports.Int32Array); - DataView.prototype.setFloat32 = makeSetter(exports.Float32Array); - DataView.prototype.setFloat64 = makeSetter(exports.Float64Array); - - exports.DataView = exports.DataView || DataView; - -}()); diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/package.json deleted file mode 100644 index 089c4b207..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_from": "typedarray@^0.0.6", - "_id": "typedarray@0.0.6", - "_inBundle": false, - "_integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "_location": "/cacache/mississippi/concat-stream/typedarray", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "typedarray@^0.0.6", - "name": "typedarray", - "escapedName": "typedarray", - "rawSpec": "^0.0.6", - "saveSpec": null, - "fetchSpec": "^0.0.6" - }, - "_requiredBy": [ - "/cacache/mississippi/concat-stream" - ], - "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", - "_spec": "typedarray@^0.0.6", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/typedarray/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "TypedArray polyfill for old browsers", - "devDependencies": { - "tape": "~2.3.2" - }, - "homepage": "https://github.com/substack/typedarray", - "keywords": [ - "ArrayBuffer", - "DataView", - "Float32Array", - "Float64Array", - "Int8Array", - "Int16Array", - "Int32Array", - "Uint8Array", - "Uint8ClampedArray", - "Uint16Array", - "Uint32Array", - "typed", - "array", - "polyfill" - ], - "license": "MIT", - "main": "index.js", - "name": "typedarray", - "repository": { - "type": "git", - "url": "git://github.com/substack/typedarray.git" - }, - "scripts": { - "test": "tape test/*.js test/server/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "0.0.6" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/readme.markdown b/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/readme.markdown deleted file mode 100644 index d18f6f719..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/readme.markdown +++ /dev/null @@ -1,61 +0,0 @@ -# typedarray - -TypedArray polyfill ripped from [this -module](https://raw.github.com/inexorabletash/polyfill). - -[![build status](https://secure.travis-ci.org/substack/typedarray.png)](http://travis-ci.org/substack/typedarray) - -[![testling badge](https://ci.testling.com/substack/typedarray.png)](https://ci.testling.com/substack/typedarray) - -# example - -``` js -var Uint8Array = require('typedarray').Uint8Array; -var ua = new Uint8Array(5); -ua[1] = 256 + 55; -console.log(ua[1]); -``` - -output: - -``` -55 -``` - -# methods - -``` js -var TA = require('typedarray') -``` - -The `TA` object has the following constructors: - -* TA.ArrayBuffer -* TA.DataView -* TA.Float32Array -* TA.Float64Array -* TA.Int8Array -* TA.Int16Array -* TA.Int32Array -* TA.Uint8Array -* TA.Uint8ClampedArray -* TA.Uint16Array -* TA.Uint32Array - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install typedarray -``` - -To use this module in the browser, compile with -[browserify](http://browserify.org) -or download a UMD build from browserify CDN: - -http://wzrd.in/standalone/typedarray@latest - -# license - -MIT diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js b/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js deleted file mode 100644 index 425950f9f..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js +++ /dev/null @@ -1,19 +0,0 @@ -var test = require('tape'); -var vm = require('vm'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/../../index.js', 'utf8'); - -test('u8a without globals', function (t) { - var c = { - module: { exports: {} }, - }; - c.exports = c.module.exports; - vm.runInNewContext(src, c); - var TA = c.module.exports; - var ua = new(TA.Uint8Array)(5); - - t.equal(ua.length, 5); - ua[1] = 256 + 55; - t.equal(ua[1], 55); - t.end(); -}); diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/test/tarray.js b/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/test/tarray.js deleted file mode 100644 index df596a34f..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/node_modules/typedarray/test/tarray.js +++ /dev/null @@ -1,10 +0,0 @@ -var TA = require('../'); -var test = require('tape'); - -test('tiny u8a test', function (t) { - var ua = new(TA.Uint8Array)(5); - t.equal(ua.length, 5); - ua[1] = 256 + 55; - t.equal(ua[1], 55); - t.end(); -}); diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/package.json deleted file mode 100644 index feb704f2d..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_from": "concat-stream@^1.5.0", - "_id": "concat-stream@1.6.1", - "_inBundle": false, - "_integrity": "sha512-gslSSJx03QKa59cIKqeJO9HQ/WZMotvYJCuaUULrLpjj8oG40kV2Z+gz82pVxlTkOADi4PJxQPPfhl1ELYrrXw==", - "_location": "/cacache/mississippi/concat-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "concat-stream@^1.5.0", - "name": "concat-stream", - "escapedName": "concat-stream", - "rawSpec": "^1.5.0", - "saveSpec": null, - "fetchSpec": "^1.5.0" - }, - "_requiredBy": [ - "/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.1.tgz", - "_shasum": "261b8f518301f1d834e36342b9fea095d2620a26", - "_spec": "concat-stream@^1.5.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi", - "author": { - "name": "Max Ogden", - "email": "max@maxogden.com" - }, - "bugs": { - "url": "http://github.com/maxogden/concat-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - }, - "deprecated": false, - "description": "writable stream that concatenates strings or binary data and calls a callback with the result", - "devDependencies": { - "tape": "^4.6.3" - }, - "engines": [ - "node >= 0.8" - ], - "files": [ - "index.js" - ], - "homepage": "https://github.com/maxogden/concat-stream#readme", - "license": "MIT", - "main": "index.js", - "name": "concat-stream", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/maxogden/concat-stream.git" - }, - "scripts": { - "test": "tape test/*.js test/server/*.js" - }, - "tags": [ - "stream", - "simple", - "util", - "utility" - ], - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/17..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "1.6.1" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/readme.md b/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/readme.md deleted file mode 100644 index f45e6fc87..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/concat-stream/readme.md +++ /dev/null @@ -1,102 +0,0 @@ -# concat-stream - -Writable stream that concatenates all the data from a stream and calls a callback with the result. Use this when you want to collect all the data from a stream into a single buffer. - -[![Build Status](https://travis-ci.org/maxogden/concat-stream.svg?branch=master)](https://travis-ci.org/maxogden/concat-stream) - -[![NPM](https://nodei.co/npm/concat-stream.png)](https://nodei.co/npm/concat-stream/) - -### description - -Streams emit many buffers. If you want to collect all of the buffers, and when the stream ends concatenate all of the buffers together and receive a single buffer then this is the module for you. - -Only use this if you know you can fit all of the output of your stream into a single Buffer (e.g. in RAM). - -There are also `objectMode` streams that emit things other than Buffers, and you can concatenate these too. See below for details. - -## Related - -`concat-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. - -### examples - -#### Buffers - -```js -var fs = require('fs') -var concat = require('concat-stream') - -var readStream = fs.createReadStream('cat.png') -var concatStream = concat(gotPicture) - -readStream.on('error', handleError) -readStream.pipe(concatStream) - -function gotPicture(imageBuffer) { - // imageBuffer is all of `cat.png` as a node.js Buffer -} - -function handleError(err) { - // handle your error appropriately here, e.g.: - console.error(err) // print the error to STDERR - process.exit(1) // exit program with non-zero exit code -} - -``` - -#### Arrays - -```js -var write = concat(function(data) {}) -write.write([1,2,3]) -write.write([4,5,6]) -write.end() -// data will be [1,2,3,4,5,6] in the above callback -``` - -#### Uint8Arrays - -```js -var write = concat(function(data) {}) -var a = new Uint8Array(3) -a[0] = 97; a[1] = 98; a[2] = 99 -write.write(a) -write.write('!') -write.end(Buffer('!!1')) -``` - -See `test/` for more examples - -# methods - -```js -var concat = require('concat-stream') -``` - -## var writable = concat(opts={}, cb) - -Return a `writable` stream that will fire `cb(data)` with all of the data that -was written to the stream. Data can be written to `writable` as strings, -Buffers, arrays of byte integers, and Uint8Arrays. - -By default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason. - -* `string` - get a string -* `buffer` - get back a Buffer -* `array` - get an array of byte integers -* `uint8array`, `u8`, `uint8` - get back a Uint8Array -* `object`, get back an array of Objects - -If you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't in the list above), it will try to convert concat them into a `Buffer`. - -If nothing is written to `writable` then `data` will be an empty array `[]`. - -# error handling - -`concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors. - -We recommend using [`end-of-stream`](https://npmjs.org/end-of-stream) or [`pump`](https://npmjs.org/pump) for writing error tolerant stream code. - -# license - -MIT LICENSE diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/.travis.yml b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/.travis.yml deleted file mode 100644 index ecd4193f6..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.12" - - "4" - - "6" diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/LICENSE b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/LICENSE deleted file mode 100644 index 757562ec5..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE.
\ No newline at end of file diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/README.md deleted file mode 100644 index 8352900fc..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# duplexify - -Turn a writeable and readable stream into a single streams2 duplex stream. - -Similar to [duplexer2](https://github.com/deoxxa/duplexer2) except it supports both streams2 and streams1 as input -and it allows you to set the readable and writable part asynchronously using `setReadable(stream)` and `setWritable(stream)` - -``` -npm install duplexify -``` - -[![build status](http://img.shields.io/travis/mafintosh/duplexify.svg?style=flat)](http://travis-ci.org/mafintosh/duplexify) - -## Usage - -Use `duplexify(writable, readable, streamOptions)` (or `duplexify.obj(writable, readable)` to create an object stream) - -``` js -var duplexify = require('duplexify') - -// turn writableStream and readableStream into a single duplex stream -var dup = duplexify(writableStream, readableStream) - -dup.write('hello world') // will write to writableStream -dup.on('data', function(data) { - // will read from readableStream -}) -``` - -You can also set the readable and writable parts asynchronously - -``` js -var dup = duplexify() - -dup.write('hello world') // write will buffer until the writable - // part has been set - -// wait a bit ... -dup.setReadable(readableStream) - -// maybe wait some more? -dup.setWritable(writableStream) -``` - -If you call `setReadable` or `setWritable` multiple times it will unregister the previous readable/writable stream. -To disable the readable or writable part call `setReadable` or `setWritable` with `null`. - -If the readable or writable streams emits an error or close it will destroy both streams and bubble up the event. -You can also explicitly destroy the streams by calling `dup.destroy()`. The `destroy` method optionally takes an -error object as argument, in which case the error is emitted as part of the `error` event. - -``` js -dup.on('error', function(err) { - console.log('readable or writable emitted an error - close will follow') -}) - -dup.on('close', function() { - console.log('the duplex stream is destroyed') -}) - -dup.destroy() // calls destroy on the readable and writable part (if present) -``` - -## HTTP request example - -Turn a node core http request into a duplex stream is as easy as - -``` js -var duplexify = require('duplexify') -var http = require('http') - -var request = function(opts) { - var req = http.request(opts) - var dup = duplexify(req) - req.on('response', function(res) { - dup.setReadable(res) - }) - return dup -} - -var req = request({ - method: 'GET', - host: 'www.google.com', - port: 80 -}) - -req.end() -req.pipe(process.stdout) -``` - -## License - -MIT - -## Related - -`duplexify` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/example.js b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/example.js deleted file mode 100644 index 5585c1975..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/example.js +++ /dev/null @@ -1,21 +0,0 @@ -var duplexify = require('duplexify') -var http = require('http') - -var request = function(opts) { - var req = http.request(opts) - var dup = duplexify() - dup.setWritable(req) - req.on('response', function(res) { - dup.setReadable(res) - }) - return dup -} - -var req = request({ - method: 'GET', - host: 'www.google.com', - port: 80 -}) - -req.end() -req.pipe(process.stdout) diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/index.js deleted file mode 100644 index 8323e654a..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/index.js +++ /dev/null @@ -1,241 +0,0 @@ -var stream = require('readable-stream') -var eos = require('end-of-stream') -var inherits = require('inherits') -var shift = require('stream-shift') - -var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from) - ? Buffer.from([0]) - : new Buffer([0]) - -var onuncork = function(self, fn) { - if (self._corked) self.once('uncork', fn) - else fn() -} - -var destroyer = function(self, end) { - return function(err) { - if (err) self._destroyInterval(err) - else if (end && !self._ended) self.end() - } -} - -var end = function(ws, fn) { - if (!ws) return fn() - if (ws._writableState && ws._writableState.finished) return fn() - if (ws._writableState) return ws.end(fn) - ws.end() - fn() -} - -var toStreams2 = function(rs) { - return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs) -} - -var Duplexify = function(writable, readable, opts) { - if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts) - stream.Duplex.call(this, opts) - - this._writable = null - this._readable = null - this._readable2 = null - - this._forwardDestroy = !opts || opts.destroy !== false - this._forwardEnd = !opts || opts.end !== false - this._corked = 1 // start corked - this._ondrain = null - this._drained = false - this._forwarding = false - this._unwrite = null - this._unread = null - this._ended = false - this._error = null - this._preferError = false - - this.destroyed = false - - if (writable) this.setWritable(writable) - if (readable) this.setReadable(readable) -} - -inherits(Duplexify, stream.Duplex) - -Duplexify.obj = function(writable, readable, opts) { - if (!opts) opts = {} - opts.objectMode = true - opts.highWaterMark = 16 - return new Duplexify(writable, readable, opts) -} - -Duplexify.prototype.cork = function() { - if (++this._corked === 1) this.emit('cork') -} - -Duplexify.prototype.uncork = function() { - if (this._corked && --this._corked === 0) this.emit('uncork') -} - -Duplexify.prototype.setWritable = function(writable) { - if (this._unwrite) this._unwrite() - - if (this.destroyed) { - if (writable && writable.destroy) writable.destroy() - return - } - - if (writable === null || writable === false) { - this.end() - return - } - - var self = this - var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd)) - - var ondrain = function() { - var ondrain = self._ondrain - self._ondrain = null - if (ondrain) ondrain() - } - - var clear = function() { - self._writable.removeListener('drain', ondrain) - unend() - } - - if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks - - this._writable = writable - this._writable.on('drain', ondrain) - this._unwrite = clear - - this.uncork() // always uncork setWritable -} - -Duplexify.prototype.setReadable = function(readable) { - if (this._unread) this._unread() - - if (this.destroyed) { - if (readable && readable.destroy) readable.destroy() - return - } - - if (readable === null || readable === false) { - this.push(null) - this.resume() - return - } - - var self = this - var unend = eos(readable, {writable:false, readable:true}, destroyer(this)) - - var onreadable = function() { - self._forward() - } - - var onend = function() { - self.push(null) - } - - var clear = function() { - self._readable2.removeListener('readable', onreadable) - self._readable2.removeListener('end', onend) - unend() - } - - this._drained = true - this._readable = readable - this._readable2 = readable._readableState ? readable : toStreams2(readable) - this._readable2.on('readable', onreadable) - this._readable2.on('end', onend) - this._unread = clear - - this._forward() -} - -Duplexify.prototype._read = function() { - this._drained = true - this._forward() -} - -Duplexify.prototype._forward = function() { - if (this._forwarding || !this._readable2 || !this._drained) return - this._forwarding = true - - var data - - while (this._drained && (data = shift(this._readable2)) !== null) { - if (this.destroyed) continue - this._drained = this.push(data) - } - - this._forwarding = false -} - -Duplexify.prototype.destroy = function(err) { - if (this._preferError && !this._error && err) this._error = err - - if (this.destroyed) return - this.destroyed = true - - var self = this - process.nextTick(function() { - self._destroy(self._preferError ? self._error : err) - }) -} - -Duplexify.prototype._destroyInterval = function(err) { - if (this.destroyed) return - if (err.message !== 'premature close') return this.destroy(err) - this._preferError = true - this.destroy(null) -} - -Duplexify.prototype._destroy = function(err) { - if (err) { - var ondrain = this._ondrain - this._ondrain = null - if (ondrain) ondrain(err) - else this.emit('error', err) - } - - if (this._forwardDestroy) { - if (this._readable && this._readable.destroy) this._readable.destroy() - if (this._writable && this._writable.destroy) this._writable.destroy() - } - - this.emit('close') -} - -Duplexify.prototype._write = function(data, enc, cb) { - if (this.destroyed) return cb() - if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb)) - if (data === SIGNAL_FLUSH) return this._finish(cb) - if (!this._writable) return cb() - - if (this._writable.write(data) === false) this._ondrain = cb - else cb() -} - - -Duplexify.prototype._finish = function(cb) { - var self = this - this.emit('preend') - onuncork(this, function() { - end(self._forwardEnd && self._writable, function() { - // haxx to not emit prefinish twice - if (self._writableState.prefinished === false) self._writableState.prefinished = true - self.emit('prefinish') - onuncork(self, cb) - }) - }) -} - -Duplexify.prototype.end = function(data, enc, cb) { - if (typeof data === 'function') return this.end(null, null, data) - if (typeof enc === 'function') return this.end(data, null, enc) - this._ended = true - if (data) this.write(data) - if (!this._writableState.ending) this.write(SIGNAL_FLUSH) - return stream.Writable.prototype.end.call(this, cb) -} - -module.exports = Duplexify diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/.npmignore b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/.npmignore deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/.travis.yml b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/.travis.yml deleted file mode 100644 index ecd4193f6..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.12" - - "4" - - "6" diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/LICENSE b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/LICENSE deleted file mode 100644 index bae9da7bf..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/README.md deleted file mode 100644 index d9cc2d945..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# stream-shift - -Returns the next buffer/object in a stream's readable queue - -``` -npm install stream-shift -``` - -[![build status](http://img.shields.io/travis/mafintosh/stream-shift.svg?style=flat)](http://travis-ci.org/mafintosh/stream-shift) - -## Usage - -``` js -var shift = require('stream-shift') - -console.log(shift(someStream)) // first item in its buffer -``` - -## Credit - -Thanks [@dignifiedquire](https://github.com/dignifiedquire) for making this work on node 6 - -## License - -MIT diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/index.js deleted file mode 100644 index c4b18b9c2..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/index.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = shift - -function shift (stream) { - var rs = stream._readableState - if (!rs) return null - return rs.objectMode ? stream.read() : stream.read(getStateLength(rs)) -} - -function getStateLength (state) { - if (state.buffer.length) { - // Since node 6.3.0 state.buffer is a BufferList not an array - if (state.buffer.head) { - return state.buffer.head.data.length - } - - return state.buffer[0].length - } - - return state.length -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/package.json deleted file mode 100644 index 46bdac375..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "_from": "stream-shift@^1.0.0", - "_id": "stream-shift@1.0.0", - "_inBundle": false, - "_integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "_location": "/cacache/mississippi/duplexify/stream-shift", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "stream-shift@^1.0.0", - "name": "stream-shift", - "escapedName": "stream-shift", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/cacache/mississippi/duplexify" - ], - "_resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "_shasum": "d5c752825e5367e786f78e18e445ea223a155952", - "_spec": "stream-shift@^1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi/node_modules/duplexify", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "bugs": { - "url": "https://github.com/mafintosh/stream-shift/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Returns the next buffer/object in a stream's readable queue", - "devDependencies": { - "standard": "^7.1.2", - "tape": "^4.6.0", - "through2": "^2.0.1" - }, - "homepage": "https://github.com/mafintosh/stream-shift", - "license": "MIT", - "main": "index.js", - "name": "stream-shift", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/stream-shift.git" - }, - "scripts": { - "test": "standard && tape test.js" - }, - "version": "1.0.0" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/test.js b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/test.js deleted file mode 100644 index c0222c37d..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/node_modules/stream-shift/test.js +++ /dev/null @@ -1,48 +0,0 @@ -var tape = require('tape') -var through = require('through2') -var stream = require('stream') -var shift = require('./') - -tape('shifts next', function (t) { - var passthrough = through() - - passthrough.write('hello') - passthrough.write('world') - - t.same(shift(passthrough), Buffer('hello')) - t.same(shift(passthrough), Buffer('world')) - t.end() -}) - -tape('shifts next with core', function (t) { - var passthrough = stream.PassThrough() - - passthrough.write('hello') - passthrough.write('world') - - t.same(shift(passthrough), Buffer('hello')) - t.same(shift(passthrough), Buffer('world')) - t.end() -}) - -tape('shifts next with object mode', function (t) { - var passthrough = through({objectMode: true}) - - passthrough.write({hello: 1}) - passthrough.write({world: 1}) - - t.same(shift(passthrough), {hello: 1}) - t.same(shift(passthrough), {world: 1}) - t.end() -}) - -tape('shifts next with object mode with core', function (t) { - var passthrough = stream.PassThrough({objectMode: true}) - - passthrough.write({hello: 1}) - passthrough.write({world: 1}) - - t.same(shift(passthrough), {hello: 1}) - t.same(shift(passthrough), {world: 1}) - t.end() -}) diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/package.json deleted file mode 100644 index a3c86f5c5..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_from": "duplexify@^3.4.2", - "_id": "duplexify@3.5.4", - "_inBundle": false, - "_integrity": "sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA==", - "_location": "/cacache/mississippi/duplexify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "duplexify@^3.4.2", - "name": "duplexify", - "escapedName": "duplexify", - "rawSpec": "^3.4.2", - "saveSpec": null, - "fetchSpec": "^3.4.2" - }, - "_requiredBy": [ - "/cacache/mississippi", - "/cacache/mississippi/pumpify" - ], - "_resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.4.tgz", - "_shasum": "4bb46c1796eabebeec4ca9a2e66b808cb7a3d8b4", - "_spec": "duplexify@^3.4.2", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi", - "author": { - "name": "Mathias Buus" - }, - "bugs": { - "url": "https://github.com/mafintosh/duplexify/issues" - }, - "bundleDependencies": false, - "dependencies": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - }, - "deprecated": false, - "description": "Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input", - "devDependencies": { - "concat-stream": "^1.5.2", - "tape": "^4.0.0", - "through2": "^2.0.0" - }, - "homepage": "https://github.com/mafintosh/duplexify", - "keywords": [ - "duplex", - "streams2", - "streams", - "stream", - "writable", - "readable", - "async" - ], - "license": "MIT", - "main": "index.js", - "name": "duplexify", - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/duplexify.git" - }, - "scripts": { - "test": "tape test.js" - }, - "version": "3.5.4" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/test.js b/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/test.js deleted file mode 100644 index 4330e93cf..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/duplexify/test.js +++ /dev/null @@ -1,291 +0,0 @@ -var tape = require('tape') -var through = require('through2') -var concat = require('concat-stream') -var net = require('net') -var duplexify = require('./') - -tape('passthrough', function(t) { - t.plan(2) - - var pt = through() - var dup = duplexify(pt, pt) - - dup.end('hello world') - dup.on('finish', function() { - t.ok(true, 'should finish') - }) - dup.pipe(concat(function(data) { - t.same(data.toString(), 'hello world', 'same in as out') - })) -}) - -tape('passthrough + double end', function(t) { - t.plan(2) - - var pt = through() - var dup = duplexify(pt, pt) - - dup.end('hello world') - dup.end() - - dup.on('finish', function() { - t.ok(true, 'should finish') - }) - dup.pipe(concat(function(data) { - t.same(data.toString(), 'hello world', 'same in as out') - })) -}) - -tape('async passthrough + end', function(t) { - t.plan(2) - - var pt = through.obj({highWaterMark:1}, function(data, enc, cb) { - setTimeout(function() { - cb(null, data) - }, 100) - }) - - var dup = duplexify(pt, pt) - - dup.write('hello ') - dup.write('world') - dup.end() - - dup.on('finish', function() { - t.ok(true, 'should finish') - }) - dup.pipe(concat(function(data) { - t.same(data.toString(), 'hello world', 'same in as out') - })) -}) - -tape('duplex', function(t) { - var readExpected = ['read-a', 'read-b', 'read-c'] - var writeExpected = ['write-a', 'write-b', 'write-c'] - - t.plan(readExpected.length+writeExpected.length+2) - - var readable = through.obj() - var writable = through.obj(function(data, enc, cb) { - t.same(data, writeExpected.shift(), 'onwrite should match') - cb() - }) - - var dup = duplexify.obj(writable, readable) - - readExpected.slice().forEach(function(data) { - readable.write(data) - }) - readable.end() - - writeExpected.slice().forEach(function(data) { - dup.write(data) - }) - dup.end() - - dup.on('data', function(data) { - t.same(data, readExpected.shift(), 'ondata should match') - }) - dup.on('end', function() { - t.ok(true, 'should end') - }) - dup.on('finish', function() { - t.ok(true, 'should finish') - }) -}) - -tape('async', function(t) { - var dup = duplexify() - var pt = through() - - dup.pipe(concat(function(data) { - t.same(data.toString(), 'i was async', 'same in as out') - t.end() - })) - - dup.write('i') - dup.write(' was ') - dup.end('async') - - setTimeout(function() { - dup.setWritable(pt) - setTimeout(function() { - dup.setReadable(pt) - }, 50) - }, 50) -}) - -tape('destroy', function(t) { - t.plan(2) - - var write = through() - var read = through() - var dup = duplexify(write, read) - - write.destroy = function() { - t.ok(true, 'write destroyed') - } - - dup.on('close', function() { - t.ok(true, 'close emitted') - }) - - dup.destroy() - dup.destroy() // should only work once -}) - -tape('destroy both', function(t) { - t.plan(3) - - var write = through() - var read = through() - var dup = duplexify(write, read) - - write.destroy = function() { - t.ok(true, 'write destroyed') - } - - read.destroy = function() { - t.ok(true, 'read destroyed') - } - - dup.on('close', function() { - t.ok(true, 'close emitted') - }) - - dup.destroy() - dup.destroy() // should only work once -}) - -tape('bubble read errors', function(t) { - t.plan(2) - - var write = through() - var read = through() - var dup = duplexify(write, read) - - dup.on('error', function(err) { - t.same(err.message, 'read-error', 'received read error') - }) - dup.on('close', function() { - t.ok(true, 'close emitted') - }) - - read.emit('error', new Error('read-error')) - write.emit('error', new Error('write-error')) // only emit first error -}) - -tape('bubble write errors', function(t) { - t.plan(2) - - var write = through() - var read = through() - var dup = duplexify(write, read) - - dup.on('error', function(err) { - t.same(err.message, 'write-error', 'received write error') - }) - dup.on('close', function() { - t.ok(true, 'close emitted') - }) - - write.emit('error', new Error('write-error')) - read.emit('error', new Error('read-error')) // only emit first error -}) - -tape('reset writable / readable', function(t) { - t.plan(3) - - var toUpperCase = function(data, enc, cb) { - cb(null, data.toString().toUpperCase()) - } - - var passthrough = through() - var upper = through(toUpperCase) - var dup = duplexify(passthrough, passthrough) - - dup.once('data', function(data) { - t.same(data.toString(), 'hello') - dup.setWritable(upper) - dup.setReadable(upper) - dup.once('data', function(data) { - t.same(data.toString(), 'HELLO') - dup.once('data', function(data) { - t.same(data.toString(), 'HI') - t.end() - }) - }) - dup.write('hello') - dup.write('hi') - }) - dup.write('hello') -}) - -tape('cork', function(t) { - var passthrough = through() - var dup = duplexify(passthrough, passthrough) - var ok = false - - dup.on('prefinish', function() { - dup.cork() - setTimeout(function() { - ok = true - dup.uncork() - }, 100) - }) - dup.on('finish', function() { - t.ok(ok) - t.end() - }) - dup.end() -}) - -tape('prefinish not twice', function(t) { - var passthrough = through() - var dup = duplexify(passthrough, passthrough) - var prefinished = false - - dup.on('prefinish', function() { - t.ok(!prefinished, 'only prefinish once') - prefinished = true - }) - - dup.on('finish', function() { - t.end() - }) - - dup.end() -}) - -tape('close', function(t) { - var passthrough = through() - var dup = duplexify(passthrough, passthrough) - - passthrough.emit('close') - dup.on('close', function() { - t.ok(true, 'should forward close') - t.end() - }) -}) - -tape('works with node native streams (net)', function(t) { - t.plan(1) - - var server = net.createServer(function(socket) { - var dup = duplexify(socket, socket) - - dup.once('data', function(chunk) { - t.same(chunk, Buffer('hello world')) - server.close() - socket.end() - t.end() - }) - }) - - server.listen(0, function () { - var socket = net.connect(server.address().port) - var dup = duplexify(socket, socket) - - dup.write(Buffer('hello world')) - }) -}) diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/end-of-stream/LICENSE b/node_modules/cacache/node_modules/mississippi/node_modules/end-of-stream/LICENSE deleted file mode 100644 index 757562ec5..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/end-of-stream/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE.
\ No newline at end of file diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/end-of-stream/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/end-of-stream/README.md deleted file mode 100644 index f2560c939..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/end-of-stream/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# end-of-stream - -A node module that calls a callback when a readable/writable/duplex stream has completed or failed. - - npm install end-of-stream - -## Usage - -Simply pass a stream and a callback to the `eos`. -Both legacy streams, streams2 and stream3 are supported. - -``` js -var eos = require('end-of-stream'); - -eos(readableStream, function(err) { - // this will be set to the stream instance - if (err) return console.log('stream had an error or closed early'); - console.log('stream has ended', this === readableStream); -}); - -eos(writableStream, function(err) { - if (err) return console.log('stream had an error or closed early'); - console.log('stream has finished', this === writableStream); -}); - -eos(duplexStream, function(err) { - if (err) return console.log('stream had an error or closed early'); - console.log('stream has ended and finished', this === duplexStream); -}); - -eos(duplexStream, {readable:false}, function(err) { - if (err) return console.log('stream had an error or closed early'); - console.log('stream has finished but might still be readable'); -}); - -eos(duplexStream, {writable:false}, function(err) { - if (err) return console.log('stream had an error or closed early'); - console.log('stream has ended but might still be writable'); -}); - -eos(readableStream, {error:false}, function(err) { - // do not treat emit('error', err) as a end-of-stream -}); -``` - -## License - -MIT - -## Related - -`end-of-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/end-of-stream/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/end-of-stream/index.js deleted file mode 100644 index be426c227..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/end-of-stream/index.js +++ /dev/null @@ -1,87 +0,0 @@ -var once = require('once'); - -var noop = function() {}; - -var isRequest = function(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -}; - -var isChildProcess = function(stream) { - return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 -}; - -var eos = function(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - - callback = once(callback || noop); - - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || (opts.readable !== false && stream.readable); - var writable = opts.writable || (opts.writable !== false && stream.writable); - - var onlegacyfinish = function() { - if (!stream.writable) onfinish(); - }; - - var onfinish = function() { - writable = false; - if (!readable) callback.call(stream); - }; - - var onend = function() { - readable = false; - if (!writable) callback.call(stream); - }; - - var onexit = function(exitCode) { - callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); - }; - - var onerror = function(err) { - callback.call(stream, err); - }; - - var onclose = function() { - if (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close')); - if (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close')); - }; - - var onrequest = function() { - stream.req.on('finish', onfinish); - }; - - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest(); - else stream.on('request', onrequest); - } else if (writable && !ws) { // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - if (isChildProcess(stream)) stream.on('exit', onexit); - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - - return function() { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('exit', onexit); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -}; - -module.exports = eos; diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/end-of-stream/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/end-of-stream/package.json deleted file mode 100644 index f00849beb..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/end-of-stream/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "end-of-stream@^1.1.0", - "_id": "end-of-stream@1.4.1", - "_inBundle": false, - "_integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "_location": "/cacache/mississippi/end-of-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "end-of-stream@^1.1.0", - "name": "end-of-stream", - "escapedName": "end-of-stream", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/cacache/mississippi", - "/cacache/mississippi/duplexify", - "/cacache/mississippi/pump", - "/cacache/mississippi/stream-each" - ], - "_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "_shasum": "ed29634d19baba463b6ce6b80a37213eab71ec43", - "_spec": "end-of-stream@^1.1.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi", - "author": { - "name": "Mathias Buus", - "email": "mathiasbuus@gmail.com" - }, - "bugs": { - "url": "https://github.com/mafintosh/end-of-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "once": "^1.4.0" - }, - "deprecated": false, - "description": "Call a callback when a readable/writable/duplex stream has completed or failed.", - "files": [ - "index.js" - ], - "homepage": "https://github.com/mafintosh/end-of-stream", - "keywords": [ - "stream", - "streams", - "callback", - "finish", - "close", - "end", - "wait" - ], - "license": "MIT", - "main": "index.js", - "name": "end-of-stream", - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/end-of-stream.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.4.1" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/.npmignore b/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/.npmignore deleted file mode 100644 index 3e70011a1..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -bundle.js -test.html diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/.travis.yml b/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/.travis.yml deleted file mode 100644 index c04282170..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - '0.10' - - '0.12' - - '4.0' - - '5.0' diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/LICENSE b/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/LICENSE deleted file mode 100644 index 66a4d2a14..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/README.md deleted file mode 100644 index 7ea7b699b..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# flush-write-stream - -A write stream constructor that supports a flush function that is called before `finish` is emitted - -``` -npm install flush-write-stream -``` - -[![build status](http://img.shields.io/travis/mafintosh/flush-write-stream.svg?style=flat)](http://travis-ci.org/mafintosh/flush-write-stream) - -## Usage - -``` js -var writer = require('flush-write-stream') - -var ws = writer(write, flush) - -ws.on('finish', function () { - console.log('finished') -}) - -ws.write('hello') -ws.write('world') -ws.end() - -function write (data, enc, cb) { - // i am your normal ._write method - console.log('writing', data.toString()) - cb() -} - -function flush (cb) { - // i am called before finish is emitted - setTimeout(cb, 1000) // wait 1 sec -} -``` - -If you run the above it will produce the following output - -``` -writing hello -writing world -(nothing happens for 1 sec) -finished -``` - -## API - -#### `var ws = writer([options], write, [flush])` - -Create a new writable stream. Options are forwarded to the stream constructor. - -#### `var ws = writer.obj([options], write, [flush])` - -Same as the above except `objectMode` is set to `true` per default. - -## License - -MIT diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/example.js b/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/example.js deleted file mode 100644 index fa6b5dab2..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/example.js +++ /dev/null @@ -1,22 +0,0 @@ -var writer = require('./') - -var ws = writer(write, flush) - -ws.on('finish', function () { - console.log('finished') -}) - -ws.write('hello') -ws.write('world') -ws.end() - -function write (data, enc, cb) { - // i am your normal ._write method - console.log('writing', data.toString()) - cb() -} - -function flush (cb) { - // i am called before finish is emitted - setTimeout(cb, 1000) // wait 1 sec -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/index.js deleted file mode 100644 index e82e12612..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/index.js +++ /dev/null @@ -1,52 +0,0 @@ -var stream = require('readable-stream') -var inherits = require('inherits') - -var SIGNAL_FLUSH = new Buffer([0]) - -module.exports = WriteStream - -function WriteStream (opts, write, flush) { - if (!(this instanceof WriteStream)) return new WriteStream(opts, write, flush) - - if (typeof opts === 'function') { - flush = write - write = opts - opts = {} - } - - stream.Writable.call(this, opts) - - this.destroyed = false - this._worker = write || null - this._flush = flush || null -} - -inherits(WriteStream, stream.Writable) - -WriteStream.obj = function (opts, worker, flush) { - if (typeof opts === 'function') return WriteStream.obj(null, opts, worker) - if (!opts) opts = {} - opts.objectMode = true - return new WriteStream(opts, worker, flush) -} - -WriteStream.prototype._write = function (data, enc, cb) { - if (SIGNAL_FLUSH === data) this._flush(cb) - else this._worker(data, enc, cb) -} - -WriteStream.prototype.end = function (data, enc, cb) { - if (!this._flush) return stream.Writable.prototype.end.apply(this, arguments) - if (typeof data === 'function') return this.end(null, null, data) - if (typeof enc === 'function') return this.end(data, null, enc) - if (data) this.write(data) - if (!this._writableState.ending) this.write(SIGNAL_FLUSH) - return stream.Writable.prototype.end.call(this, cb) -} - -WriteStream.prototype.destroy = function (err) { - if (this.destroyed) return - this.destroyed = true - if (err) this.emit('error', err) - this.emit('close') -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/package.json deleted file mode 100644 index 0fc9c77ed..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "_from": "flush-write-stream@^1.0.0", - "_id": "flush-write-stream@1.0.2", - "_inBundle": false, - "_integrity": "sha1-yBuQ2HRnZvGmCaRoCZRsRd2K5Bc=", - "_location": "/cacache/mississippi/flush-write-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "flush-write-stream@^1.0.0", - "name": "flush-write-stream", - "escapedName": "flush-write-stream", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.2.tgz", - "_shasum": "c81b90d8746766f1a609a46809946c45dd8ae417", - "_spec": "flush-write-stream@^1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "bugs": { - "url": "https://github.com/mafintosh/flush-write-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.4" - }, - "deprecated": false, - "description": "A write stream constructor that supports a flush function that is called before finish is emitted", - "devDependencies": { - "tape": "^4.2.2" - }, - "homepage": "https://github.com/mafintosh/flush-write-stream", - "license": "MIT", - "main": "index.js", - "name": "flush-write-stream", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/flush-write-stream.git" - }, - "scripts": { - "test": "tape test.js" - }, - "version": "1.0.2" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/test.js b/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/test.js deleted file mode 100644 index 6cd0c20e1..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/test.js +++ /dev/null @@ -1,85 +0,0 @@ -var tape = require('tape') -var writer = require('./') - -tape('is a write stream', function (t) { - var expected = ['hello', 'world', 'verden'] - var ws = writer.obj(write) - - ws.write('hello') - ws.write('world') - ws.write('verden') - ws.end(function () { - t.same(expected.length, 0) - t.end() - }) - - function write (data, enc, cb) { - t.same(data, expected.shift()) - cb() - } -}) - -tape('is flushable', function (t) { - var expected = ['hello', 'world', 'verden'] - var flushed = false - - var ws = writer.obj(write, flush) - - ws.write('hello') - ws.write('world') - ws.write('verden') - ws.end(function () { - t.same(expected.length, 0) - t.ok(flushed, 'was flushed') - t.end() - }) - - function write (data, enc, cb) { - t.same(data, expected.shift()) - cb() - } - - function flush (cb) { - flushed = true - process.nextTick(cb) - } -}) - -tape('can pass options', function (t) { - var expected = ['hello', 'world', 'verden'] - var flushed = false - - var ws = writer({objectMode: true}, write, flush) - - ws.write('hello') - ws.write('world') - ws.write('verden') - ws.end(function () { - t.same(expected.length, 0) - t.ok(flushed, 'was flushed') - t.end() - }) - - function write (data, enc, cb) { - t.same(data, expected.shift()) - cb() - } - - function flush (cb) { - flushed = true - process.nextTick(cb) - } -}) - -tape('emits error on destroy', function (t) { - var expected = new Error() - - var ws = writer({objectMode: true}, function () {}) - - ws.on('error', function (err) { - t.equal(err, expected) - }) - ws.on('close', t.end) - - ws.destroy(expected) -}) diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/from2/.travis.yml b/node_modules/cacache/node_modules/mississippi/node_modules/from2/.travis.yml deleted file mode 100644 index b03ffabca..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/from2/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -before_install: - - npm install -g npm -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/from2/LICENSE.md b/node_modules/cacache/node_modules/mississippi/node_modules/from2/LICENSE.md deleted file mode 100644 index 146cb32a7..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/from2/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -## The MIT License (MIT) ## - -Copyright (c) 2014 Hugh Kennedy - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/from2/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/from2/README.md deleted file mode 100644 index 3e041a412..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/from2/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# from2 [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/from2&title=from2&description=hughsk/from2%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) # - -`from2` is a high-level module for creating readable streams that properly handle backpressure. - -Convience wrapper for -[readable-stream](http://github.com/isaacs/readable-stream)'s `ReadableStream` -base class, with an API lifted from -[from](http://github.com/dominictarr/from) and -[through2](http://github.com/rvagg/through2). - -## Usage ## - -[![from2](https://nodei.co/npm/from2.png?mini=true)](https://nodei.co/npm/from2) - -### `stream = from2([opts], read)` ### - -Where `opts` are the options to pass on to the `ReadableStream` constructor, -and `read(size, next)` is called when data is requested from the stream. - -* `size` is the recommended amount of data (in bytes) to retrieve. -* `next(err)` should be called when you're ready to emit more data. - -For example, here's a readable stream that emits the contents of a given -string: - -``` javascript -var from = require('from2') - -function fromString(string) { - return from(function(size, next) { - // if there's no more content - // left in the string, close the stream. - if (string.length <= 0) return next(null, null) - - // Pull in a new chunk of text, - // removing it from the string. - var chunk = string.slice(0, size) - string = string.slice(size) - - // Emit "chunk" from the stream. - next(null, chunk) - }) -} - -// pipe "hello world" out -// to stdout. -fromString('hello world').pipe(process.stdout) -``` - -### `stream = from2.obj([opts], read)` ### - -Shorthand for `from2({ objectMode: true }, read)`. - -### `createStream = from2.ctor([opts], read)` ### - -If you're creating similar streams in quick succession you can improve -performance by generating a stream **constructor** that you can reuse instead -of creating one-off streams on each call. - -Takes the same options as `from2`, instead returning a constructor which you -can use to create new streams. - -### See Also - -- [from2-array](https://github.com/binocarlos/from2-array) - Create a from2 stream based on an array of source values. -- [from2-string](https://github.com/yoshuawuyts/from2-string) - Create a stream from a string. Sugary wrapper around from2. - -## License ## - -MIT. See [LICENSE.md](http://github.com/hughsk/from2/blob/master/LICENSE.md) for details. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/from2/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/from2/index.js deleted file mode 100644 index cb200c610..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/from2/index.js +++ /dev/null @@ -1,103 +0,0 @@ -var Readable = require('readable-stream').Readable -var inherits = require('inherits') - -module.exports = from2 - -from2.ctor = ctor -from2.obj = obj - -var Proto = ctor() - -function toFunction(list) { - list = list.slice() - return function (_, cb) { - var err = null - var item = list.length ? list.shift() : null - if (item instanceof Error) { - err = item - item = null - } - - cb(err, item) - } -} - -function from2(opts, read) { - if (typeof opts !== 'object' || Array.isArray(opts)) { - read = opts - opts = {} - } - - var rs = new Proto(opts) - rs._from = Array.isArray(read) ? toFunction(read) : (read || noop) - return rs -} - -function ctor(opts, read) { - if (typeof opts === 'function') { - read = opts - opts = {} - } - - opts = defaults(opts) - - inherits(Class, Readable) - function Class(override) { - if (!(this instanceof Class)) return new Class(override) - this._reading = false - this._callback = check - this.destroyed = false - Readable.call(this, override || opts) - - var self = this - var hwm = this._readableState.highWaterMark - - function check(err, data) { - if (self.destroyed) return - if (err) return self.destroy(err) - if (data === null) return self.push(null) - self._reading = false - if (self.push(data)) self._read(hwm) - } - } - - Class.prototype._from = read || noop - Class.prototype._read = function(size) { - if (this._reading || this.destroyed) return - this._reading = true - this._from(size, this._callback) - } - - Class.prototype.destroy = function(err) { - if (this.destroyed) return - this.destroyed = true - - var self = this - process.nextTick(function() { - if (err) self.emit('error', err) - self.emit('close') - }) - } - - return Class -} - -function obj(opts, read) { - if (typeof opts === 'function' || Array.isArray(opts)) { - read = opts - opts = {} - } - - opts = defaults(opts) - opts.objectMode = true - opts.highWaterMark = 16 - - return from2(opts, read) -} - -function noop () {} - -function defaults(opts) { - opts = opts || {} - return opts -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/from2/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/from2/package.json deleted file mode 100644 index ff6f879e3..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/from2/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "from2@^2.1.0", - "_id": "from2@2.3.0", - "_inBundle": false, - "_integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "_location": "/cacache/mississippi/from2", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "from2@^2.1.0", - "name": "from2", - "escapedName": "from2", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "_shasum": "8bfb5502bde4a4d36cfdeea007fcca21d7e382af", - "_spec": "from2@^2.1.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi", - "author": { - "name": "Hugh Kennedy", - "email": "hughskennedy@gmail.com", - "url": "http://hughsk.io/" - }, - "bugs": { - "url": "https://github.com/hughsk/from2/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Mathias Buus", - "email": "mathiasbuus@gmail.com" - } - ], - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - }, - "deprecated": false, - "description": "Convenience wrapper for ReadableStream, with an API lifted from \"from\" and \"through2\"", - "devDependencies": { - "tape": "^4.0.0" - }, - "homepage": "https://github.com/hughsk/from2", - "keywords": [ - "from", - "stream", - "readable", - "pull", - "convenience", - "wrapper" - ], - "license": "MIT", - "main": "index.js", - "name": "from2", - "repository": { - "type": "git", - "url": "git://github.com/hughsk/from2.git" - }, - "scripts": { - "test": "node test" - }, - "version": "2.3.0" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/from2/test.js b/node_modules/cacache/node_modules/mississippi/node_modules/from2/test.js deleted file mode 100644 index b11bd6cd8..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/from2/test.js +++ /dev/null @@ -1,123 +0,0 @@ -var test = require('tape') -var path = require('path') -var from = require('./') -var fs = require('fs') - -var tmp = path.resolve( - __dirname, 'tmp.txt' -) - -function fromString(string) { - return from(function(size, next) { - if (string.length <= 0) return next(null, null) - var chunk = string.slice(0, size) - string = string.slice(size) - next(null, chunk) - }) -} - -test('from2', function(t) { - var contents = fs.readFileSync(__filename, 'utf8') - var stream = fromString(contents) - - stream - .pipe(fs.createWriteStream(tmp)) - .on('close', function() { - t.equal(fs.readFileSync(tmp, 'utf8'), contents) - fs.unlinkSync(tmp) - t.end() - }) -}) - -test('old mode', function(t) { - var contents = fs.readFileSync(__filename, 'utf8') - var stream = fromString(contents) - var buffer = '' - - stream.on('data', function(data) { - buffer += data - }).on('end', function() { - t.equal(buffer, contents) - t.end() - }) -}) - -test('destroy', function(t) { - var stream = from(function(size, next) { - process.nextTick(function() { - next(null, 'no') - }) - }) - - stream.on('data', function(data) { - t.ok(false) - }).on('close', function() { - t.ok(true) - t.end() - }) - - stream.destroy() -}) - -test('arrays', function (t) { - var input = ['a', 'b', 'c'] - var stream = from(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter.toString()) - }) - stream.on('end', function () { - t.deepEqual(input, output) - t.end() - }) -}) - -test('obj arrays', function (t) { - var input = [{foo:'a'}, {foo:'b'}, {foo:'c'}] - var stream = from.obj(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter) - }) - stream.on('end', function () { - t.deepEqual(input, output) - t.end() - }) -}) - - -test('arrays can emit errors', function (t) { - var input = ['a', 'b', new Error('ooops'), 'c'] - var stream = from(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter.toString()) - }) - stream.on('error', function(e){ - t.deepEqual(['a', 'b'], output) - t.equal('ooops', e.message) - t.end() - }) - stream.on('end', function () { - t.fail('the stream should have errored') - }) -}) - -test('obj arrays can emit errors', function (t) { - var input = [{foo:'a'}, {foo:'b'}, new Error('ooops'), {foo:'c'}] - var stream = from.obj(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter) - }) - stream.on('error', function(e){ - t.deepEqual([{foo:'a'}, {foo:'b'}], output) - t.equal('ooops', e.message) - t.end() - }) - stream.on('end', function () { - t.fail('the stream should have errored') - }) -}) - - diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/.npmignore b/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/.npmignore deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/LICENSE b/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/LICENSE deleted file mode 100644 index 4b30ed5d9..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2013 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/README.md deleted file mode 100644 index f53e13084..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# parallel-transform - -[Transform stream](http://nodejs.org/api/stream.html#stream_class_stream_transform_1) for Node.js that allows you to run your transforms -in parallel without changing the order of the output. - - npm install parallel-transform - -It is easy to use - -``` js -var transform = require('parallel-transform'); - -var stream = transform(10, function(data, callback) { // 10 is the parallism level - setTimeout(function() { - callback(null, data); - }, Math.random() * 1000); -}); - -for (var i = 0; i < 10; i++) { - stream.write(''+i); -} -stream.end(); - -stream.on('data', function(data) { - console.log(data); // prints 0,1,2,... -}); -stream.on('end', function() { - console.log('stream has ended'); -}); -``` - -If you run the above example you'll notice that it runs in parallel -(does not take ~1 second between each print) and that the order is preserved - -## Stream options - -All transforms are Node 0.10 streams. Per default they are created with the options `{objectMode:true}`. -If you want to use your own stream options pass them as the second parameter - -``` js -var stream = transform(10, {objectMode:false}, function(data, callback) { - // data is now a buffer - callback(null, data); -}); - -fs.createReadStream('filename').pipe(stream).pipe(process.stdout); -``` - -### Unordered -Passing the option `{ordered:false}` will output the data as soon as it's processed by a transform, without waiting to respect the order. - -## License - -MIT
\ No newline at end of file diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/index.js deleted file mode 100644 index 77329e4cc..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/index.js +++ /dev/null @@ -1,105 +0,0 @@ -var Transform = require('readable-stream').Transform; -var inherits = require('inherits'); -var cyclist = require('cyclist'); -var util = require('util'); - -var ParallelTransform = function(maxParallel, opts, ontransform) { - if (!(this instanceof ParallelTransform)) return new ParallelTransform(maxParallel, opts, ontransform); - - if (typeof maxParallel === 'function') { - ontransform = maxParallel; - opts = null; - maxParallel = 1; - } - if (typeof opts === 'function') { - ontransform = opts; - opts = null; - } - - if (!opts) opts = {}; - if (!opts.highWaterMark) opts.highWaterMark = Math.max(maxParallel, 16); - if (opts.objectMode !== false) opts.objectMode = true; - - Transform.call(this, opts); - - this._maxParallel = maxParallel; - this._ontransform = ontransform; - this._destroyed = false; - this._flushed = false; - this._ordered = opts.ordered !== false; - this._buffer = this._ordered ? cyclist(maxParallel) : []; - this._top = 0; - this._bottom = 0; - this._ondrain = null; -}; - -inherits(ParallelTransform, Transform); - -ParallelTransform.prototype.destroy = function() { - if (this._destroyed) return; - this._destroyed = true; - this.emit('close'); -}; - -ParallelTransform.prototype._transform = function(chunk, enc, callback) { - var self = this; - var pos = this._top++; - - this._ontransform(chunk, function(err, data) { - if (self._destroyed) return; - if (err) { - self.emit('error', err); - self.push(null); - self.destroy(); - return; - } - if (self._ordered) { - self._buffer.put(pos, (data === undefined || data === null) ? null : data); - } - else { - self._buffer.push(data); - } - self._drain(); - }); - - if (this._top - this._bottom < this._maxParallel) return callback(); - this._ondrain = callback; -}; - -ParallelTransform.prototype._flush = function(callback) { - this._flushed = true; - this._ondrain = callback; - this._drain(); -}; - -ParallelTransform.prototype._drain = function() { - if (this._ordered) { - while (this._buffer.get(this._bottom) !== undefined) { - var data = this._buffer.del(this._bottom++); - if (data === null) continue; - this.push(data); - } - } - else { - while (this._buffer.length > 0) { - var data = this._buffer.pop(); - this._bottom++; - if (data === null) continue; - this.push(data); - } - } - - - if (!this._drained() || !this._ondrain) return; - - var ondrain = this._ondrain; - this._ondrain = null; - ondrain(); -}; - -ParallelTransform.prototype._drained = function() { - var diff = this._top - this._bottom; - return this._flushed ? !diff : diff < this._maxParallel; -}; - -module.exports = ParallelTransform; diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/.npmignore b/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/.npmignore deleted file mode 100644 index ba99195ba..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/.npmignore +++ /dev/null @@ -1 +0,0 @@ -bench diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/README.md deleted file mode 100644 index 50c35cc5f..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Cyclist - -Cyclist is an efficient [cyclic list](http://en.wikipedia.org/wiki/Circular_buffer) implemention for Javascript. -It is available through npm - - npm install cyclist - -## What? - -Cyclist allows you to create a list of fixed size that is cyclic. -In a cyclist list the element following the last one is the first one. -This property can be really useful when for example trying to order data -packets that can arrive out of order over a network stream. - -## Usage - -``` js -var cyclist = require('cyclist'); -var list = cyclist(4); // if size (4) is not a power of 2 it will be the follwing power of 2 - // this buffer can now hold 4 elements in total - -list.put(42, 'hello 42'); // store something and index 42 -list.put(43, 'hello 43'); // store something and index 43 - -console.log(list.get(42)); // prints hello 42 -console.log(list.get(46)); // prints hello 42 again since 46 - 42 == list.size -``` - -## API - -* `cyclist(size)` creates a new buffer -* `cyclist#get(index)` get an object stored in the buffer -* `cyclist#put(index,value)` insert an object into the buffer -* `cyclist#del(index)` delete an object from an index -* `cyclist#size` property containing current size of buffer - -## License - -MIT diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/index.js deleted file mode 100644 index baf710c3a..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/index.js +++ /dev/null @@ -1,33 +0,0 @@ -var ensureTwoPower = function(n) { - if (n && !(n & (n - 1))) return n; - var p = 1; - while (p < n) p <<= 1; - return p; -}; - -var Cyclist = function(size) { - if (!(this instanceof Cyclist)) return new Cyclist(size); - size = ensureTwoPower(size); - this.mask = size-1; - this.size = size; - this.values = new Array(size); -}; - -Cyclist.prototype.put = function(index, val) { - var pos = index & this.mask; - this.values[pos] = val; - return pos; -}; - -Cyclist.prototype.get = function(index) { - return this.values[index & this.mask]; -}; - -Cyclist.prototype.del = function(index) { - var pos = index & this.mask; - var val = this.values[pos]; - this.values[pos] = undefined; - return val; -}; - -module.exports = Cyclist;
\ No newline at end of file diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/package.json deleted file mode 100644 index aa45e955d..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "_from": "cyclist@~0.2.2", - "_id": "cyclist@0.2.2", - "_inBundle": false, - "_integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", - "_location": "/cacache/mississippi/parallel-transform/cyclist", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "cyclist@~0.2.2", - "name": "cyclist", - "escapedName": "cyclist", - "rawSpec": "~0.2.2", - "saveSpec": null, - "fetchSpec": "~0.2.2" - }, - "_requiredBy": [ - "/cacache/mississippi/parallel-transform" - ], - "_resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", - "_shasum": "1b33792e11e914a2fd6d6ed6447464444e5fa640", - "_spec": "cyclist@~0.2.2", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform", - "author": { - "name": "Mathias Buus Madsen", - "email": "mathiasbuus@gmail.com" - }, - "bugs": { - "url": "https://github.com/mafintosh/cyclist/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Cyclist is an efficient cyclic list implemention.", - "homepage": "https://github.com/mafintosh/cyclist#readme", - "keywords": [ - "circular", - "buffer", - "ring", - "cyclic", - "data" - ], - "name": "cyclist", - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/cyclist.git" - }, - "version": "0.2.2" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/package.json deleted file mode 100644 index f3d04cc93..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/parallel-transform/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "_from": "parallel-transform@^1.1.0", - "_id": "parallel-transform@1.1.0", - "_inBundle": false, - "_integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", - "_location": "/cacache/mississippi/parallel-transform", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "parallel-transform@^1.1.0", - "name": "parallel-transform", - "escapedName": "parallel-transform", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", - "_shasum": "d410f065b05da23081fcd10f28854c29bda33b06", - "_spec": "parallel-transform@^1.1.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi", - "author": { - "name": "Mathias Buus Madsen", - "email": "mathiasbuus@gmail.com" - }, - "bugs": { - "url": "https://github.com/mafintosh/parallel-transform/issues" - }, - "bundleDependencies": false, - "dependencies": { - "cyclist": "~0.2.2", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - }, - "deprecated": false, - "description": "Transform stream that allows you to run your transforms in parallel without changing the order", - "homepage": "https://github.com/mafintosh/parallel-transform#readme", - "keywords": [ - "transform", - "stream", - "parallel", - "preserve", - "order" - ], - "license": "MIT", - "name": "parallel-transform", - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/parallel-transform.git" - }, - "version": "1.1.0" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pump/.travis.yml b/node_modules/cacache/node_modules/mississippi/node_modules/pump/.travis.yml deleted file mode 100644 index 17f94330e..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pump/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.10" - -script: "npm test" diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pump/LICENSE b/node_modules/cacache/node_modules/mississippi/node_modules/pump/LICENSE deleted file mode 100644 index 757562ec5..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pump/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE.
\ No newline at end of file diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pump/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/pump/README.md deleted file mode 100644 index 5029b27d6..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pump/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# pump - -pump is a small node module that pipes streams together and destroys all of them if one of them closes. - -``` -npm install pump -``` - -[![build status](http://img.shields.io/travis/mafintosh/pump.svg?style=flat)](http://travis-ci.org/mafintosh/pump) - -## What problem does it solve? - -When using standard `source.pipe(dest)` source will _not_ be destroyed if dest emits close or an error. -You are also not able to provide a callback to tell when then pipe has finished. - -pump does these two things for you - -## Usage - -Simply pass the streams you want to pipe together to pump and add an optional callback - -``` js -var pump = require('pump') -var fs = require('fs') - -var source = fs.createReadStream('/dev/random') -var dest = fs.createWriteStream('/dev/null') - -pump(source, dest, function(err) { - console.log('pipe finished', err) -}) - -setTimeout(function() { - dest.destroy() // when dest is closed pump will destroy source -}, 1000) -``` - -You can use pump to pipe more than two streams together as well - -``` js -var transform = someTransformStream() - -pump(source, transform, anotherTransform, dest, function(err) { - console.log('pipe finished', err) -}) -``` - -If `source`, `transform`, `anotherTransform` or `dest` closes all of them will be destroyed. - -## License - -MIT - -## Related - -`pump` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pump/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/pump/index.js deleted file mode 100644 index d9ca0335c..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pump/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var once = require('once') -var eos = require('end-of-stream') -var fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes - -var noop = function () {} -var ancient = /^v?\.0/.test(process.version) - -var isFn = function (fn) { - return typeof fn === 'function' -} - -var isFS = function (stream) { - if (!ancient) return false // newer node version do not need to care about fs is a special way - if (!fs) return false // browser - return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) -} - -var isRequest = function (stream) { - return stream.setHeader && isFn(stream.abort) -} - -var destroyer = function (stream, reading, writing, callback) { - callback = once(callback) - - var closed = false - stream.on('close', function () { - closed = true - }) - - eos(stream, {readable: reading, writable: writing}, function (err) { - if (err) return callback(err) - closed = true - callback() - }) - - var destroyed = false - return function (err) { - if (closed) return - if (destroyed) return - destroyed = true - - if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks - if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want - - if (isFn(stream.destroy)) return stream.destroy() - - callback(err || new Error('stream was destroyed')) - } -} - -var call = function (fn) { - fn() -} - -var pipe = function (from, to) { - return from.pipe(to) -} - -var pump = function () { - var streams = Array.prototype.slice.call(arguments) - var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop - - if (Array.isArray(streams[0])) streams = streams[0] - if (streams.length < 2) throw new Error('pump requires two streams per minimum') - - var error - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1 - var writing = i > 0 - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err - if (err) destroys.forEach(call) - if (reading) return - destroys.forEach(call) - callback(error) - }) - }) - - streams.reduce(pipe) -} - -module.exports = pump diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pump/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/pump/package.json deleted file mode 100644 index 5839908b0..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pump/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_from": "pump@^2.0.1", - "_id": "pump@2.0.1", - "_inBundle": false, - "_integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "_location": "/cacache/mississippi/pump", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pump@^2.0.1", - "name": "pump", - "escapedName": "pump", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "/cacache/mississippi", - "/cacache/mississippi/pumpify" - ], - "_resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "_shasum": "12399add6e4cf7526d973cbc8b5ce2e2908b3909", - "_spec": "pump@^2.0.1", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi", - "author": { - "name": "Mathias Buus Madsen", - "email": "mathiasbuus@gmail.com" - }, - "browser": { - "fs": false - }, - "bugs": { - "url": "https://github.com/mafintosh/pump/issues" - }, - "bundleDependencies": false, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - }, - "deprecated": false, - "description": "pipe streams together and close all of them if one of them closes", - "homepage": "https://github.com/mafintosh/pump#readme", - "keywords": [ - "streams", - "pipe", - "destroy", - "callback" - ], - "license": "MIT", - "name": "pump", - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/pump.git" - }, - "scripts": { - "test": "node test-browser.js && node test-node.js" - }, - "version": "2.0.1" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pump/test-browser.js b/node_modules/cacache/node_modules/mississippi/node_modules/pump/test-browser.js deleted file mode 100644 index 75ea4a292..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pump/test-browser.js +++ /dev/null @@ -1,62 +0,0 @@ -var stream = require('stream') -var pump = require('./index') - -var rs = new stream.Readable() -var ws = new stream.Writable() - -rs._read = function (size) { - this.push(Buffer(size).fill('abc')) -} - -ws._write = function (chunk, encoding, cb) { - setTimeout(function () { - cb() - }, 100) -} - -var toHex = function () { - var reverse = new (require('stream').Transform)() - - reverse._transform = function (chunk, enc, callback) { - reverse.push(chunk.toString('hex')) - callback() - } - - return reverse -} - -var wsClosed = false -var rsClosed = false -var callbackCalled = false - -var check = function () { - if (wsClosed && rsClosed && callbackCalled) { - console.log('test-browser.js passes') - clearTimeout(timeout) - } -} - -ws.on('finish', function () { - wsClosed = true - check() -}) - -rs.on('end', function () { - rsClosed = true - check() -}) - -pump(rs, toHex(), toHex(), toHex(), ws, function () { - callbackCalled = true - check() -}) - -setTimeout(function () { - rs.push(null) - rs.emit('close') -}, 1000) - -var timeout = setTimeout(function () { - check() - throw new Error('timeout') -}, 5000) diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pump/test-node.js b/node_modules/cacache/node_modules/mississippi/node_modules/pump/test-node.js deleted file mode 100644 index 034a65414..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pump/test-node.js +++ /dev/null @@ -1,53 +0,0 @@ -var pump = require('./index') - -var rs = require('fs').createReadStream('/dev/random') -var ws = require('fs').createWriteStream('/dev/null') - -var toHex = function () { - var reverse = new (require('stream').Transform)() - - reverse._transform = function (chunk, enc, callback) { - reverse.push(chunk.toString('hex')) - callback() - } - - return reverse -} - -var wsClosed = false -var rsClosed = false -var callbackCalled = false - -var check = function () { - if (wsClosed && rsClosed && callbackCalled) { - console.log('test-node.js passes') - clearTimeout(timeout) - } -} - -ws.on('close', function () { - wsClosed = true - check() -}) - -rs.on('close', function () { - rsClosed = true - check() -}) - -var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { - callbackCalled = true - check() -}) - -if (res) { - process.exit(1) -} - -setTimeout(function () { - rs.destroy() -}, 1000) - -var timeout = setTimeout(function () { - throw new Error('timeout') -}, 5000) diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/.travis.yml b/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/.travis.yml deleted file mode 100644 index 32e71a6b5..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js - -node_js: - - "0.10" - - "4" - - "5" - -sudo: false diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/LICENSE b/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/LICENSE deleted file mode 100644 index 757562ec5..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE.
\ No newline at end of file diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/README.md deleted file mode 100644 index 4988f7b12..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# pumpify - -Combine an array of streams into a single duplex stream using [pump](https://github.com/mafintosh/pump) and [duplexify](https://github.com/mafintosh/duplexify). -If one of the streams closes/errors all streams in the pipeline will be destroyed. - -``` -npm install pumpify -``` - -[![build status](http://img.shields.io/travis/mafintosh/pumpify.svg?style=flat)](http://travis-ci.org/mafintosh/pumpify) - -## Usage - -Pass the streams you want to pipe together to pumpify `pipeline = pumpify(s1, s2, s3, ...)`. -`pipeline` is a duplex stream that writes to the first streams and reads from the last one. -Streams are piped together using [pump](https://github.com/mafintosh/pump) so if one of them closes -all streams will be destroyed. - -``` js -var pumpify = require('pumpify') -var tar = require('tar-fs') -var zlib = require('zlib') -var fs = require('fs') - -var untar = pumpify(zlib.createGunzip(), tar.extract('output-folder')) -// you can also pass an array instead -// var untar = pumpify([zlib.createGunzip(), tar.extract('output-folder')]) - -fs.createReadStream('some-gzipped-tarball.tgz').pipe(untar) -``` - -If you are pumping object streams together use `pipeline = pumpify.obj(s1, s2, ...)`. -Call `pipeline.destroy()` to destroy the pipeline (including the streams passed to pumpify). - -### Using `setPipeline(s1, s2, ...)` - -Similar to [duplexify](https://github.com/mafintosh/duplexify) you can also define the pipeline asynchronously using `setPipeline(s1, s2, ...)` - -``` js -var untar = pumpify() - -setTimeout(function() { - // will start draining the input now - untar.setPipeline(zlib.createGunzip(), tar.extract('output-folder')) -}, 1000) - -fs.createReadStream('some-gzipped-tarball.tgz').pipe(untar) -``` - -## License - -MIT - -## Related - -`pumpify` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/index.js deleted file mode 100644 index 45bb987e8..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/index.js +++ /dev/null @@ -1,56 +0,0 @@ -var pump = require('pump') -var inherits = require('inherits') -var Duplexify = require('duplexify') - -var toArray = function(args) { - if (!args.length) return [] - return Array.isArray(args[0]) ? args[0] : Array.prototype.slice.call(args) -} - -var define = function(opts) { - var Pumpify = function() { - var streams = toArray(arguments) - if (!(this instanceof Pumpify)) return new Pumpify(streams) - Duplexify.call(this, null, null, opts) - if (streams.length) this.setPipeline(streams) - } - - inherits(Pumpify, Duplexify) - - Pumpify.prototype.setPipeline = function() { - var streams = toArray(arguments) - var self = this - var ended = false - var w = streams[0] - var r = streams[streams.length-1] - - r = r.readable ? r : null - w = w.writable ? w : null - - var onclose = function() { - streams[0].emit('error', new Error('stream was destroyed')) - } - - this.on('close', onclose) - this.on('prefinish', function() { - if (!ended) self.cork() - }) - - pump(streams, function(err) { - self.removeListener('close', onclose) - if (err) return self.destroy(err) - ended = true - self.uncork() - }) - - if (this.destroyed) return onclose() - this.setWritable(w) - this.setReadable(r) - } - - return Pumpify -} - -module.exports = define({destroy:false}) -module.exports.obj = define({destroy:false, objectMode:true, highWaterMark:16}) -module.exports.ctor = define diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/package.json deleted file mode 100644 index a678869bc..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "pumpify@^1.3.3", - "_id": "pumpify@1.4.0", - "_inBundle": false, - "_integrity": "sha512-2kmNR9ry+Pf45opRVirpNuIFotsxUGLaYqxIwuR77AYrYRMuFCz9eryHBS52L360O+NcR383CL4QYlMKPq4zYA==", - "_location": "/cacache/mississippi/pumpify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pumpify@^1.3.3", - "name": "pumpify", - "escapedName": "pumpify", - "rawSpec": "^1.3.3", - "saveSpec": null, - "fetchSpec": "^1.3.3" - }, - "_requiredBy": [ - "/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.4.0.tgz", - "_shasum": "80b7c5df7e24153d03f0e7ac8a05a5d068bd07fb", - "_spec": "pumpify@^1.3.3", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi", - "author": { - "name": "Mathias Buus" - }, - "bugs": { - "url": "https://github.com/mafintosh/pumpify/issues" - }, - "bundleDependencies": false, - "dependencies": { - "duplexify": "^3.5.3", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "deprecated": false, - "description": "Combine an array of streams into a single duplex stream using pump and duplexify", - "devDependencies": { - "tape": "^4.8.0", - "through2": "^2.0.3" - }, - "homepage": "https://github.com/mafintosh/pumpify", - "keywords": [ - "pump", - "duplexify", - "duplex", - "streams", - "stream", - "pipeline", - "combine" - ], - "license": "MIT", - "main": "index.js", - "name": "pumpify", - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/pumpify.git" - }, - "scripts": { - "test": "tape test.js" - }, - "version": "1.4.0" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/test.js b/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/test.js deleted file mode 100644 index de6b16e34..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/pumpify/test.js +++ /dev/null @@ -1,181 +0,0 @@ -var tape = require('tape') -var through = require('through2') -var pumpify = require('./') -var stream = require('stream') - -tape('basic', function(t) { - t.plan(3) - - var pipeline = pumpify( - through(function(data, enc, cb) { - t.same(data.toString(), 'hello') - cb(null, data.toString().toUpperCase()) - }), - through(function(data, enc, cb) { - t.same(data.toString(), 'HELLO') - cb(null, data.toString().toLowerCase()) - }) - ) - - pipeline.write('hello') - pipeline.on('data', function(data) { - t.same(data.toString(), 'hello') - t.end() - }) -}) - -tape('3 times', function(t) { - t.plan(4) - - var pipeline = pumpify( - through(function(data, enc, cb) { - t.same(data.toString(), 'hello') - cb(null, data.toString().toUpperCase()) - }), - through(function(data, enc, cb) { - t.same(data.toString(), 'HELLO') - cb(null, data.toString().toLowerCase()) - }), - through(function(data, enc, cb) { - t.same(data.toString(), 'hello') - cb(null, data.toString().toUpperCase()) - }) - ) - - pipeline.write('hello') - pipeline.on('data', function(data) { - t.same(data.toString(), 'HELLO') - t.end() - }) -}) - -tape('destroy', function(t) { - var test = through() - test.destroy = function() { - t.ok(true) - t.end() - } - - var pipeline = pumpify(through(), test) - - pipeline.destroy() -}) - -tape('close', function(t) { - var test = through() - var pipeline = pumpify(through(), test) - - pipeline.on('error', function(err) { - t.same(err.message, 'lol') - t.end() - }) - - test.emit('error', new Error('lol')) -}) - -tape('end waits for last one', function(t) { - var ran = false - - var a = through() - var b = through() - var c = through(function(data, enc, cb) { - setTimeout(function() { - ran = true - cb() - }, 100) - }) - - var pipeline = pumpify(a, b, c) - - pipeline.write('foo') - pipeline.end(function() { - t.ok(ran) - t.end() - }) - - t.ok(!ran) -}) - -tape('always wait for finish', function(t) { - var a = new stream.Readable() - a._read = function() {} - a.push('hello') - - var pipeline = pumpify(a, through(), through()) - var ran = false - - pipeline.on('finish', function() { - t.ok(ran) - t.end() - }) - - setTimeout(function() { - ran = true - a.push(null) - }, 100) -}) - -tape('async', function(t) { - var pipeline = pumpify() - - t.plan(4) - - pipeline.write('hello') - pipeline.on('data', function(data) { - t.same(data.toString(), 'HELLO') - t.end() - }) - - setTimeout(function() { - pipeline.setPipeline( - through(function(data, enc, cb) { - t.same(data.toString(), 'hello') - cb(null, data.toString().toUpperCase()) - }), - through(function(data, enc, cb) { - t.same(data.toString(), 'HELLO') - cb(null, data.toString().toLowerCase()) - }), - through(function(data, enc, cb) { - t.same(data.toString(), 'hello') - cb(null, data.toString().toUpperCase()) - }) - ) - }, 100) -}) - -tape('early destroy', function(t) { - var a = through() - var b = through() - var c = through() - - b.destroy = function() { - t.ok(true) - t.end() - } - - var pipeline = pumpify() - - pipeline.destroy() - setTimeout(function() { - pipeline.setPipeline(a, b, c) - }, 100) -}) - -tape('preserves error', function (t) { - var a = through() - var b = through(function (data, enc, cb) { - cb(new Error('stop')) - }) - var c = through() - var s = pumpify() - - s.on('error', function (err) { - t.same(err.message, 'stop') - t.end() - }) - - s.setPipeline(a, b, c) - s.resume() - s.write('hi') -}) diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/.npmignore b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/.npmignore deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/.travis.yml b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/.travis.yml deleted file mode 100644 index aa89858a8..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - '0.10' - - '0.12' - - 'stable' diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/LICENSE b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/LICENSE deleted file mode 100644 index 66a4d2a14..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/README.md deleted file mode 100644 index e0832d55b..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# stream-each - -Iterate all the data in a stream - -``` -npm install stream-each -``` - -[![build status](http://img.shields.io/travis/mafintosh/stream-each.svg?style=flat)](http://travis-ci.org/mafintosh/stream-each) - -## Usage - -``` js -var each = require('stream-each') - -each(stream, function (data, next) { - console.log('data from stream', data) - // when ready to consume next chunk - next() -}, function (err) { - console.log('no more data') -}) -``` - -## API - -#### `each(stream, iterator, cb)` - -Iterate the data in the stream by calling the iterator function with `(data, next)` -where data is a data chunk and next is a callback. Call next when you are ready to -consume the next chunk. Optionally you can call next with an error to destroy the stream - -When the stream ends/errors the callback is called if provided - -## License - -MIT - -## Related - -`stream-each` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/collaborators.md b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/collaborators.md deleted file mode 100644 index fc16de25f..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/collaborators.md +++ /dev/null @@ -1,7 +0,0 @@ -## Collaborators - -stream-each is only possible due to the excellent work of the following collaborators: - -<table><tbody><tr><th align="left">maxogden</th><td><a href="https://github.com/maxogden">GitHub/maxogden</a></td></tr> -<tr><th align="left">mafintosh</th><td><a href="https://github.com/mafintosh">GitHub/mafintosh</a></td></tr> -</tbody></table> diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/index.js deleted file mode 100644 index 7e67f7337..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/index.js +++ /dev/null @@ -1,58 +0,0 @@ -var eos = require('end-of-stream') -var shift = require('stream-shift') - -module.exports = each - -function each (stream, fn, cb) { - var want = true - var error = null - var ended = false - var running = false - var calling = false - - stream.on('readable', onreadable) - onreadable() - - if (cb) eos(stream, {readable: true, writable: false}, done) - return stream - - function done (err) { - if (!error) error = err - ended = true - if (!running) cb(error) - } - - function onreadable () { - if (want) read() - } - - function afterRead (err) { - running = false - - if (err) { - error = err - if (ended) return cb(error) - stream.destroy(err) - return - } - if (ended) return cb(error) - if (!calling) read() - } - - function read () { - while (!running && !ended) { - want = false - - var data = shift(stream) - if (data === null) { - want = true - return - } - - running = true - calling = true - fn(data, afterRead) - calling = false - } - } -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/.npmignore b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/.npmignore deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/.travis.yml b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/.travis.yml deleted file mode 100644 index ecd4193f6..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.12" - - "4" - - "6" diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/LICENSE b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/LICENSE deleted file mode 100644 index bae9da7bf..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/README.md deleted file mode 100644 index d9cc2d945..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# stream-shift - -Returns the next buffer/object in a stream's readable queue - -``` -npm install stream-shift -``` - -[![build status](http://img.shields.io/travis/mafintosh/stream-shift.svg?style=flat)](http://travis-ci.org/mafintosh/stream-shift) - -## Usage - -``` js -var shift = require('stream-shift') - -console.log(shift(someStream)) // first item in its buffer -``` - -## Credit - -Thanks [@dignifiedquire](https://github.com/dignifiedquire) for making this work on node 6 - -## License - -MIT diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/index.js b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/index.js deleted file mode 100644 index c4b18b9c2..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/index.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = shift - -function shift (stream) { - var rs = stream._readableState - if (!rs) return null - return rs.objectMode ? stream.read() : stream.read(getStateLength(rs)) -} - -function getStateLength (state) { - if (state.buffer.length) { - // Since node 6.3.0 state.buffer is a BufferList not an array - if (state.buffer.head) { - return state.buffer.head.data.length - } - - return state.buffer[0].length - } - - return state.length -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/package.json deleted file mode 100644 index 6ae1937fa..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "_from": "stream-shift@^1.0.0", - "_id": "stream-shift@1.0.0", - "_inBundle": false, - "_integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "_location": "/cacache/mississippi/stream-each/stream-shift", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "stream-shift@^1.0.0", - "name": "stream-shift", - "escapedName": "stream-shift", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/cacache/mississippi/stream-each" - ], - "_resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "_shasum": "d5c752825e5367e786f78e18e445ea223a155952", - "_spec": "stream-shift@^1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi/node_modules/stream-each", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "bugs": { - "url": "https://github.com/mafintosh/stream-shift/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Returns the next buffer/object in a stream's readable queue", - "devDependencies": { - "standard": "^7.1.2", - "tape": "^4.6.0", - "through2": "^2.0.1" - }, - "homepage": "https://github.com/mafintosh/stream-shift", - "license": "MIT", - "main": "index.js", - "name": "stream-shift", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/stream-shift.git" - }, - "scripts": { - "test": "standard && tape test.js" - }, - "version": "1.0.0" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/test.js b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/test.js deleted file mode 100644 index c0222c37d..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/test.js +++ /dev/null @@ -1,48 +0,0 @@ -var tape = require('tape') -var through = require('through2') -var stream = require('stream') -var shift = require('./') - -tape('shifts next', function (t) { - var passthrough = through() - - passthrough.write('hello') - passthrough.write('world') - - t.same(shift(passthrough), Buffer('hello')) - t.same(shift(passthrough), Buffer('world')) - t.end() -}) - -tape('shifts next with core', function (t) { - var passthrough = stream.PassThrough() - - passthrough.write('hello') - passthrough.write('world') - - t.same(shift(passthrough), Buffer('hello')) - t.same(shift(passthrough), Buffer('world')) - t.end() -}) - -tape('shifts next with object mode', function (t) { - var passthrough = through({objectMode: true}) - - passthrough.write({hello: 1}) - passthrough.write({world: 1}) - - t.same(shift(passthrough), {hello: 1}) - t.same(shift(passthrough), {world: 1}) - t.end() -}) - -tape('shifts next with object mode with core', function (t) { - var passthrough = stream.PassThrough({objectMode: true}) - - passthrough.write({hello: 1}) - passthrough.write({world: 1}) - - t.same(shift(passthrough), {hello: 1}) - t.same(shift(passthrough), {world: 1}) - t.end() -}) diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/package.json deleted file mode 100644 index 2dbe92f79..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "stream-each@^1.1.0", - "_id": "stream-each@1.2.2", - "_inBundle": false, - "_integrity": "sha512-mc1dbFhGBxvTM3bIWmAAINbqiuAk9TATcfIQC8P+/+HJefgaiTlMn2dHvkX8qlI12KeYKSQ1Ua9RrIqrn1VPoA==", - "_location": "/cacache/mississippi/stream-each", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "stream-each@^1.1.0", - "name": "stream-each", - "escapedName": "stream-each", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.2.tgz", - "_shasum": "8e8c463f91da8991778765873fe4d960d8f616bd", - "_spec": "stream-each@^1.1.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "bugs": { - "url": "https://github.com/mafintosh/stream-each/issues" - }, - "bundleDependencies": false, - "dependencies": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - }, - "deprecated": false, - "description": "Iterate all the data in a stream", - "devDependencies": { - "standard": "^5.3.1", - "tape": "^4.2.1", - "through2": "^2.0.0" - }, - "homepage": "https://github.com/mafintosh/stream-each", - "license": "MIT", - "main": "index.js", - "name": "stream-each", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/stream-each.git" - }, - "scripts": { - "test": "standard && tape test.js" - }, - "version": "1.2.2" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/test.js b/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/test.js deleted file mode 100644 index 277634cd0..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/stream-each/test.js +++ /dev/null @@ -1,122 +0,0 @@ -var tape = require('tape') -var through = require('through2') -var each = require('./') - -tape('each', function (t) { - var s = through.obj() - s.write('a') - s.write('b') - s.write('c') - s.end() - - s.on('end', function () { - t.end() - }) - - var expected = ['a', 'b', 'c'] - each(s, function (data, next) { - t.same(data, expected.shift()) - next() - }) -}) - -tape('each and callback', function (t) { - var s = through.obj() - s.write('a') - s.write('b') - s.write('c') - s.end() - - var expected = ['a', 'b', 'c'] - each(s, function (data, next) { - t.same(data, expected.shift()) - next() - }, function () { - t.end() - }) -}) - -tape('each (write after)', function (t) { - var s = through.obj() - s.on('end', function () { - t.end() - }) - - var expected = ['a', 'b', 'c'] - each(s, function (data, next) { - t.same(data, expected.shift()) - next() - }) - - setTimeout(function () { - s.write('a') - s.write('b') - s.write('c') - s.end() - }, 100) -}) - -tape('each error', function (t) { - var s = through.obj() - s.write('hello') - s.on('error', function (err) { - t.same(err.message, 'stop') - t.end() - }) - - each(s, function (data, next) { - next(new Error('stop')) - }) -}) - -tape('each error and callback', function (t) { - var s = through.obj() - s.write('hello') - - each(s, function (data, next) { - next(new Error('stop')) - }, function (err) { - t.same(err.message, 'stop') - t.end() - }) -}) - -tape('each with falsey values', function (t) { - var s = through.obj() - s.write(0) - s.write(false) - s.write(undefined) - s.end() - - s.on('end', function () { - t.end() - }) - - var expected = [0, false] - var count = 0 - each(s, function (data, next) { - count++ - t.same(data, expected.shift()) - next() - }, function () { - t.same(count, 2) - }) -}) - -tape('huge stack', function (t) { - var s = through.obj() - - for (var i = 0; i < 5000; i++) { - s.write('foo') - } - - s.end() - - each(s, function (data, cb) { - if (data !== 'foo') t.fail('bad data') - cb() - }, function (err) { - t.error(err, 'no error') - t.end() - }) -}) diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/.npmignore b/node_modules/cacache/node_modules/mississippi/node_modules/through2/.npmignore deleted file mode 100644 index 1e1dcab34..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test -.jshintrc -.travis.yml
\ No newline at end of file diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/LICENSE.html b/node_modules/cacache/node_modules/mississippi/node_modules/through2/LICENSE.html deleted file mode 100644 index ac478189e..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/LICENSE.html +++ /dev/null @@ -1,336 +0,0 @@ -<!doctype html> -<!-- Created with GFM2HTML: https://github.com/rvagg/gfm2html --> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <title></title> - <meta name="description" content=""> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="created-with" content="https://github.com/rvagg/gfm2html"> - - <style type="text/css"> -/* most of normalize.css */ -article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}[hidden],template{display:none;}html{font-family:sans-serif;/*1*/-ms-text-size-adjust:100%;/*2*/-webkit-text-size-adjust:100%;/*2*/}body{margin:0;}a{background:transparent;}a:focus{outline:thindotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:0.67em0;}abbr[title]{border-bottom:1pxdotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C""\201D""\2018""\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}table{border-collapse:collapse;border-spacing:0;} - -html { - font: 14px 'Helvetica Neue', Helvetica, arial, freesans, clean, sans-serif; -} - -.container { - line-height: 1.6; - color: #333; - background: #eee; - border-radius: 3px; - padding: 3px; - width: 790px; - margin: 10px auto; -} - -.body-content { - background-color: #fff; - border: 1px solid #CACACA; - padding: 30px; -} - -.body-content > *:first-child { - margin-top: 0 !important; -} - -a, a:visited { - color: #4183c4; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -p, blockquote, ul, ol, dl, table, pre { - margin: 15px 0; -} - - .markdown-body h1 -, .markdown-body h2 -, .markdown-body h3 -, .markdown-body h4 -, .markdown-body h5 -, .markdown-body h6 { - margin: 20px 0 10px; - padding: 0; - font-weight: bold; -} - -h1 { - font-size: 2.5em; - color: #000; - border-bottom: 1px solid #ddd; -} - -h2 { - font-size: 2em; - border-bottom: 1px solid #eee; - color: #000; -} - -img { - max-width: 100%; -} - -hr { - background: transparent url("/img/hr.png") repeat-x 0 0; - border: 0 none; - color: #ccc; - height: 4px; - padding: 0; -} - -table { - border-collapse: collapse; - border-spacing: 0; -} - -tr:nth-child(2n) { - background-color: #f8f8f8; -} - -.markdown-body tr { - border-top: 1px solid #ccc; - background-color: #fff; -} - -td, th { - border: 1px solid #ccc; - padding: 6px 13px; -} - -th { - font-weight: bold; -} - -blockquote { - border-left: 4px solid #ddd; - padding: 0 15px; - color: #777; -} - -blockquote > :last-child, blockquote > :first-child { - margin-bottom: 0px; -} - -pre, code { - font-size: 13px; - font-family: 'UbuntuMono', monospace; - white-space: nowrap; - margin: 0 2px; - padding: 0px 5px; - border: 1px solid #eaeaea; - background-color: #f8f8f8; - border-radius: 3px; -} - -pre > code { - white-space: pre; -} - -pre { - overflow-x: auto; - white-space: pre; - padding: 10px; - line-height: 150%; - background-color: #f8f8f8; - border-color: #ccc; -} - -pre code, pre tt { - margin: 0; - padding: 0; - border: 0; - background-color: transparent; - border: none; -} - - .highlight .c -, .highlight .cm -, .highlight .cp -, .highlight .c1 { - color:#999988; - font-style:italic; -} - -.highlight .err { - color:#a61717; - background-color:#e3d2d2 -} - - .highlight .o -, .highlight .gs -, .highlight .kc -, .highlight .kd -, .highlight .kn -, .highlight .kp -, .highlight .kr { - font-weight:bold -} - -.highlight .cs { - color:#999999; - font-weight:bold; - font-style:italic -} - -.highlight .gd { - color:#000000; - background-color:#ffdddd -} - -.highlight .gd .x { - color:#000000; - background-color:#ffaaaa -} - -.highlight .ge { - font-style:italic -} - - .highlight .gr -, .highlight .gt { - color:#aa0000 -} - - .highlight .gh -, .highlight .bp { - color:#999999 -} - -.highlight .gi { - color:#000000; - background-color:#ddffdd -} - -.highlight .gi .x { - color:#000000; - background-color:#aaffaa -} - -.highlight .go { - color:#888888 -} - - .highlight .gp -, .highlight .nn { - color:#555555 -} - - -.highlight .gu { - color:#800080; - font-weight:bold -} - - -.highlight .kt { - color:#445588; - font-weight:bold -} - - .highlight .m -, .highlight .mf -, .highlight .mh -, .highlight .mi -, .highlight .mo -, .highlight .il { - color:#009999 -} - - .highlight .s -, .highlight .sb -, .highlight .sc -, .highlight .sd -, .highlight .s2 -, .highlight .se -, .highlight .sh -, .highlight .si -, .highlight .sx -, .highlight .s1 { - color:#d14 -} - -.highlight .n { - color:#333333 -} - - .highlight .na -, .highlight .no -, .highlight .nv -, .highlight .vc -, .highlight .vg -, .highlight .vi -, .highlight .nb { - color:#0086B3 -} - -.highlight .nc { - color:#445588; - font-weight:bold -} - -.highlight .ni { - color:#800080 -} - - .highlight .ne -, .highlight .nf { - color:#990000; - font-weight:bold -} - -.highlight .nt { - color:#000080 -} - -.highlight .ow { - font-weight:bold -} - -.highlight .w { - color:#bbbbbb -} - -.highlight .sr { - color:#009926 -} - -.highlight .ss { - color:#990073 -} - -.highlight .gc { - color:#999; - background-color:#EAF2F5 -} - -@media print { - .container { - background: transparent; - border-radius: 0; - padding: 0; - } - - .body-content { - border: none; - } -} -</style> - </head> - <body> - <div class="container"> - <div class="body-content"><h1 id="the-mit-license-mit-">The MIT License (MIT)</h1> -<p><strong>Copyright (c) 2016 Rod Vagg (the "Original Author") and additional contributors</strong></p> -<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> -<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> -<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> -</div> - </div> - </body> -</html>
\ No newline at end of file diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/LICENSE.md b/node_modules/cacache/node_modules/mississippi/node_modules/through2/LICENSE.md deleted file mode 100644 index 7f0b93daa..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -# The MIT License (MIT) - -**Copyright (c) 2016 Rod Vagg (the "Original Author") and additional contributors** - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/through2/README.md deleted file mode 100644 index a916f15ef..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/README.md +++ /dev/null @@ -1,136 +0,0 @@ -# through2 - -[![NPM](https://nodei.co/npm/through2.png?downloads&downloadRank)](https://nodei.co/npm/through2/) - -**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise** - -Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`. - -Note: As 2.x.x this module starts using **Streams3** instead of Stream2. To continue using a Streams2 version use `npm install through2@0` to fetch the latest version of 0.x.x. More information about Streams2 vs Streams3 and recommendations see the article **[Why I don't use Node's core 'stream' module](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html)**. - -```js -fs.createReadStream('ex.txt') - .pipe(through2(function (chunk, enc, callback) { - for (var i = 0; i < chunk.length; i++) - if (chunk[i] == 97) - chunk[i] = 122 // swap 'a' for 'z' - - this.push(chunk) - - callback() - })) - .pipe(fs.createWriteStream('out.txt')) - .on('finish', function () { - doSomethingSpecial() - }) -``` - -Or object streams: - -```js -var all = [] - -fs.createReadStream('data.csv') - .pipe(csv2()) - .pipe(through2.obj(function (chunk, enc, callback) { - var data = { - name : chunk[0] - , address : chunk[3] - , phone : chunk[10] - } - this.push(data) - - callback() - })) - .on('data', function (data) { - all.push(data) - }) - .on('end', function () { - doSomethingSpecial(all) - }) -``` - -Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`. - -## API - -<b><code>through2([ options, ] [ transformFunction ] [, flushFunction ])</code></b> - -Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`). - -### options - -The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`). - -The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call: - -```js -fs.createReadStream('/tmp/important.dat') - .pipe(through2({ objectMode: true, allowHalfOpen: false }, - function (chunk, enc, cb) { - cb(null, 'wut?') // note we can use the second argument on the callback - // to provide data as an alternative to this.push('wut?') - } - ) - .pipe(fs.createWriteStream('/tmp/wut.txt')) -``` - -### transformFunction - -The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk. - -To queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on. - -Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error. - -If you **do not provide a `transformFunction`** then you will get a simple pass-through stream. - -### flushFunction - -The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress. - -```js -fs.createReadStream('/tmp/important.dat') - .pipe(through2( - function (chunk, enc, cb) { cb(null, chunk) }, // transform is a noop - function (cb) { // flush function - this.push('tacking on an extra buffer to the end'); - cb(); - } - )) - .pipe(fs.createWriteStream('/tmp/wut.txt')); -``` - -<b><code>through2.ctor([ options, ] transformFunction[, flushFunction ])</code></b> - -Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances. - -```js -var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) { - if (record.temp != null && record.unit == "F") { - record.temp = ( ( record.temp - 32 ) * 5 ) / 9 - record.unit = "C" - } - this.push(record) - callback() -}) - -// Create instances of FToC like so: -var converter = new FToC() -// Or: -var converter = FToC() -// Or specify/override options when you instantiate, if you prefer: -var converter = FToC({objectMode: true}) -``` - -## See Also - - - [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams. - - [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams. - - [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams. - - [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies. - - the [mississippi stream utility collection](https://github.com/maxogden/mississippi) includes `through2` as well as many more useful stream modules similar to this one - -## License - -**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/.npmignore b/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/.npmignore deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/LICENCE b/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/LICENCE deleted file mode 100644 index 1a14b437e..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2014 Raynos. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/Makefile b/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/Makefile deleted file mode 100644 index d583fcf49..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -browser: - node ./support/compile - -.PHONY: browser
\ No newline at end of file diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/README.md b/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/README.md deleted file mode 100644 index 093cb2978..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# xtend - -[![browser support][3]][4] - -[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) - -Extend like a boss - -xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. - -## Examples - -```js -var extend = require("xtend") - -// extend returns a new object. Does not mutate arguments -var combination = extend({ - a: "a", - b: 'c' -}, { - b: "b" -}) -// { a: "a", b: "b" } -``` - -## Stability status: Locked - -## MIT Licenced - - - [3]: http://ci.testling.com/Raynos/xtend.png - [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/immutable.js b/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/immutable.js deleted file mode 100644 index 94889c9de..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/immutable.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/mutable.js b/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/mutable.js deleted file mode 100644 index 72debede6..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/mutable.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/package.json deleted file mode 100644 index c682294f2..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_from": "xtend@~4.0.1", - "_id": "xtend@4.0.1", - "_inBundle": false, - "_integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "_location": "/cacache/mississippi/through2/xtend", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "xtend@~4.0.1", - "name": "xtend", - "escapedName": "xtend", - "rawSpec": "~4.0.1", - "saveSpec": null, - "fetchSpec": "~4.0.1" - }, - "_requiredBy": [ - "/cacache/mississippi/through2" - ], - "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af", - "_spec": "xtend@~4.0.1", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi/node_modules/through2", - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "bugs": { - "url": "https://github.com/Raynos/xtend/issues", - "email": "raynos2@gmail.com" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jake Verbaten" - }, - { - "name": "Matt Esch" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "extend like a boss", - "devDependencies": { - "tape": "~1.1.0" - }, - "engines": { - "node": ">=0.4" - }, - "homepage": "https://github.com/Raynos/xtend", - "keywords": [ - "extend", - "merge", - "options", - "opts", - "object", - "array" - ], - "license": "MIT", - "main": "immutable", - "name": "xtend", - "repository": { - "type": "git", - "url": "git://github.com/Raynos/xtend.git" - }, - "scripts": { - "test": "node test" - }, - "testling": { - "files": "test.js", - "browsers": [ - "ie/7..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "version": "4.0.1" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/test.js b/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/test.js deleted file mode 100644 index 093a2b061..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/node_modules/xtend/test.js +++ /dev/null @@ -1,83 +0,0 @@ -var test = require("tape") -var extend = require("./") -var mutableExtend = require("./mutable") - -test("merge", function(assert) { - var a = { a: "foo" } - var b = { b: "bar" } - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("replace", function(assert) { - var a = { a: "foo" } - var b = { a: "bar" } - - assert.deepEqual(extend(a, b), { a: "bar" }) - assert.end() -}) - -test("undefined", function(assert) { - var a = { a: undefined } - var b = { b: "foo" } - - assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) - assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) - assert.end() -}) - -test("handle 0", function(assert) { - var a = { a: "default" } - var b = { a: 0 } - - assert.deepEqual(extend(a, b), { a: 0 }) - assert.deepEqual(extend(b, a), { a: "default" }) - assert.end() -}) - -test("is immutable", function (assert) { - var record = {} - - extend(record, { foo: "bar" }) - assert.equal(record.foo, undefined) - assert.end() -}) - -test("null as argument", function (assert) { - var a = { foo: "bar" } - var b = null - var c = void 0 - - assert.deepEqual(extend(b, a, c), { foo: "bar" }) - assert.end() -}) - -test("mutable", function (assert) { - var a = { foo: "bar" } - - mutableExtend(a, { bar: "baz" }) - - assert.equal(a.bar, "baz") - assert.end() -}) - -test("null prototype", function(assert) { - var a = { a: "foo" } - var b = Object.create(null) - b.b = "bar"; - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("null prototype mutable", function (assert) { - var a = { foo: "bar" } - var b = Object.create(null) - b.bar = "baz"; - - mutableExtend(a, b) - - assert.equal(a.bar, "baz") - assert.end() -}) diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/package.json b/node_modules/cacache/node_modules/mississippi/node_modules/through2/package.json deleted file mode 100644 index 5a9aee5ec..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "through2@^2.0.0", - "_id": "through2@2.0.3", - "_inBundle": false, - "_integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "_location": "/cacache/mississippi/through2", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "through2@^2.0.0", - "name": "through2", - "escapedName": "through2", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "_shasum": "0004569b37c7c74ba39c43f3ced78d1ad94140be", - "_spec": "through2@^2.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi", - "author": { - "name": "Rod Vagg", - "email": "r@va.gg", - "url": "https://github.com/rvagg" - }, - "bugs": { - "url": "https://github.com/rvagg/through2/issues" - }, - "bundleDependencies": false, - "dependencies": { - "readable-stream": "^2.1.5", - "xtend": "~4.0.1" - }, - "deprecated": false, - "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", - "devDependencies": { - "bl": "~1.1.2", - "faucet": "0.0.1", - "stream-spigot": "~3.0.5", - "tape": "~4.6.2" - }, - "homepage": "https://github.com/rvagg/through2#readme", - "keywords": [ - "stream", - "streams2", - "through", - "transform" - ], - "license": "MIT", - "main": "through2.js", - "name": "through2", - "repository": { - "type": "git", - "url": "git+https://github.com/rvagg/through2.git" - }, - "scripts": { - "test": "node test/test.js | faucet", - "test-local": "brtapsauce-local test/basic-test.js" - }, - "version": "2.0.3" -} diff --git a/node_modules/cacache/node_modules/mississippi/node_modules/through2/through2.js b/node_modules/cacache/node_modules/mississippi/node_modules/through2/through2.js deleted file mode 100644 index 5b7a880e8..000000000 --- a/node_modules/cacache/node_modules/mississippi/node_modules/through2/through2.js +++ /dev/null @@ -1,96 +0,0 @@ -var Transform = require('readable-stream/transform') - , inherits = require('util').inherits - , xtend = require('xtend') - -function DestroyableTransform(opts) { - Transform.call(this, opts) - this._destroyed = false -} - -inherits(DestroyableTransform, Transform) - -DestroyableTransform.prototype.destroy = function(err) { - if (this._destroyed) return - this._destroyed = true - - var self = this - process.nextTick(function() { - if (err) - self.emit('error', err) - self.emit('close') - }) -} - -// a noop _transform function -function noop (chunk, enc, callback) { - callback(null, chunk) -} - - -// create a new export function, used by both the main export and -// the .ctor export, contains common logic for dealing with arguments -function through2 (construct) { - return function (options, transform, flush) { - if (typeof options == 'function') { - flush = transform - transform = options - options = {} - } - - if (typeof transform != 'function') - transform = noop - - if (typeof flush != 'function') - flush = null - - return construct(options, transform, flush) - } -} - - -// main export, just make me a transform stream! -module.exports = through2(function (options, transform, flush) { - var t2 = new DestroyableTransform(options) - - t2._transform = transform - - if (flush) - t2._flush = flush - - return t2 -}) - - -// make me a reusable prototype that I can `new`, or implicitly `new` -// with a constructor call -module.exports.ctor = through2(function (options, transform, flush) { - function Through2 (override) { - if (!(this instanceof Through2)) - return new Through2(override) - - this.options = xtend(options, override) - - DestroyableTransform.call(this, this.options) - } - - inherits(Through2, DestroyableTransform) - - Through2.prototype._transform = transform - - if (flush) - Through2.prototype._flush = flush - - return Through2 -}) - - -module.exports.obj = through2(function (options, transform, flush) { - var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options)) - - t2._transform = transform - - if (flush) - t2._flush = flush - - return t2 -}) diff --git a/node_modules/cacache/node_modules/mississippi/package.json b/node_modules/cacache/node_modules/mississippi/package.json deleted file mode 100644 index 505c1ba83..000000000 --- a/node_modules/cacache/node_modules/mississippi/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "mississippi@^2.0.0", - "_id": "mississippi@2.0.0", - "_inBundle": false, - "_integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", - "_location": "/cacache/mississippi", - "_phantomChildren": { - "inherits": "2.0.3", - "once": "1.4.0", - "readable-stream": "2.3.5" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "mississippi@^2.0.0", - "name": "mississippi", - "escapedName": "mississippi", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/cacache" - ], - "_resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", - "_shasum": "3442a508fafc28500486feea99409676e4ee5a6f", - "_spec": "mississippi@^2.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache", - "author": { - "name": "max ogden" - }, - "bugs": { - "url": "https://github.com/maxogden/mississippi/issues" - }, - "bundleDependencies": false, - "dependencies": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^2.0.1", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - }, - "deprecated": false, - "description": "a collection of useful streams", - "devDependencies": {}, - "engines": { - "node": ">=4.0.0" - }, - "homepage": "https://github.com/maxogden/mississippi#readme", - "license": "BSD-2-Clause", - "main": "index.js", - "name": "mississippi", - "repository": { - "type": "git", - "url": "git+https://github.com/maxogden/mississippi.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "version": "2.0.0" -} diff --git a/node_modules/cacache/node_modules/mississippi/readme.md b/node_modules/cacache/node_modules/mississippi/readme.md deleted file mode 100644 index 5fa6d66c8..000000000 --- a/node_modules/cacache/node_modules/mississippi/readme.md +++ /dev/null @@ -1,411 +0,0 @@ -# mississippi - -a collection of useful stream utility modules. learn how the modules work using this and then pick the ones you want and use them individually - -the goal of the modules included in mississippi is to make working with streams easy without sacrificing speed, error handling or composability. - -## usage - -```js -var miss = require('mississippi') -``` - -## methods - -- [pipe](#pipe) -- [each](#each) -- [pipeline](#pipeline) -- [duplex](#duplex) -- [through](#through) -- [from](#from) -- [to](#to) -- [concat](#concat) -- [finished](#finished) -- [parallel](#parallel) - -### pipe - -##### `miss.pipe(stream1, stream2, stream3, ..., cb)` - -Pipes streams together and destroys all of them if one of them closes. Calls `cb` with `(error)` if there was an error in any of the streams. - -When using standard `source.pipe(destination)` the source will _not_ be destroyed if the destination emits close or error. You are also not able to provide a callback to tell when the pipe has finished. - -`miss.pipe` does these two things for you, ensuring you handle stream errors 100% of the time (unhandled errors are probably the most common bug in most node streams code) - -#### original module - -`miss.pipe` is provided by [`require('pump')`](https://www.npmjs.com/package/pump) - -#### example - -```js -// lets do a simple file copy -var fs = require('fs') - -var read = fs.createReadStream('./original.zip') -var write = fs.createWriteStream('./copy.zip') - -// use miss.pipe instead of read.pipe(write) -miss.pipe(read, write, function (err) { - if (err) return console.error('Copy error!', err) - console.log('Copied successfully') -}) -``` - -### each - -##### `miss.each(stream, each, [done])` - -Iterate the data in `stream` one chunk at a time. Your `each` function will be called with `(data, next)` where data is a data chunk and next is a callback. Call `next` when you are ready to consume the next chunk. - -Optionally you can call `next` with an error to destroy the stream. You can also pass the optional third argument, `done`, which is a function that will be called with `(err)` when the stream ends. The `err` argument will be populated with an error if the stream emitted an error. - -#### original module - -`miss.each` is provided by [`require('stream-each')`](https://www.npmjs.com/package/stream-each) - -#### example - -```js -var fs = require('fs') -var split = require('split2') - -var newLineSeparatedNumbers = fs.createReadStream('numbers.txt') - -var pipeline = miss.pipeline(newLineSeparatedNumbers, split()) -miss.each(pipeline, eachLine, done) -var sum = 0 - -function eachLine (line, next) { - sum += parseInt(line.toString()) - next() -} - -function done (err) { - if (err) throw err - console.log('sum is', sum) -} -``` - -### pipeline - -##### `var pipeline = miss.pipeline(stream1, stream2, stream3, ...)` - -Builds a pipeline from all the transform streams passed in as arguments by piping them together and returning a single stream object that lets you write to the first stream and read from the last stream. - -If you are pumping object streams together use `pipeline = miss.pipeline.obj(s1, s2, ...)`. - -If any of the streams in the pipeline emits an error or gets destroyed, or you destroy the stream it returns, all of the streams will be destroyed and cleaned up for you. - -#### original module - -`miss.pipeline` is provided by [`require('pumpify')`](https://www.npmjs.com/package/pumpify) - -#### example - -```js -// first create some transform streams (note: these two modules are fictional) -var imageResize = require('image-resizer-stream')({width: 400}) -var pngOptimizer = require('png-optimizer-stream')({quality: 60}) - -// instead of doing a.pipe(b), use pipelin -var resizeAndOptimize = miss.pipeline(imageResize, pngOptimizer) -// `resizeAndOptimize` is a transform stream. when you write to it, it writes -// to `imageResize`. when you read from it, it reads from `pngOptimizer`. -// it handles piping all the streams together for you - -// use it like any other transform stream -var fs = require('fs') - -var read = fs.createReadStream('./image.png') -var write = fs.createWriteStream('./resized-and-optimized.png') - -miss.pipe(read, resizeAndOptimize, write, function (err) { - if (err) return console.error('Image processing error!', err) - console.log('Image processed successfully') -}) -``` - -### duplex - -##### `var duplex = miss.duplex([writable, readable, opts])` - -Take two separate streams, a writable and a readable, and turn them into a single [duplex (readable and writable) stream](https://nodejs.org/api/stream.html#stream_class_stream_duplex). - -The returned stream will emit data from the readable. When you write to it it writes to the writable. - -You can either choose to supply the writable and the readable at the time you create the stream, or you can do it later using the `.setWritable` and `.setReadable` methods and data written to the stream in the meantime will be buffered for you. - -#### original module - -`miss.duplex` is provided by [`require('duplexify')`](https://www.npmjs.com/package/duplexify) - -#### example - -```js -// lets spawn a process and take its stdout and stdin and combine them into 1 stream -var child = require('child_process') - -// @- tells it to read from stdin, --data-binary sets 'raw' binary mode -var curl = child.spawn('curl -X POST --data-binary @- http://foo.com') - -// duplexCurl will write to stdin and read from stdout -var duplexCurl = miss.duplex(curl.stdin, curl.stdout) -``` - -### through - -##### `var transformer = miss.through([options, transformFunction, flushFunction])` - -Make a custom [transform stream](https://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform). - -The `options` object is passed to the internal transform stream and can be used to create an `objectMode` stream (or use the shortcut `miss.through.obj([...])`) - -The `transformFunction` is called when data is available for the writable side and has the signature `(chunk, encoding, cb)`. Within the function, add data to the readable side any number of times with `this.push(data)`. Call `cb()` to indicate processing of the `chunk` is complete. Or to easily emit a single error or chunk, call `cb(err, chunk)` - -The `flushFunction`, with signature `(cb)`, is called just before the stream is complete and should be used to wrap up stream processing. - -#### original module - -`miss.through` is provided by [`require('through2')`](https://www.npmjs.com/package/through2) - -#### example - -```js -var fs = require('fs') - -var read = fs.createReadStream('./boring_lowercase.txt') -var write = fs.createWriteStream('./AWESOMECASE.TXT') - -// Leaving out the options object -var uppercaser = miss.through( - function (chunk, enc, cb) { - cb(null, chunk.toString().toUpperCase()) - }, - function (cb) { - cb(null, 'ONE LAST BIT OF UPPERCASE') - } -) - -miss.pipe(read, uppercaser, write, function (err) { - if (err) return console.error('Trouble uppercasing!') - console.log('Splendid uppercasing!') -}) -``` - -### from - -##### `miss.from([opts], read)` - -Make a custom [readable stream](https://nodejs.org/docs/latest/api/stream.html#stream_class_stream_readable). - -`opts` contains the options to pass on to the ReadableStream constructor e.g. for creating a readable object stream (or use the shortcut `miss.from.obj([...])`). - -Returns a readable stream that calls `read(size, next)` when data is requested from the stream. - -- `size` is the recommended amount of data (in bytes) to retrieve. -- `next(err, chunk)` should be called when you're ready to emit more data. - -#### original module - -`miss.from` is provided by [`require('from2')`](https://www.npmjs.com/package/from2) - -#### example - -```js - - -function fromString(string) { - return miss.from(function(size, next) { - // if there's no more content - // left in the string, close the stream. - if (string.length <= 0) return next(null, null) - - // Pull in a new chunk of text, - // removing it from the string. - var chunk = string.slice(0, size) - string = string.slice(size) - - // Emit "chunk" from the stream. - next(null, chunk) - }) -} - -// pipe "hello world" out -// to stdout. -fromString('hello world').pipe(process.stdout) -``` - -### to - -##### `miss.to([options], write, [flush])` - -Make a custom [writable stream](https://nodejs.org/docs/latest/api/stream.html#stream_class_stream_writable). - -`opts` contains the options to pass on to the WritableStream constructor e.g. for creating a writable object stream (or use the shortcut `miss.to.obj([...])`). - -Returns a writable stream that calls `write(data, enc, cb)` when data is written to the stream. - -- `data` is the received data to write the destination. -- `enc` encoding of the piece of data received. -- `cb(err, data)` should be called when you're ready to write more data, or encountered an error. - -`flush(cb)` is called before `finish` is emitted and allows for cleanup steps to occur. - -#### original module - -`miss.to` is provided by [`require('flush-write-stream')`](https://www.npmjs.com/package/flush-write-stream) - -#### example - -```js -var ws = miss.to(write, flush) - -ws.on('finish', function () { - console.log('finished') -}) - -ws.write('hello') -ws.write('world') -ws.end() - -function write (data, enc, cb) { - // i am your normal ._write method - console.log('writing', data.toString()) - cb() -} - -function flush (cb) { - // i am called before finish is emitted - setTimeout(cb, 1000) // wait 1 sec -} -``` - -If you run the above it will produce the following output - -``` -writing hello -writing world -(nothing happens for 1 sec) -finished -``` - -### concat - -##### `var concat = miss.concat(cb)` - -Returns a writable stream that concatenates all data written to the stream and calls a callback with the single result. - -Calling `miss.concat(cb)` returns a writable stream. `cb` is called when the writable stream is finished, e.g. when all data is done being written to it. `cb` is called with a single argument, `(data)`, which will contain the result of concatenating all the data written to the stream. - -Note that `miss.concat` will not handle stream errors for you. To handle errors, use `miss.pipe` or handle the `error` event manually. - -#### original module - -`miss.concat` is provided by [`require('concat-stream')`](https://www.npmjs.com/package/concat-stream) - -#### example - -```js -var fs = require('fs') - -var readStream = fs.createReadStream('cat.png') -var concatStream = miss.concat(gotPicture) - -function callback (err) { - if (err) { - console.error(err) - process.exit(1) - } -} - -miss.pipe(readStream, concatStream, callback) - -function gotPicture(imageBuffer) { - // imageBuffer is all of `cat.png` as a node.js Buffer -} - -function handleError(err) { - // handle your error appropriately here, e.g.: - console.error(err) // print the error to STDERR - process.exit(1) // exit program with non-zero exit code -} -``` - -### finished - -##### `miss.finished(stream, cb)` - -Waits for `stream` to finish or error and then calls `cb` with `(err)`. `cb` will only be called once. `err` will be null if the stream finished without error, or else it will be populated with the error from the streams `error` event. - -This function is useful for simplifying stream handling code as it lets you handle success or error conditions in a single code path. It's used internally `miss.pipe`. - -#### original module - -`miss.finished` is provided by [`require('end-of-stream')`](https://www.npmjs.com/package/end-of-stream) - -#### example - -```js -var copySource = fs.createReadStream('./movie.mp4') -var copyDest = fs.createWriteStream('./movie-copy.mp4') - -copySource.pipe(copyDest) - -miss.finished(copyDest, function(err) { - if (err) return console.log('write failed', err) - console.log('write success') -}) -``` - -### parallel - -##### `miss.parallel(concurrency, each)` - -This works like `through` except you can process items in parallel, while still preserving the original input order. - -This is handy if you wanna take advantage of node's async I/O and process streams of items in batches. With this module you can build your very own streaming parallel job queue. - -Note that `miss.parallel` preserves input ordering, if you don't need that then you can use [through2-concurrent](https://github.com/almost/through2-concurrent) instead, which is very similar to this otherwise. - -#### original module - -`miss.parallel` is provided by [`require('parallel-transform')`](https://npmjs.org/parallel-transform) - -#### example - -This example fetches the GET HTTP headers for a stream of input URLs 5 at a time in parallel. - -```js -function getResponse (item, cb) { - var r = request(item.url) - r.on('error', function (err) { - cb(err) - }) - r.on('response', function (re) { - cb(null, {url: item.url, date: new Date(), status: re.statusCode, headers: re.headers}) - r.abort() - }) -} - -miss.pipe( - fs.createReadStream('./urls.txt'), // one url per line - split(), - miss.parallel(5, getResponse), - miss.through(function (row, enc, next) { - console.log(JSON.stringify(row)) - next() - }) -) -``` - -## see also - -- [substack/stream-handbook](https://github.com/substack/stream-handbook) -- [nodejs.org/api/stream.html](https://nodejs.org/api/stream.html) -- [awesome-nodejs-streams](https://github.com/thejmazz/awesome-nodejs-streams) - -## license - -Licensed under the BSD 2-clause license. diff --git a/node_modules/cacache/node_modules/ssri/CHANGELOG.md b/node_modules/cacache/node_modules/ssri/CHANGELOG.md new file mode 100644 index 000000000..a56594ae6 --- /dev/null +++ b/node_modules/cacache/node_modules/ssri/CHANGELOG.md @@ -0,0 +1,276 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +<a name="6.0.0"></a> +# [6.0.0](https://github.com/zkat/ssri/compare/v5.3.0...v6.0.0) (2018-04-09) + + +### Bug Fixes + +* **docs:** minor typo ([b71ef17](https://github.com/zkat/ssri/commit/b71ef17)) + + +### meta + +* drop support for node@4 ([d9bf359](https://github.com/zkat/ssri/commit/d9bf359)) + + +### BREAKING CHANGES + +* node@4 is no longer supported + + + +<a name="5.3.0"></a> +# [5.3.0](https://github.com/zkat/ssri/compare/v5.2.4...v5.3.0) (2018-03-13) + + +### Features + +* **checkData:** optionally throw when checkData fails ([bf26b84](https://github.com/zkat/ssri/commit/bf26b84)) + + + +<a name="5.2.4"></a> +## [5.2.4](https://github.com/zkat/ssri/compare/v5.2.3...v5.2.4) (2018-02-16) + + + +<a name="5.2.3"></a> +## [5.2.3](https://github.com/zkat/ssri/compare/v5.2.2...v5.2.3) (2018-02-16) + + +### Bug Fixes + +* **hashes:** filter hash priority list by available hashes ([2fa30b8](https://github.com/zkat/ssri/commit/2fa30b8)) +* **integrityStream:** dedupe algorithms to generate ([d56c654](https://github.com/zkat/ssri/commit/d56c654)) + + + +<a name="5.2.2"></a> +## [5.2.2](https://github.com/zkat/ssri/compare/v5.2.1...v5.2.2) (2018-02-14) + + +### Bug Fixes + +* **security:** tweak strict SRI regex ([#10](https://github.com/zkat/ssri/issues/10)) ([d0ebcdc](https://github.com/zkat/ssri/commit/d0ebcdc)) + + + +<a name="5.2.1"></a> +## [5.2.1](https://github.com/zkat/ssri/compare/v5.2.0...v5.2.1) (2018-02-06) + + + +<a name="5.2.0"></a> +# [5.2.0](https://github.com/zkat/ssri/compare/v5.1.0...v5.2.0) (2018-02-06) + + +### Features + +* **match:** add integrity.match() ([3c49cc4](https://github.com/zkat/ssri/commit/3c49cc4)) + + + +<a name="5.1.0"></a> +# [5.1.0](https://github.com/zkat/ssri/compare/v5.0.0...v5.1.0) (2018-01-18) + + +### Bug Fixes + +* **checkStream:** integrityStream now takes opts.integrity algos into account ([d262910](https://github.com/zkat/ssri/commit/d262910)) + + +### Features + +* **sha3:** do some guesswork about upcoming sha3 ([7fdd9df](https://github.com/zkat/ssri/commit/7fdd9df)) + + + +<a name="5.0.0"></a> +# [5.0.0](https://github.com/zkat/ssri/compare/v4.1.6...v5.0.0) (2017-10-23) + + +### Features + +* **license:** relicense to ISC (#9) ([c82983a](https://github.com/zkat/ssri/commit/c82983a)) + + +### BREAKING CHANGES + +* **license:** the license has been changed from CC0-1.0 to ISC. + + + +<a name="4.1.6"></a> +## [4.1.6](https://github.com/zkat/ssri/compare/v4.1.5...v4.1.6) (2017-06-07) + + +### Bug Fixes + +* **checkStream:** make sure to pass all opts through ([0b1bcbe](https://github.com/zkat/ssri/commit/0b1bcbe)) + + + +<a name="4.1.5"></a> +## [4.1.5](https://github.com/zkat/ssri/compare/v4.1.4...v4.1.5) (2017-06-05) + + +### Bug Fixes + +* **integrityStream:** stop crashing if opts.algorithms and opts.integrity have an algo mismatch ([fb1293e](https://github.com/zkat/ssri/commit/fb1293e)) + + + +<a name="4.1.4"></a> +## [4.1.4](https://github.com/zkat/ssri/compare/v4.1.3...v4.1.4) (2017-05-31) + + +### Bug Fixes + +* **node:** older versions of node[@4](https://github.com/4) do not support base64buffer string parsing ([513df4e](https://github.com/zkat/ssri/commit/513df4e)) + + + +<a name="4.1.3"></a> +## [4.1.3](https://github.com/zkat/ssri/compare/v4.1.2...v4.1.3) (2017-05-24) + + +### Bug Fixes + +* **check:** handle various bad hash corner cases better ([c2c262b](https://github.com/zkat/ssri/commit/c2c262b)) + + + +<a name="4.1.2"></a> +## [4.1.2](https://github.com/zkat/ssri/compare/v4.1.1...v4.1.2) (2017-04-18) + + +### Bug Fixes + +* **stream:** _flush can be called multiple times. use on("end") ([b1c4805](https://github.com/zkat/ssri/commit/b1c4805)) + + + +<a name="4.1.1"></a> +## [4.1.1](https://github.com/zkat/ssri/compare/v4.1.0...v4.1.1) (2017-04-12) + + +### Bug Fixes + +* **pickAlgorithm:** error if pickAlgorithm() is used in an empty Integrity ([fab470e](https://github.com/zkat/ssri/commit/fab470e)) + + + +<a name="4.1.0"></a> +# [4.1.0](https://github.com/zkat/ssri/compare/v4.0.0...v4.1.0) (2017-04-07) + + +### Features + +* adding ssri.create for a crypto style interface (#2) ([96f52ad](https://github.com/zkat/ssri/commit/96f52ad)) + + + +<a name="4.0.0"></a> +# [4.0.0](https://github.com/zkat/ssri/compare/v3.0.2...v4.0.0) (2017-04-03) + + +### Bug Fixes + +* **integrity:** should have changed the error code before. oops ([8381afa](https://github.com/zkat/ssri/commit/8381afa)) + + +### BREAKING CHANGES + +* **integrity:** EBADCHECKSUM -> EINTEGRITY for verification errors + + + +<a name="3.0.2"></a> +## [3.0.2](https://github.com/zkat/ssri/compare/v3.0.1...v3.0.2) (2017-04-03) + + + +<a name="3.0.1"></a> +## [3.0.1](https://github.com/zkat/ssri/compare/v3.0.0...v3.0.1) (2017-04-03) + + +### Bug Fixes + +* **package.json:** really should have these in the keywords because search ([a6ac6d0](https://github.com/zkat/ssri/commit/a6ac6d0)) + + + +<a name="3.0.0"></a> +# [3.0.0](https://github.com/zkat/ssri/compare/v2.0.0...v3.0.0) (2017-04-03) + + +### Bug Fixes + +* **hashes:** IntegrityMetadata -> Hash ([d04aa1f](https://github.com/zkat/ssri/commit/d04aa1f)) + + +### Features + +* **check:** return IntegrityMetadata on check success ([2301e74](https://github.com/zkat/ssri/commit/2301e74)) +* **fromHex:** ssri.fromHex to make it easier to generate them from hex valus ([049b89e](https://github.com/zkat/ssri/commit/049b89e)) +* **hex:** utility function for getting hex version of digest ([a9f021c](https://github.com/zkat/ssri/commit/a9f021c)) +* **hexDigest:** added hexDigest method to Integrity objects too ([85208ba](https://github.com/zkat/ssri/commit/85208ba)) +* **integrity:** add .isIntegrity and .isIntegrityMetadata ([1b29e6f](https://github.com/zkat/ssri/commit/1b29e6f)) +* **integrityStream:** new stream that can both generate and check streamed data ([fd23e1b](https://github.com/zkat/ssri/commit/fd23e1b)) +* **parse:** allow parsing straight into a single IntegrityMetadata object ([c8ddf48](https://github.com/zkat/ssri/commit/c8ddf48)) +* **pickAlgorithm:** Intergrity#pickAlgorithm() added ([b97a796](https://github.com/zkat/ssri/commit/b97a796)) +* **size:** calculate and update stream sizes ([02ed1ad](https://github.com/zkat/ssri/commit/02ed1ad)) + + +### BREAKING CHANGES + +* **hashes:** `.isIntegrityMetadata` is now `.isHash`. Also, any references to `IntegrityMetadata` now refer to `Hash`. +* **integrityStream:** createCheckerStream has been removed and replaced with a general-purpose integrityStream. + +To convert existing createCheckerStream code, move the `sri` argument into `opts.integrity` in integrityStream. All other options should be the same. +* **check:** `checkData`, `checkStream`, and `createCheckerStream` now yield a whole IntegrityMetadata instance representing the first successful hash match. + + + +<a name="2.0.0"></a> +# [2.0.0](https://github.com/zkat/ssri/compare/v1.0.0...v2.0.0) (2017-03-24) + + +### Bug Fixes + +* **strict-mode:** make regexes more rigid ([122a32c](https://github.com/zkat/ssri/commit/122a32c)) + + +### Features + +* **api:** added serialize alias for unparse ([999b421](https://github.com/zkat/ssri/commit/999b421)) +* **concat:** add Integrity#concat() ([cae12c7](https://github.com/zkat/ssri/commit/cae12c7)) +* **pickAlgo:** pick the strongest algorithm provided, by default ([58c18f7](https://github.com/zkat/ssri/commit/58c18f7)) +* **strict-mode:** strict SRI support ([3f0b64c](https://github.com/zkat/ssri/commit/3f0b64c)) +* **stringify:** replaced unparse/serialize with stringify ([4acad30](https://github.com/zkat/ssri/commit/4acad30)) +* **verification:** add opts.pickAlgorithm ([f72e658](https://github.com/zkat/ssri/commit/f72e658)) + + +### BREAKING CHANGES + +* **pickAlgo:** ssri will prioritize specific hashes now +* **stringify:** serialize and unparse have been removed. Use ssri.stringify instead. +* **strict-mode:** functions that accepted an optional `sep` argument now expect `opts.sep`. + + + +<a name="1.0.0"></a> +# 1.0.0 (2017-03-23) + + +### Features + +* **api:** implemented initial api ([4fbb16b](https://github.com/zkat/ssri/commit/4fbb16b)) + + +### BREAKING CHANGES + +* **api:** Initial API established. diff --git a/node_modules/cacache/node_modules/ssri/LICENSE.md b/node_modules/cacache/node_modules/ssri/LICENSE.md new file mode 100644 index 000000000..8d28acf86 --- /dev/null +++ b/node_modules/cacache/node_modules/ssri/LICENSE.md @@ -0,0 +1,16 @@ +ISC License + +Copyright (c) npm, Inc. + +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 COPYRIGHT HOLDER DISCLAIMS +ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +COPYRIGHT HOLDER 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. diff --git a/node_modules/cacache/node_modules/ssri/README.md b/node_modules/cacache/node_modules/ssri/README.md new file mode 100644 index 000000000..c250961bd --- /dev/null +++ b/node_modules/cacache/node_modules/ssri/README.md @@ -0,0 +1,488 @@ +# ssri [![npm version](https://img.shields.io/npm/v/ssri.svg)](https://npm.im/ssri) [![license](https://img.shields.io/npm/l/ssri.svg)](https://npm.im/ssri) [![Travis](https://img.shields.io/travis/zkat/ssri.svg)](https://travis-ci.org/zkat/ssri) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/ssri?svg=true)](https://ci.appveyor.com/project/zkat/ssri) [![Coverage Status](https://coveralls.io/repos/github/zkat/ssri/badge.svg?branch=latest)](https://coveralls.io/github/zkat/ssri?branch=latest) + +[`ssri`](https://github.com/zkat/ssri), short for Standard Subresource +Integrity, is a Node.js utility for parsing, manipulating, serializing, +generating, and verifying [Subresource +Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/) hashes. + +## Install + +`$ npm install --save ssri` + +## Table of Contents + +* [Example](#example) +* [Features](#features) +* [Contributing](#contributing) +* [API](#api) + * Parsing & Serializing + * [`parse`](#parse) + * [`stringify`](#stringify) + * [`Integrity#concat`](#integrity-concat) + * [`Integrity#toString`](#integrity-to-string) + * [`Integrity#toJSON`](#integrity-to-json) + * [`Integrity#match`](#integrity-match) + * [`Integrity#pickAlgorithm`](#integrity-pick-algorithm) + * [`Integrity#hexDigest`](#integrity-hex-digest) + * Integrity Generation + * [`fromHex`](#from-hex) + * [`fromData`](#from-data) + * [`fromStream`](#from-stream) + * [`create`](#create) + * Integrity Verification + * [`checkData`](#check-data) + * [`checkStream`](#check-stream) + * [`integrityStream`](#integrity-stream) + +### Example + +```javascript +const ssri = require('ssri') + +const integrity = 'sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo' + +// Parsing and serializing +const parsed = ssri.parse(integrity) +ssri.stringify(parsed) // === integrity (works on non-Integrity objects) +parsed.toString() // === integrity + +// Async stream functions +ssri.checkStream(fs.createReadStream('./my-file'), integrity).then(...) +ssri.fromStream(fs.createReadStream('./my-file')).then(sri => { + sri.toString() === integrity +}) +fs.createReadStream('./my-file').pipe(ssri.createCheckerStream(sri)) + +// Sync data functions +ssri.fromData(fs.readFileSync('./my-file')) // === parsed +ssri.checkData(fs.readFileSync('./my-file'), integrity) // => 'sha512' +``` + +### Features + +* Parses and stringifies SRI strings. +* Generates SRI strings from raw data or Streams. +* Strict standard compliance. +* `?foo` metadata option support. +* Multiple entries for the same algorithm. +* Object-based integrity hash manipulation. +* Small footprint: no dependencies, concise implementation. +* Full test coverage. +* Customizable algorithm picker. + +### Contributing + +The ssri team enthusiastically welcomes contributions and project participation! +There's a bunch of things you can do if you want to contribute! The [Contributor +Guide](CONTRIBUTING.md) has all the information you need for everything from +reporting bugs to contributing entire new features. Please don't hesitate to +jump in if you'd like to, or even ask us questions if something isn't clear. + +### API + +#### <a name="parse"></a> `> ssri.parse(sri, [opts]) -> Integrity` + +Parses `sri` into an `Integrity` data structure. `sri` can be an integrity +string, an `Hash`-like with `digest` and `algorithm` fields and an optional +`options` field, or an `Integrity`-like object. The resulting object will be an +`Integrity` instance that has this shape: + +```javascript +{ + 'sha1': [{algorithm: 'sha1', digest: 'deadbeef', options: []}], + 'sha512': [ + {algorithm: 'sha512', digest: 'c0ffee', options: []}, + {algorithm: 'sha512', digest: 'bad1dea', options: ['foo']} + ], +} +``` + +If `opts.single` is truthy, a single `Hash` object will be returned. That is, a +single object that looks like `{algorithm, digest, options}`, as opposed to a +larger object with multiple of these. + +If `opts.strict` is truthy, the resulting object will be filtered such that +it strictly follows the Subresource Integrity spec, throwing away any entries +with any invalid components. This also means a restricted set of algorithms +will be used -- the spec limits them to `sha256`, `sha384`, and `sha512`. + +Strict mode is recommended if the integrity strings are intended for use in +browsers, or in other situations where strict adherence to the spec is needed. + +##### Example + +```javascript +ssri.parse('sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo') // -> Integrity object +``` + +#### <a name="stringify"></a> `> ssri.stringify(sri, [opts]) -> String` + +This function is identical to [`Integrity#toString()`](#integrity-to-string), +except it can be used on _any_ object that [`parse`](#parse) can handle -- that +is, a string, an `Hash`-like, or an `Integrity`-like. + +The `opts.sep` option defines the string to use when joining multiple entries +together. To be spec-compliant, this _must_ be whitespace. The default is a +single space (`' '`). + +If `opts.strict` is true, the integrity string will be created using strict +parsing rules. See [`ssri.parse`](#parse). + +##### Example + +```javascript +// Useful for cleaning up input SRI strings: +ssri.stringify('\n\rsha512-foo\n\t\tsha384-bar') +// -> 'sha512-foo sha384-bar' + +// Hash-like: only a single entry. +ssri.stringify({ + algorithm: 'sha512', + digest:'9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==', + options: ['foo'] +}) +// -> +// 'sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo' + +// Integrity-like: full multi-entry syntax. Similar to output of `ssri.parse` +ssri.stringify({ + 'sha512': [ + { + algorithm: 'sha512', + digest:'9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==', + options: ['foo'] + } + ] +}) +// -> +// 'sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo' +``` + +#### <a name="integrity-concat"></a> `> Integrity#concat(otherIntegrity, [opts]) -> Integrity` + +Concatenates an `Integrity` object with another IntegrityLike, or an integrity +string. + +This is functionally equivalent to concatenating the string format of both +integrity arguments, and calling [`ssri.parse`](#ssri-parse) on the new string. + +If `opts.strict` is true, the new `Integrity` will be created using strict +parsing rules. See [`ssri.parse`](#parse). + +##### Example + +```javascript +// This will combine the integrity checks for two different versions of +// your index.js file so you can use a single integrity string and serve +// either of these to clients, from a single `<script>` tag. +const desktopIntegrity = ssri.fromData(fs.readFileSync('./index.desktop.js')) +const mobileIntegrity = ssri.fromData(fs.readFileSync('./index.mobile.js')) + +// Note that browsers (and ssri) will succeed as long as ONE of the entries +// for the *prioritized* algorithm succeeds. That is, in order for this fallback +// to work, both desktop and mobile *must* use the same `algorithm` values. +desktopIntegrity.concat(mobileIntegrity) +``` + +#### <a name="integrity-to-string"></a> `> Integrity#toString([opts]) -> String` + +Returns the string representation of an `Integrity` object. All hash entries +will be concatenated in the string by `opts.sep`, which defaults to `' '`. + +If you want to serialize an object that didn't come from an `ssri` function, +use [`ssri.stringify()`](#stringify). + +If `opts.strict` is true, the integrity string will be created using strict +parsing rules. See [`ssri.parse`](#parse). + +##### Example + +```javascript +const integrity = 'sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo' + +ssri.parse(integrity).toString() === integrity +``` + +#### <a name="integrity-to-json"></a> `> Integrity#toJSON() -> String` + +Returns the string representation of an `Integrity` object. All hash entries +will be concatenated in the string by `' '`. + +This is a convenience method so you can pass an `Integrity` object directly to `JSON.stringify`. +For more info check out [toJSON() behavior on mdn](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON%28%29_behavior). + +##### Example + +```javascript +const integrity = '"sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo"' + +JSON.stringify(ssri.parse(integrity)) === integrity +``` + +#### <a name="integrity-match"></a> `> Integrity#match(sri, [opts]) -> Hash | false` + +Returns the matching (truthy) hash if `Integrity` matches the argument passed as +`sri`, which can be anything that [`parse`](#parse) will accept. `opts` will be +passed through to `parse` and [`pickAlgorithm()`](#integrity-pick-algorithm). + +##### Example + +```javascript +const integrity = 'sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==' + +ssri.parse(integrity).match(integrity) +// Hash { +// digest: '9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==' +// algorithm: 'sha512' +// } + +ssri.parse(integrity).match('sha1-deadbeef') +// false +``` + +#### <a name="integrity-pick-algorithm"></a> `> Integrity#pickAlgorithm([opts]) -> String` + +Returns the "best" algorithm from those available in the integrity object. + +If `opts.pickAlgorithm` is provided, it will be passed two algorithms as +arguments. ssri will prioritize whichever of the two algorithms is returned by +this function. Note that the function may be called multiple times, and it +**must** return one of the two algorithms provided. By default, ssri will make +a best-effort to pick the strongest/most reliable of the given algorithms. It +may intentionally deprioritize algorithms with known vulnerabilities. + +##### Example + +```javascript +ssri.parse('sha1-WEakDigEST sha512-yzd8ELD1piyANiWnmdnpCL5F52f10UfUdEkHywVZeqTt0ymgrxR63Qz0GB7TKPoeeZQmWCaz7T1').pickAlgorithm() // sha512 +``` + +#### <a name="integrity-hex-digest"></a> `> Integrity#hexDigest() -> String` + +`Integrity` is assumed to be either a single-hash `Integrity` instance, or a +`Hash` instance. Returns its `digest`, converted to a hex representation of the +base64 data. + +##### Example + +```javascript +ssri.parse('sha1-deadbeef').hexDigest() // '75e69d6de79f' +``` + +#### <a name="from-hex"></a> `> ssri.fromHex(hexDigest, algorithm, [opts]) -> Integrity` + +Creates an `Integrity` object with a single entry, based on a hex-formatted +hash. This is a utility function to help convert existing shasums to the +Integrity format, and is roughly equivalent to something like: + +```javascript +algorithm + '-' + Buffer.from(hexDigest, 'hex').toString('base64') +``` + +`opts.options` may optionally be passed in: it must be an array of option +strings that will be added to all generated integrity hashes generated by +`fromData`. This is a loosely-specified feature of SRIs, and currently has no +specified semantics besides being `?`-separated. Use at your own risk, and +probably avoid if your integrity strings are meant to be used with browsers. + +If `opts.strict` is true, the integrity object will be created using strict +parsing rules. See [`ssri.parse`](#parse). + +If `opts.single` is true, a single `Hash` object will be returned. + +##### Example + +```javascript +ssri.fromHex('75e69d6de79f', 'sha1').toString() // 'sha1-deadbeef' +``` + +#### <a name="from-data"></a> `> ssri.fromData(data, [opts]) -> Integrity` + +Creates an `Integrity` object from either string or `Buffer` data, calculating +all the requested hashes and adding any specified options to the object. + +`opts.algorithms` determines which algorithms to generate hashes for. All +results will be included in a single `Integrity` object. The default value for +`opts.algorithms` is `['sha512']`. All algorithm strings must be hashes listed +in `crypto.getHashes()` for the host Node.js platform. + +`opts.options` may optionally be passed in: it must be an array of option +strings that will be added to all generated integrity hashes generated by +`fromData`. This is a loosely-specified feature of SRIs, and currently has no +specified semantics besides being `?`-separated. Use at your own risk, and +probably avoid if your integrity strings are meant to be used with browsers. + +If `opts.strict` is true, the integrity object will be created using strict +parsing rules. See [`ssri.parse`](#parse). + +##### Example + +```javascript +const integrityObj = ssri.fromData('foobarbaz', { + algorithms: ['sha256', 'sha384', 'sha512'] +}) +integrity.toString('\n') +// -> +// sha256-l981iLWj8kurw4UbNy8Lpxqdzd7UOxS50Glhv8FwfZ0= +// sha384-irnCxQ0CfQhYGlVAUdwTPC9bF3+YWLxlaDGM4xbYminxpbXEq+D+2GCEBTxcjES9 +// sha512-yzd8ELD1piyANiWnmdnpCL5F52f10UfUdEkHywVZeqTt0ymgrxR63Qz0GB7TKPoeeZQmWCaz7T1+9vBnypkYWg== +``` + +#### <a name="from-stream"></a> `> ssri.fromStream(stream, [opts]) -> Promise<Integrity>` + +Returns a Promise of an Integrity object calculated by reading data from +a given `stream`. + +It accepts both `opts.algorithms` and `opts.options`, which are documented as +part of [`ssri.fromData`](#from-data). + +Additionally, `opts.Promise` may be passed in to inject a Promise library of +choice. By default, ssri will use Node's built-in Promises. + +If `opts.strict` is true, the integrity object will be created using strict +parsing rules. See [`ssri.parse`](#parse). + +##### Example + +```javascript +ssri.fromStream(fs.createReadStream('index.js'), { + algorithms: ['sha1', 'sha512'] +}).then(integrity => { + return ssri.checkStream(fs.createReadStream('index.js'), integrity) +}) // succeeds +``` + +#### <a name="create"></a> `> ssri.create([opts]) -> <Hash>` + +Returns a Hash object with `update(<Buffer or string>[,enc])` and `digest()` methods. + + +The Hash object provides the same methods as [crypto class Hash](https://nodejs.org/dist/latest-v6.x/docs/api/crypto.html#crypto_class_hash). +`digest()` accepts no arguments and returns an Integrity object calculated by reading data from +calls to update. + +It accepts both `opts.algorithms` and `opts.options`, which are documented as +part of [`ssri.fromData`](#from-data). + +If `opts.strict` is true, the integrity object will be created using strict +parsing rules. See [`ssri.parse`](#parse). + +##### Example + +```javascript +const integrity = ssri.create().update('foobarbaz').digest() +integrity.toString() +// -> +// sha512-yzd8ELD1piyANiWnmdnpCL5F52f10UfUdEkHywVZeqTt0ymgrxR63Qz0GB7TKPoeeZQmWCaz7T1+9vBnypkYWg== +``` + +#### <a name="check-data"></a> `> ssri.checkData(data, sri, [opts]) -> Hash|false` + +Verifies `data` integrity against an `sri` argument. `data` may be either a +`String` or a `Buffer`, and `sri` can be any subresource integrity +representation that [`ssri.parse`](#parse) can handle. + +If verification succeeds, `checkData` will return the name of the algorithm that +was used for verification (a truthy value). Otherwise, it will return `false`. + +If `opts.pickAlgorithm` is provided, it will be used by +[`Integrity#pickAlgorithm`](#integrity-pick-algorithm) when deciding which of +the available digests to match against. + +If `opts.error` is true, and verification fails, `checkData` will throw either +an `EBADSIZE` or an `EINTEGRITY` error, instead of just returning false. + +##### Example + +```javascript +const data = fs.readFileSync('index.js') +ssri.checkData(data, ssri.fromData(data)) // -> 'sha512' +ssri.checkData(data, 'sha256-l981iLWj8kurw4UbNy8Lpxqdzd7UOxS50Glhv8FwfZ0') +ssri.checkData(data, 'sha1-BaDDigEST') // -> false +ssri.checkData(data, 'sha1-BaDDigEST', {error: true}) // -> Error! EINTEGRITY +``` + +#### <a name="check-stream"></a> `> ssri.checkStream(stream, sri, [opts]) -> Promise<Hash>` + +Verifies the contents of `stream` against an `sri` argument. `stream` will be +consumed in its entirety by this process. `sri` can be any subresource integrity +representation that [`ssri.parse`](#parse) can handle. + +`checkStream` will return a Promise that either resolves to the +`Hash` that succeeded verification, or, if the verification fails +or an error happens with `stream`, the Promise will be rejected. + +If the Promise is rejected because verification failed, the returned error will +have `err.code` as `EINTEGRITY`. + +If `opts.size` is given, it will be matched against the stream size. An error +with `err.code` `EBADSIZE` will be returned by a rejection if the expected size +and actual size fail to match. + +If `opts.pickAlgorithm` is provided, it will be used by +[`Integrity#pickAlgorithm`](#integrity-pick-algorithm) when deciding which of +the available digests to match against. + +##### Example + +```javascript +const integrity = ssri.fromData(fs.readFileSync('index.js')) + +ssri.checkStream( + fs.createReadStream('index.js'), + integrity +) +// -> +// Promise<{ +// algorithm: 'sha512', +// digest: 'sha512-yzd8ELD1piyANiWnmdnpCL5F52f10UfUdEkHywVZeqTt0ymgrxR63Qz0GB7TKPoeeZQmWCaz7T1' +// }> + +ssri.checkStream( + fs.createReadStream('index.js'), + 'sha256-l981iLWj8kurw4UbNy8Lpxqdzd7UOxS50Glhv8FwfZ0' +) // -> Promise<Hash> + +ssri.checkStream( + fs.createReadStream('index.js'), + 'sha1-BaDDigEST' +) // -> Promise<Error<{code: 'EINTEGRITY'}>> +``` + +#### <a name="integrity-stream"></a> `> integrityStream([opts]) -> IntegrityStream` + +Returns a `Transform` stream that data can be piped through in order to generate +and optionally check data integrity for piped data. When the stream completes +successfully, it emits `size` and `integrity` events, containing the total +number of bytes processed and a calculated `Integrity` instance based on stream +data, respectively. + +If `opts.algorithms` is passed in, the listed algorithms will be calculated when +generating the final `Integrity` instance. The default is `['sha512']`. + +If `opts.single` is passed in, a single `Hash` instance will be returned. + +If `opts.integrity` is passed in, it should be an `integrity` value understood +by [`parse`](#parse) that the stream will check the data against. If +verification succeeds, the integrity stream will emit a `verified` event whose +value is a single `Hash` object that is the one that succeeded verification. If +verification fails, the stream will error with an `EINTEGRITY` error code. + +If `opts.size` is given, it will be matched against the stream size. An error +with `err.code` `EBADSIZE` will be emitted by the stream if the expected size +and actual size fail to match. + +If `opts.pickAlgorithm` is provided, it will be passed two algorithms as +arguments. ssri will prioritize whichever of the two algorithms is returned by +this function. Note that the function may be called multiple times, and it +**must** return one of the two algorithms provided. By default, ssri will make +a best-effort to pick the strongest/most reliable of the given algorithms. It +may intentionally deprioritize algorithms with known vulnerabilities. + +##### Example + +```javascript +const integrity = ssri.fromData(fs.readFileSync('index.js')) +fs.createReadStream('index.js') +.pipe(ssri.integrityStream({integrity})) +``` diff --git a/node_modules/cacache/node_modules/ssri/index.js b/node_modules/cacache/node_modules/ssri/index.js new file mode 100644 index 000000000..d4c9e49c4 --- /dev/null +++ b/node_modules/cacache/node_modules/ssri/index.js @@ -0,0 +1,377 @@ +'use strict' + +const crypto = require('crypto') +const Transform = require('stream').Transform + +const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512'] + +const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i +const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/ +const STRICT_SRI_REGEX = /^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/ +const VCHAR_REGEX = /^[\x21-\x7E]+$/ + +class Hash { + get isHash () { return true } + constructor (hash, opts) { + const strict = !!(opts && opts.strict) + this.source = hash.trim() + // 3.1. Integrity metadata (called "Hash" by ssri) + // https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description + const match = this.source.match( + strict + ? STRICT_SRI_REGEX + : SRI_REGEX + ) + if (!match) { return } + if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return } + this.algorithm = match[1] + this.digest = match[2] + + const rawOpts = match[3] + this.options = rawOpts ? rawOpts.slice(1).split('?') : [] + } + hexDigest () { + return this.digest && Buffer.from(this.digest, 'base64').toString('hex') + } + toJSON () { + return this.toString() + } + toString (opts) { + if (opts && opts.strict) { + // Strict mode enforces the standard as close to the foot of the + // letter as it can. + if (!( + // The spec has very restricted productions for algorithms. + // https://www.w3.org/TR/CSP2/#source-list-syntax + SPEC_ALGORITHMS.some(x => x === this.algorithm) && + // Usually, if someone insists on using a "different" base64, we + // leave it as-is, since there's multiple standards, and the + // specified is not a URL-safe variant. + // https://www.w3.org/TR/CSP2/#base64_value + this.digest.match(BASE64_REGEX) && + // Option syntax is strictly visual chars. + // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression + // https://tools.ietf.org/html/rfc5234#appendix-B.1 + (this.options || []).every(opt => opt.match(VCHAR_REGEX)) + )) { + return '' + } + } + const options = this.options && this.options.length + ? `?${this.options.join('?')}` + : '' + return `${this.algorithm}-${this.digest}${options}` + } +} + +class Integrity { + get isIntegrity () { return true } + toJSON () { + return this.toString() + } + toString (opts) { + opts = opts || {} + let sep = opts.sep || ' ' + if (opts.strict) { + // Entries must be separated by whitespace, according to spec. + sep = sep.replace(/\S+/g, ' ') + } + return Object.keys(this).map(k => { + return this[k].map(hash => { + return Hash.prototype.toString.call(hash, opts) + }).filter(x => x.length).join(sep) + }).filter(x => x.length).join(sep) + } + concat (integrity, opts) { + const other = typeof integrity === 'string' + ? integrity + : stringify(integrity, opts) + return parse(`${this.toString(opts)} ${other}`, opts) + } + hexDigest () { + return parse(this, {single: true}).hexDigest() + } + match (integrity, opts) { + const other = parse(integrity, opts) + const algo = other.pickAlgorithm(opts) + return ( + this[algo] && + other[algo] && + this[algo].find(hash => + other[algo].find(otherhash => + hash.digest === otherhash.digest + ) + ) + ) || false + } + pickAlgorithm (opts) { + const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash + const keys = Object.keys(this) + if (!keys.length) { + throw new Error(`No algorithms available for ${ + JSON.stringify(this.toString()) + }`) + } + return keys.reduce((acc, algo) => { + return pickAlgorithm(acc, algo) || acc + }) + } +} + +module.exports.parse = parse +function parse (sri, opts) { + opts = opts || {} + if (typeof sri === 'string') { + return _parse(sri, opts) + } else if (sri.algorithm && sri.digest) { + const fullSri = new Integrity() + fullSri[sri.algorithm] = [sri] + return _parse(stringify(fullSri, opts), opts) + } else { + return _parse(stringify(sri, opts), opts) + } +} + +function _parse (integrity, opts) { + // 3.4.3. Parse metadata + // https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata + if (opts.single) { + return new Hash(integrity, opts) + } + return integrity.trim().split(/\s+/).reduce((acc, string) => { + const hash = new Hash(string, opts) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) +} + +module.exports.stringify = stringify +function stringify (obj, opts) { + if (obj.algorithm && obj.digest) { + return Hash.prototype.toString.call(obj, opts) + } else if (typeof obj === 'string') { + return stringify(parse(obj, opts), opts) + } else { + return Integrity.prototype.toString.call(obj, opts) + } +} + +module.exports.fromHex = fromHex +function fromHex (hexDigest, algorithm, opts) { + const optString = (opts && opts.options && opts.options.length) + ? `?${opts.options.join('?')}` + : '' + return parse( + `${algorithm}-${ + Buffer.from(hexDigest, 'hex').toString('base64') + }${optString}`, opts + ) +} + +module.exports.fromData = fromData +function fromData (data, opts) { + opts = opts || {} + const algorithms = opts.algorithms || ['sha512'] + const optString = opts.options && opts.options.length + ? `?${opts.options.join('?')}` + : '' + return algorithms.reduce((acc, algo) => { + const digest = crypto.createHash(algo).update(data).digest('base64') + const hash = new Hash( + `${algo}-${digest}${optString}`, + opts + ) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) +} + +module.exports.fromStream = fromStream +function fromStream (stream, opts) { + opts = opts || {} + const P = opts.Promise || Promise + const istream = integrityStream(opts) + return new P((resolve, reject) => { + stream.pipe(istream) + stream.on('error', reject) + istream.on('error', reject) + let sri + istream.on('integrity', s => { sri = s }) + istream.on('end', () => resolve(sri)) + istream.on('data', () => {}) + }) +} + +module.exports.checkData = checkData +function checkData (data, sri, opts) { + opts = opts || {} + sri = parse(sri, opts) + if (!Object.keys(sri).length) { + if (opts.error) { + throw Object.assign( + new Error('No valid integrity hashes to check against'), { + code: 'EINTEGRITY' + } + ) + } else { + return false + } + } + const algorithm = sri.pickAlgorithm(opts) + const digest = crypto.createHash(algorithm).update(data).digest('base64') + const newSri = parse({algorithm, digest}) + const match = newSri.match(sri, opts) + if (match || !opts.error) { + return match + } else if (typeof opts.size === 'number' && (data.length !== opts.size)) { + const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`) + err.code = 'EBADSIZE' + err.found = data.length + err.expected = opts.size + err.sri = sri + throw err + } else { + const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`) + err.code = 'EINTEGRITY' + err.found = newSri + err.expected = sri + err.algorithm = algorithm + err.sri = sri + throw err + } +} + +module.exports.checkStream = checkStream +function checkStream (stream, sri, opts) { + opts = opts || {} + const P = opts.Promise || Promise + const checker = integrityStream(Object.assign({}, opts, { + integrity: sri + })) + return new P((resolve, reject) => { + stream.pipe(checker) + stream.on('error', reject) + checker.on('error', reject) + let sri + checker.on('verified', s => { sri = s }) + checker.on('end', () => resolve(sri)) + checker.on('data', () => {}) + }) +} + +module.exports.integrityStream = integrityStream +function integrityStream (opts) { + opts = opts || {} + // For verification + const sri = opts.integrity && parse(opts.integrity, opts) + const goodSri = sri && Object.keys(sri).length + const algorithm = goodSri && sri.pickAlgorithm(opts) + const digests = goodSri && sri[algorithm] + // Calculating stream + const algorithms = Array.from( + new Set( + (opts.algorithms || ['sha512']) + .concat(algorithm ? [algorithm] : []) + ) + ) + const hashes = algorithms.map(crypto.createHash) + let streamSize = 0 + const stream = new Transform({ + transform (chunk, enc, cb) { + streamSize += chunk.length + hashes.forEach(h => h.update(chunk, enc)) + cb(null, chunk, enc) + } + }).on('end', () => { + const optString = (opts.options && opts.options.length) + ? `?${opts.options.join('?')}` + : '' + const newSri = parse(hashes.map((h, i) => { + return `${algorithms[i]}-${h.digest('base64')}${optString}` + }).join(' '), opts) + // Integrity verification mode + const match = goodSri && newSri.match(sri, opts) + if (typeof opts.size === 'number' && streamSize !== opts.size) { + const err = new Error(`stream size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${streamSize}`) + err.code = 'EBADSIZE' + err.found = streamSize + err.expected = opts.size + err.sri = sri + stream.emit('error', err) + } else if (opts.integrity && !match) { + const err = new Error(`${sri} integrity checksum failed when using ${algorithm}: wanted ${digests} but got ${newSri}. (${streamSize} bytes)`) + err.code = 'EINTEGRITY' + err.found = newSri + err.expected = digests + err.algorithm = algorithm + err.sri = sri + stream.emit('error', err) + } else { + stream.emit('size', streamSize) + stream.emit('integrity', newSri) + match && stream.emit('verified', match) + } + }) + return stream +} + +module.exports.create = createIntegrity +function createIntegrity (opts) { + opts = opts || {} + const algorithms = opts.algorithms || ['sha512'] + const optString = opts.options && opts.options.length + ? `?${opts.options.join('?')}` + : '' + + const hashes = algorithms.map(crypto.createHash) + + return { + update: function (chunk, enc) { + hashes.forEach(h => h.update(chunk, enc)) + return this + }, + digest: function (enc) { + const integrity = algorithms.reduce((acc, algo) => { + const digest = hashes.shift().digest('base64') + const hash = new Hash( + `${algo}-${digest}${optString}`, + opts + ) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) + + return integrity + } + } +} + +const NODE_HASHES = new Set(crypto.getHashes()) + +// This is a Best Effort™ at a reasonable priority for hash algos +const DEFAULT_PRIORITY = [ + 'md5', 'whirlpool', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', + // TODO - it's unclear _which_ of these Node will actually use as its name + // for the algorithm, so we guesswork it based on the OpenSSL names. + 'sha3', + 'sha3-256', 'sha3-384', 'sha3-512', + 'sha3_256', 'sha3_384', 'sha3_512' +].filter(algo => NODE_HASHES.has(algo)) + +function getPrioritizedHash (algo1, algo2) { + return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase()) + ? algo1 + : algo2 +} diff --git a/node_modules/cacache/node_modules/ssri/package.json b/node_modules/cacache/node_modules/ssri/package.json new file mode 100644 index 000000000..3c57de04b --- /dev/null +++ b/node_modules/cacache/node_modules/ssri/package.json @@ -0,0 +1,87 @@ +{ + "_from": "ssri@^6.0.0", + "_id": "ssri@6.0.0", + "_inBundle": false, + "_integrity": "sha512-zYOGfVHPhxyzwi8MdtdNyxv3IynWCIM4jYReR48lqu0VngxgH1c+C6CmipRdJ55eVByTJV/gboFEEI7TEQI8DA==", + "_location": "/cacache/ssri", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ssri@^6.0.0", + "name": "ssri", + "escapedName": "ssri", + "rawSpec": "^6.0.0", + "saveSpec": null, + "fetchSpec": "^6.0.0" + }, + "_requiredBy": [ + "/cacache" + ], + "_resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.0.tgz", + "_shasum": "fc21bfc90e03275ac3e23d5a42e38b8a1cbc130d", + "_spec": "ssri@^6.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/cacache", + "author": { + "name": "Kat Marchán", + "email": "kzm@sykosomatic.org" + }, + "bugs": { + "url": "https://github.com/zkat/ssri/issues" + }, + "bundleDependencies": false, + "config": { + "nyc": { + "exclude": [ + "node_modules/**", + "test/**" + ] + } + }, + "dependencies": {}, + "deprecated": false, + "description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.", + "devDependencies": { + "nyc": "^11.4.1", + "standard": "^10.0.3", + "standard-version": "^4.3.0", + "tap": "^11.1.0", + "weallbehave": "^1.2.0", + "weallcontribute": "^1.0.8" + }, + "files": [ + "*.js" + ], + "homepage": "https://github.com/zkat/ssri#readme", + "keywords": [ + "w3c", + "web", + "security", + "integrity", + "checksum", + "hashing", + "subresource integrity", + "sri", + "sri hash", + "sri string", + "sri generator", + "html" + ], + "license": "ISC", + "main": "index.js", + "name": "ssri", + "repository": { + "type": "git", + "url": "git+https://github.com/zkat/ssri.git" + }, + "scripts": { + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --coverage test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + }, + "version": "6.0.0" +} diff --git a/node_modules/cacache/package.json b/node_modules/cacache/package.json index 64a6de607..73f3fb384 100644 --- a/node_modules/cacache/package.json +++ b/node_modules/cacache/package.json @@ -1,30 +1,28 @@ { - "_from": "cacache@latest", - "_id": "cacache@10.0.4", + "_from": "cacache@11.0.1", + "_id": "cacache@11.0.1", "_inBundle": false, - "_integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", + "_integrity": "sha512-s5YA8Lva1PF76kHDquIPW1N0YJXNFiItwrrDXAn8vvunOv/VNXOR1LtQYgPBRpaweIX2xSaBpqIXCYeOTZfHSQ==", "_location": "/cacache", "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "version", "registry": true, - "raw": "cacache@latest", + "raw": "cacache@11.0.1", "name": "cacache", "escapedName": "cacache", - "rawSpec": "latest", + "rawSpec": "11.0.1", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "11.0.1" }, "_requiredBy": [ "#USER", - "/", - "/pacote", - "/pacote/make-fetch-happen" + "/" ], - "_resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", - "_shasum": "6452367999eff9d4188aefd9a14e9d7c6a263460", - "_spec": "cacache@latest", - "_where": "/Users/zkat/Documents/code/npm", + "_resolved": "https://registry.npmjs.org/cacache/-/cacache-11.0.1.tgz", + "_shasum": "63cde88b51aa5f50741e34833c9d0048a138d1dd", + "_spec": "cacache@11.0.1", + "_where": "/Users/rebecca/code/npm", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -58,15 +56,16 @@ "dependencies": { "bluebird": "^3.5.1", "chownr": "^1.0.1", + "figgy-pudding": "^3.1.0", "glob": "^7.1.2", "graceful-fs": "^4.1.11", - "lru-cache": "^4.1.1", - "mississippi": "^2.0.0", + "lru-cache": "^4.1.2", + "mississippi": "^3.0.0", "mkdirp": "^0.5.1", "move-concurrently": "^1.0.1", "promise-inflight": "^1.0.1", "rimraf": "^2.6.2", - "ssri": "^5.2.4", + "ssri": "^6.0.0", "unique-filename": "^1.1.0", "y18n": "^4.0.0" }, @@ -74,15 +73,14 @@ "description": "Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.", "devDependencies": { "benchmark": "^2.1.4", - "chalk": "^2.3.1", - "cross-env": "^5.1.3", - "nyc": "^11.4.1", + "chalk": "^2.3.2", + "cross-env": "^5.1.4", "require-inject": "^1.4.2", "safe-buffer": "^5.1.1", - "standard": "^10.0.3", + "standard": "^11.0.1", "standard-version": "^4.3.0", "tacks": "^1.2.2", - "tap": "^11.1.0", + "tap": "^11.1.3", "weallbehave": "^1.2.0", "weallcontribute": "^1.0.8" }, @@ -120,10 +118,10 @@ "prerelease": "npm t", "pretest": "standard", "release": "standard-version -s", - "test": "cross-env CACACHE_UPDATE_LOCALE_FILES=true nyc --all -- tap -J test/*.js", + "test": "cross-env CACACHE_UPDATE_LOCALE_FILES=true tap --coverage --nyc-arg=--all -J test/*.js", "test-docker": "docker run -it --rm --name pacotest -v \"$PWD\":/tmp -w /tmp node:latest npm test", "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "10.0.4" + "version": "11.0.1" } diff --git a/node_modules/cacache/put.js b/node_modules/cacache/put.js index fe1293e5e..0b0ee1497 100644 --- a/node_modules/cacache/put.js +++ b/node_modules/cacache/put.js @@ -1,17 +1,31 @@ 'use strict' +const figgyPudding = require('figgy-pudding') const index = require('./lib/entry-index') const memo = require('./lib/memoization') const write = require('./lib/content/write') const to = require('mississippi').to +const PutOpts = figgyPudding({ + algorithms: { + default: ['sha512'] + }, + integrity: {}, + memoize: {}, + metadata: {}, + size: {}, + tmpPrefix: {}, + uid: {}, + gid: {} +}) + module.exports = putData function putData (cache, key, data, opts) { - opts = opts || {} + opts = PutOpts(opts) return write(cache, data, opts).then(res => { - // TODO - stop modifying opts - opts.size = res.size - return index.insert(cache, key, res.integrity, opts).then(entry => { + return index.insert( + cache, key, res.integrity, opts.concat({size: res.size}) + ).then(entry => { if (opts.memoize) { memo.put(cache, entry, data, opts) } @@ -22,7 +36,7 @@ function putData (cache, key, data, opts) { module.exports.stream = putStream function putStream (cache, key, opts) { - opts = opts || {} + opts = PutOpts(opts) let integrity let size const contentStream = write.stream( @@ -45,9 +59,7 @@ function putStream (cache, key, opts) { }) }, cb => { contentStream.end(() => { - // TODO - stop modifying `opts` - opts.size = size - index.insert(cache, key, integrity, opts).then(entry => { + index.insert(cache, key, integrity, opts.concat({size})).then(entry => { if (opts.memoize) { memo.put(cache, entry, Buffer.concat(memoData, memoTotal), opts) } |