diff options
Diffstat (limited to 'node_modules/gulp-gzip')
158 files changed, 9412 insertions, 0 deletions
diff --git a/node_modules/gulp-gzip/.npmignore b/node_modules/gulp-gzip/.npmignore new file mode 100755 index 000000000..6c82eac7a --- /dev/null +++ b/node_modules/gulp-gzip/.npmignore @@ -0,0 +1,11 @@ +node_modules +.DS_STORE +examples/**.txt +!examples/files/*.txt +examples/**.txt.gz +!examples/files/*.txt.gz +test/**.txt +!test/files/*.txt +test/**.txt.gz +!test/files/*.txt.gz +test/tmp diff --git a/node_modules/gulp-gzip/LICENSE b/node_modules/gulp-gzip/LICENSE new file mode 100755 index 000000000..eafa7f514 --- /dev/null +++ b/node_modules/gulp-gzip/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2014 Jeremy Stuckey + +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/gulp-gzip/README.md b/node_modules/gulp-gzip/README.md new file mode 100755 index 000000000..807c2c577 --- /dev/null +++ b/node_modules/gulp-gzip/README.md @@ -0,0 +1,142 @@ +gulp-gzip +========= + +Gzip plugin for [gulp](https://github.com/wearefractal/gulp). + +#Install + +``` +npm install --save-dev gulp-gzip +``` + +#Options + +### append `Boolean` + +Appends `.gz` file extension if true. Defaults to true. + +```javascript + gzip({ append: true }) +``` +`filename.txt` becomes `filename.txt.gz`. + +### extension `String` + +Appends an arbitrary extension to the filename. Disables `append` and `preExtension` options. + +```javascript + gzip({ extension: 'zip' }) // note that the `.` should not be included in the extension +``` +`filename.txt` becomes `filename.txt.zip`. + +### preExtension `String` + +Appends an arbitrary pre-extension to the filename. Disables `append` and `extension` options. + +```javascript + gzip({ preExtension: 'gz' }) // note that the `.` should not be included in the extension +``` +`filename.txt` becomes `filename.gz.txt`. + +### threshold `String|Number|Boolean` + +Minimum size required to compress a file. Defaults to false. + +```javascript +gzip({ threshold: '1kb' }) +``` + +```javascript +gzip({ threshold: 1024 }) +``` + +```javascript +gzip({ threshold: true }) +``` + +### gzipOptions `Object` + +Options object to pass through to zlib.Gzip. See [zlib documentation](http://nodejs.org/api/zlib.html#zlib_options) for more information. + +```javascript +gzip({ gzipOptions: { level: 9 } }) +``` + +```javascript +gzip({ gzipOptions: { memLevel: 1 } }) +``` + +### deleteMode `String|Function` + +Some webserver modules such as nginx `gzip_static` looks for `example.html.gz`, serve it if it exists, else the original `example.html` will be served. + +For instance, if `example.html` was 2kb, it would be gzipped and `example.html.gz` was created. + +However, if later `example.html` is modified to content less than the threshold, gulp-gzip will only bypass it. Hence, you will end up with a new `example.html` yet old `example.html.gz`. Your webserver will continue to serve old content (`example.html.gz`). + +Using this option, gulp-gzip will remove `example.html.gz`. + +It takes in the same argument as `gulp.dest` as in `gulp.dest('mydest')`, so it knows where to look for the gzipped files. Defaults to `undefined`. + +```javascript +gzip({ threshold: 1024, deleteMode: 'mydest' }) +``` + +If you have `cwd` as in `gulp.dest('mydest', { cwd: mycwd })`. You can configure it using `deleteModeCwd`. + +```javascript +gzip({ threshold: 1024, deleteMode: 'mydest', deleteModeCwd: mycwd }) +``` + +### skipGrowingFiles `Boolean` + +Some files actually get larger after compression. If true, this option passes along the original, uncompressed file if compression increases the file size. Defaults to false. + +```javascript + gzip({ skipGrowingFiles : true }) +``` + +#Examples + +```javascript +var gulp = require('gulp'); +var gzip = require('gulp-gzip'); + +gulp.task('compress', function() { + gulp.src('./dev/scripts/*.js') + .pipe(gzip()) + .pipe(gulp.dest('./public/scripts')); +}); +``` + +```javascript +var gulp = require('gulp'); +var coffee = require('gulp-coffee'); +var concat = require('gulp-concat'); +var uglify = require('gulp-uglify'); +var gzip = require('gulp-gzip'); + +gulp.task('deployScripts', function() { + gulp.src('./dev/scripts/*.coffee') + .pipe(coffee()) + .pipe(concat('all.js')) + .pipe(uglify()) + .pipe(gzip()) + .pipe(gulp.dest('./public/scripts')); +}); +``` + +```javascript +var gulp = require('gulp'); +var tar = require('gulp-tar'); +var gzip = require('gulp-gzip'); + +gulp.task('tarball', function() { + gulp.src('./files/*') + .pipe(tar('archive.tar')) + .pipe(gzip()) + .pipe(gulp.dest('.')); +}); +``` + +[More examples](https://github.com/jstuckey/gulp-gzip/tree/master/examples). diff --git a/node_modules/gulp-gzip/examples/advanced/gulpfile.js b/node_modules/gulp-gzip/examples/advanced/gulpfile.js new file mode 100755 index 000000000..a2a747df5 --- /dev/null +++ b/node_modules/gulp-gzip/examples/advanced/gulpfile.js @@ -0,0 +1,32 @@ +var clean = require('gulp-clean'); +var gulp = require('gulp'); +var gzip = require('../../index'); + +var config = { + threshold: '1kb' +}; + +gulp.task('clean', function() { + gulp.src('tmp', { read: false }) + .pipe(clean()); +}); + +gulp.task('small', function() { + gulp.src('../files/small.txt') + .pipe(gzip(config)) + .pipe(gulp.dest('tmp')); +}); + +gulp.task('big', function() { + gulp.src('../files/big.txt') + .pipe(gzip(config)) + .pipe(gulp.dest('tmp')); +}); + +gulp.task('large', function() { + gulp.src('../files/large.txt', { buffer: false }) + .pipe(gzip(config)) + .pipe(gulp.dest('tmp')); +}); + +gulp.task('default', ['clean', 'small', 'big', 'large']); diff --git a/node_modules/gulp-gzip/examples/files/big.txt b/node_modules/gulp-gzip/examples/files/big.txt new file mode 100755 index 000000000..61779e6d4 --- /dev/null +++ b/node_modules/gulp-gzip/examples/files/big.txt @@ -0,0 +1 @@ +Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus, eaque animi autem distinctio assumenda. Necessitatibus, dicta, aliquam architecto aut error quaerat at beatae harum modi earum sequi accusantium labore nisi rerum neque nemo et quae dolorem voluptas dolorum blanditiis accusamus repellat illo saepe quisquam alias doloribus non temporibus quasi maiores distinctio eos unde ad ipsam excepturi vel praesentium repudiandae minus amet consequatur suscipit laboriosam qui asperiores possimus exercitationem nesciunt ratione odio reprehenderit deserunt iure! Doloremque deserunt rem vitae iure ipsam esse tempore veritatis voluptate natus blanditiis. Velit, porro, fuga enim quasi voluptatum praesentium ea autem fugit unde non architecto quisquam reprehenderit cumque laboriosam dolore saepe eligendi similique iste quis expedita beatae itaque possimus repellendus officiis nam minima blanditiis numquam voluptatem optio temporibus asperiores adipisci quas necessitatibus cum natus hic provident? Autem, atque, voluptate, dicta, sequi adipisci doloribus aspernatur ipsa beatae rem odio doloremque odit consequuntur vitae cupiditate quos repellendus id eligendi excepturi pariatur molestiae praesentium quasi perspiciatis quaerat quisquam blanditiis architecto minus ad possimus porro illum quibusdam ipsam culpa voluptatibus iste ex earum quae quam laboriosam deleniti in expedita esse! Nihil, laboriosam, rem, consequatur ullam ipsam reiciendis tempora aliquam quos cupiditate saepe facere recusandae tenetur odio nulla officia molestiae atque harum ipsa nobis dolorum voluptatum suscipit consequuntur deleniti iusto delectus hic a numquam neque aliquid asperiores ipsum impedit nisi voluptas beatae facilis culpa eveniet unde animi architecto omnis fugiat magni? Placeat, autem, vero, aspernatur, ab impedit nisi delectus sequi hic aliquid officia cupiditate praesentium voluptates veniam doloremque cumque aliquam enim quas reprehenderit aut dolor possimus inventore saepe fuga in dignissimos ipsam ut et eum sed tempore error a labore beatae incidunt repellat animi perferendis rerum iure tempora odio nam earum nulla asperiores est laboriosam facilis? Perspiciatis, fugiat, veniam, voluptatem ad eligendi optio veritatis autem voluptas deleniti incidunt provident soluta mollitia nesciunt fugit recusandae. Porro, nostrum, ab, inventore velit quidem impedit voluptatum placeat tempora mollitia unde nisi itaque dolorum perspiciatis temporibus excepturi omnis nobis. Itaque, provident, laudantium aperiam unde ex laborum vero quam placeat porro accusantium quia non alias facilis illum corporis dolor voluptatum aspernatur expedita deserunt labore beatae illo nobis hic ea vel omnis velit iste magnam odit asperiores delectus autem praesentium minima recusandae ipsa nisi eligendi ipsam. Est, animi, ipsam natus culpa cumque excepturi molestiae sit tenetur rem aspernatur assumenda laborum sequi sed tempora praesentium rerum reiciendis qui quidem cum possimus. Dolorem, ad delectus temporibus quasi repudiandae dicta repellendus! diff --git a/node_modules/gulp-gzip/examples/files/small.txt b/node_modules/gulp-gzip/examples/files/small.txt new file mode 100755 index 000000000..a18737279 --- /dev/null +++ b/node_modules/gulp-gzip/examples/files/small.txt @@ -0,0 +1 @@ +Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quis, eaque, rerum maxime quod repellat ipsam modi sit voluptatibus quidem et. Mollitia dicta atque modi. Recusandae, doloribus dolores praesentium culpa quisquam quasi maiores aperiam itaque minima incidunt hic in similique quas. Unde, ut nam ipsum doloribus praesentium neque sapiente dolorum beatae totam rem! Tempora, dolorem, nesciunt, dolorum veritatis earum aliquam a quae rem saepe vitae quaerat ex aliquid voluptates eum nobis repellat natus neque voluptatem veniam exercitationem nam eaque iste sequi officia perspiciatis! Earum, hic alias aperiam repellat tenetur labore mollitia unde dolorum eligendi consequatur asperiores neque excepturi officia? Ducimus sed velit ipsa iure libero eos doloremque at eveniet facilis quibusdam! Optio, veniam adipisci eius error sequi. Pariatur, vitae vero quia et illum alias saepe aperiam enim! Deleniti ipsam repellat labore. diff --git a/node_modules/gulp-gzip/examples/simple/gulpfile.js b/node_modules/gulp-gzip/examples/simple/gulpfile.js new file mode 100755 index 000000000..503db6914 --- /dev/null +++ b/node_modules/gulp-gzip/examples/simple/gulpfile.js @@ -0,0 +1,16 @@ +var clean = require('gulp-clean'); +var gulp = require('gulp'); +var gzip = require('../../index'); + +gulp.task('clean', function() { + gulp.src('tmp', { read: false }) + .pipe(clean()); +}); + +gulp.task('compress', ['clean'], function() { + gulp.src('../files/small.txt') + .pipe(gzip()) + .pipe(gulp.dest('tmp')); +}); + +gulp.task('default', ['compress']); diff --git a/node_modules/gulp-gzip/gulpfile.js b/node_modules/gulp-gzip/gulpfile.js new file mode 100755 index 000000000..95ce6781a --- /dev/null +++ b/node_modules/gulp-gzip/gulpfile.js @@ -0,0 +1,40 @@ +var clean = require('gulp-clean'); +var filter = require('gulp-filter'); +var gulp = require('gulp'); +var mocha = require('gulp-mocha'); +var watch = require('gulp-watch'); +var jshint = require('gulp-jshint'); +var stylish = require('jshint-stylish'); + +var root = __dirname; + +gulp.task('clean', function() { + gulp.src([ + 'examples/*/tmp', + 'test/tmp' + ]).pipe(clean()); +}); + +gulp.task('lint', function() { + gulp.src([ 'index.js', 'test/test.js', 'lib/*.js' ]) + .pipe(jshint({ expr: true })) + .pipe(jshint.reporter(stylish)); +}); + +gulp.task('test', function() { + // monkeys are fixing `cwd` for `gulp-mocha` + // node lives in one process/scope/directory + process.chdir(root); + + gulp.src('test/test.js') + .pipe(mocha({ reporter: 'spec', timeout: 1000 })) +}); + +gulp.task('watch', function() { + watch({ + glob: [ 'index.js', 'lib/*.js' , 'test/test.js' ], + read: false + }, ['clean', 'lint', 'test']) +}); + +gulp.task('default', ['watch']); diff --git a/node_modules/gulp-gzip/index.js b/node_modules/gulp-gzip/index.js new file mode 100755 index 000000000..7cda8d324 --- /dev/null +++ b/node_modules/gulp-gzip/index.js @@ -0,0 +1,104 @@ +/*jslint node: true */ +'use strict'; + +var fs = require('fs'); +var path = require('path'); +var gutil = require('gulp-util'); +var through2 = require('through2'); +var PluginError = gutil.PluginError; +var utils = require('./lib/utils'); +var compress = require('./lib/compress.js'); + +var PLUGIN_NAME = 'gulp-gzip'; + +module.exports = function (options) { + + // Combine user defined options with default options + var defaultConfig = { + append: true, + threshold: false, + gzipOptions: {}, + skipGrowingFiles: false + }; + var config = utils.merge(defaultConfig, options); + + // Create a through2 object stream. This is our plugin export + var stream = through2.obj(gulpGzip); + + // Expose the config so we can test it + stream.config = config; + + function gulpGzip(file, enc, done) { + + /*jshint validthis: true */ + var self = this; + + // Check for empty file + if (file.isNull()) { + // Pass along the empty file to the next plugin + self.push(file); + done(); + return; + } + + // Call when finished with compression + var finished = function(err, contents, wasCompressed) { + if (err) { + var error = new PluginError(PLUGIN_NAME, err, { showStack: true }); + self.emit('error', error); + done(); + return; + } + + var complete = function() { + file.contents = contents; + self.push(file); + done(); + }; + + var getFixedPath = function(filepath) { + if (config.extension) { + filepath += '.' + config.extension; + } else if (config.preExtension) { + filepath = filepath.replace(/(\.[^\.]+)$/, '.' + config.preExtension + '$1'); + } else if (config.append) { + filepath += '.gz'; + } + + return filepath; + }; + + if (wasCompressed) { + if (file.contentEncoding) { + file.contentEncoding.push('gzip'); + } else { + file.contentEncoding = [ 'gzip' ]; + } + + file.path = getFixedPath(file.path); + complete(); + } else if (config.deleteMode) { + var cwd = path.resolve(config.deleteModeCwd || process.cwd()); + var directory = typeof config.deleteMode === 'string' ? config.deleteMode : config.deleteMode(file); + var filepath = path.resolve(cwd, directory, getFixedPath(file.relative)); + + fs.exists(filepath, function(exists) { + if(exists) { + gutil.log(gutil.colors.green('Gzipped file ' + filepath + ' deleted')); + fs.unlink(filepath, complete); + } else { + complete(); + } + }); + } else { + complete(); + } + + return; + }; + + compress(file.contents, config, finished); + } + + return stream; +}; diff --git a/node_modules/gulp-gzip/lib/compress.js b/node_modules/gulp-gzip/lib/compress.js new file mode 100755 index 000000000..db04c4c23 --- /dev/null +++ b/node_modules/gulp-gzip/lib/compress.js @@ -0,0 +1,88 @@ +var zlib = require('zlib'); +var Readable = require('stream').Readable; +var toArray = require('stream-to-array'); + +function convertContentsToBuffer(contents, callback) { + if (contents instanceof Buffer) { + callback(null, contents); + } else { + toArray(contents, function (err, chunks) { + if (err) { + callback(err, null); + return; + } + + callback(null, Buffer.concat(chunks)); + }); + } +} + +function convertContentsToStream(contents, callback) { + if (contents instanceof Readable) { + callback(null, contents); + } else { + var rs = new Readable({ objectMode: true }); + rs._read = function() { + rs.push(contents); + rs.push(null); + }; + callback(null, rs); + } +} + +module.exports = function(originalContents, options, callback) { + + convertContentsToBuffer(originalContents, function(err, contentsAsBuffer) { + if (err) { + callback(err, null, false); + return; + } + + var originalContentLength = contentsAsBuffer.length; + + // Check if the threshold option is set + // If true, check if the buffer length is greater than the threshold + if (options.threshold && originalContentLength < options.threshold) { + // File size is smaller than the threshold + // Pass it along to the next plugin without compressing + if (originalContents instanceof Buffer) { + callback(null, contentsAsBuffer, false); + } else { + convertContentsToStream(contentsAsBuffer, function(err, contentsAsStream) { + callback(null, contentsAsStream, false); + }); + } + return; + } + + convertContentsToStream(contentsAsBuffer, function(err, contentsAsStream) { + if (err) { + callback(err, null, false); + return; + } + + // Compress the contents + var gzipStream = zlib.createGzip(options.gzipOptions); + contentsAsStream.pipe(gzipStream); + + convertContentsToBuffer(gzipStream, function(err, compressedContentsAsBuffer) { + if (err) { + callback(err, null, false); + return; + } + + if (options.skipGrowingFiles && compressedContentsAsBuffer.length >= originalContentLength) { + callback(null, originalContents, false); + } else { + if (originalContents instanceof Buffer) { + callback(null, compressedContentsAsBuffer, true); + } else { + convertContentsToStream(compressedContentsAsBuffer, function(err, compressedContentsStream) { + callback(null, compressedContentsStream, true); + }); + } + } + }); + }); + }); +}; diff --git a/node_modules/gulp-gzip/lib/utils.js b/node_modules/gulp-gzip/lib/utils.js new file mode 100755 index 000000000..5658e1ca1 --- /dev/null +++ b/node_modules/gulp-gzip/lib/utils.js @@ -0,0 +1,43 @@ +var bytes = require('bytes'); + +// Merge source object with target object while handling threshold option +// Used to merge user defined plugin options with default options +function merge(target, source) { + if (typeof source === 'undefined') source = {}; + + Object.keys(source).forEach(function(key) { + if (key === 'threshold') { + target[key] = threshold(source[key]); + } else { + target[key] = source[key]; + } + }); + + return target; +} + +// Parse the threshold plugin option +// Specifies the minimum file size that will be compressed +// Can be a string, number, or boolean +function threshold(obj) { + var ret; + + switch (typeof obj) { + case 'string': + ret = bytes(obj) < 150 ? 150 : bytes(obj); + break; + case 'number': + ret = obj < 150 ? 150 : obj; + break; + case 'boolean': + ret = obj === false ? false : 150; + break; + default: + throw new Error('threshold must be String|Number|Boolean'); + } + + return ret; +} + +exports.merge = merge; +exports.threshold = threshold; diff --git a/node_modules/gulp-gzip/node_modules/.bin/has-ansi b/node_modules/gulp-gzip/node_modules/.bin/has-ansi new file mode 120000 index 000000000..c1e7413f1 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/.bin/has-ansi @@ -0,0 +1 @@ +../has-ansi/cli.js
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/.bin/strip-ansi b/node_modules/gulp-gzip/node_modules/.bin/strip-ansi new file mode 120000 index 000000000..b65c9f81d --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/.bin/strip-ansi @@ -0,0 +1 @@ +../strip-ansi/cli.js
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/.bin/supports-color b/node_modules/gulp-gzip/node_modules/.bin/supports-color new file mode 120000 index 000000000..af0f05efe --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/.bin/supports-color @@ -0,0 +1 @@ +../supports-color/cli.js
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/ansi-regex/index.js b/node_modules/gulp-gzip/node_modules/ansi-regex/index.js new file mode 100644 index 000000000..783c5c7bb --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/ansi-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = function () { + return /\u001b\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]/g; +}; diff --git a/node_modules/gulp-gzip/node_modules/ansi-regex/package.json b/node_modules/gulp-gzip/node_modules/ansi-regex/package.json new file mode 100644 index 000000000..cc36e20b8 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/ansi-regex/package.json @@ -0,0 +1,114 @@ +{ + "_args": [ + [ + { + "raw": "ansi-regex@^0.2.0", + "scope": null, + "escapedName": "ansi-regex", + "name": "ansi-regex", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/has-ansi" + ] + ], + "_from": "ansi-regex@>=0.2.0 <0.3.0", + "_id": "ansi-regex@0.2.1", + "_inCache": true, + "_location": "/gulp-gzip/ansi-regex", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "1.4.9", + "_phantomChildren": {}, + "_requested": { + "raw": "ansi-regex@^0.2.0", + "scope": null, + "escapedName": "ansi-regex", + "name": "ansi-regex", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/has-ansi", + "/gulp-gzip/strip-ansi" + ], + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", + "_shasum": "0d8e946967a3d8143f93e24e298525fc1b2235f9", + "_shrinkwrap": null, + "_spec": "ansi-regex@^0.2.0", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/has-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/ansi-regex/issues" + }, + "dependencies": {}, + "description": "Regular expression for matching ANSI escape codes", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "0d8e946967a3d8143f93e24e298525fc1b2235f9", + "tarball": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/ansi-regex", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "ansi-regex", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/ansi-regex.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.2.1" +} diff --git a/node_modules/gulp-gzip/node_modules/ansi-regex/readme.md b/node_modules/gulp-gzip/node_modules/ansi-regex/readme.md new file mode 100644 index 000000000..ae876e729 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/ansi-regex/readme.md @@ -0,0 +1,33 @@ +# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +```sh +$ npm install --save ansi-regex +``` + + +## Usage + +```js +var ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001b[4mcake\u001b[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001b[4mcake\u001b[0m'.match(ansiRegex()); +//=> ['\u001b[4m', '\u001b[0m'] +``` + +*It's a function so you can create multiple instances. Regexes with the global flag will have the `.lastIndex` property changed for each call to methods on the instance. Therefore reusing the instance with multiple calls will not work as expected for `.test()`.* + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp-gzip/node_modules/ansi-styles/index.js b/node_modules/gulp-gzip/node_modules/ansi-styles/index.js new file mode 100644 index 000000000..2d8b4726d --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/ansi-styles/index.js @@ -0,0 +1,40 @@ +'use strict'; +var styles = module.exports; + +var codes = { + reset: [0, 0], + + bold: [1, 22], // 21 isn't widely supported and 22 does the same thing + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29], + + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], + + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49] +}; + +Object.keys(codes).forEach(function (key) { + var val = codes[key]; + var style = styles[key] = {}; + style.open = '\u001b[' + val[0] + 'm'; + style.close = '\u001b[' + val[1] + 'm'; +}); diff --git a/node_modules/gulp-gzip/node_modules/ansi-styles/package.json b/node_modules/gulp-gzip/node_modules/ansi-styles/package.json new file mode 100644 index 000000000..4a425bab5 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/ansi-styles/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + { + "raw": "ansi-styles@^1.1.0", + "scope": null, + "escapedName": "ansi-styles", + "name": "ansi-styles", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/chalk" + ] + ], + "_from": "ansi-styles@>=1.1.0 <2.0.0", + "_id": "ansi-styles@1.1.0", + "_inCache": true, + "_location": "/gulp-gzip/ansi-styles", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "1.4.9", + "_phantomChildren": {}, + "_requested": { + "raw": "ansi-styles@^1.1.0", + "scope": null, + "escapedName": "ansi-styles", + "name": "ansi-styles", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/chalk" + ], + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz", + "_shasum": "eaecbf66cd706882760b2f4691582b8f55d7a7de", + "_shrinkwrap": null, + "_spec": "ansi-styles@^1.1.0", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/ansi-styles/issues" + }, + "dependencies": {}, + "description": "ANSI escape codes for styling strings in the terminal", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "eaecbf66cd706882760b2f4691582b8f55d7a7de", + "tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/ansi-styles", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "ansi-styles", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/ansi-styles.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.1.0" +} diff --git a/node_modules/gulp-gzip/node_modules/ansi-styles/readme.md b/node_modules/gulp-gzip/node_modules/ansi-styles/readme.md new file mode 100644 index 000000000..73584cc95 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/ansi-styles/readme.md @@ -0,0 +1,70 @@ +# ansi-styles [![Build Status](https://travis-ci.org/sindresorhus/ansi-styles.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-styles) + +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/sindresorhus/chalk) module for styling your strings. + +![screenshot](screenshot.png) + + +## Install + +```sh +$ npm install --save ansi-styles +``` + + +## Usage + +```js +var ansi = require('ansi-styles'); + +console.log(ansi.green.open + 'Hello world!' + ansi.green.close); +``` + + +## API + +Each style has an `open` and `close` property. + + +## Styles + +### General + +- `reset` +- `bold` +- `dim` +- `italic` *(not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(not widely supported)* + +### Text colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp-gzip/node_modules/chalk/index.js b/node_modules/gulp-gzip/node_modules/chalk/index.js new file mode 100644 index 000000000..ac1f16820 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/chalk/index.js @@ -0,0 +1,95 @@ +'use strict'; +var escapeStringRegexp = require('escape-string-regexp'); +var ansiStyles = require('ansi-styles'); +var stripAnsi = require('strip-ansi'); +var hasAnsi = require('has-ansi'); +var supportsColor = require('supports-color'); +var defineProps = Object.defineProperties; +var chalk = module.exports; + +function build(_styles) { + var builder = function builder() { + return applyStyle.apply(builder, arguments); + }; + builder._styles = _styles; + // __proto__ is used because we must return a function, but there is + // no way to create a function with a different prototype. + builder.__proto__ = proto; + return builder; +} + +var styles = (function () { + var ret = {}; + + ansiStyles.grey = ansiStyles.gray; + + Object.keys(ansiStyles).forEach(function (key) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + ret[key] = { + get: function () { + return build(this._styles.concat(key)); + } + }; + }); + + return ret; +})(); + +var proto = defineProps(function chalk() {}, styles); + +function applyStyle() { + // support varags, but simply cast to string in case there's only one arg + var args = arguments; + var argsLen = args.length; + var str = argsLen !== 0 && String(arguments[0]); + if (argsLen > 1) { + // don't slice `arguments`, it prevents v8 optimizations + for (var a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!chalk.enabled || !str) { + return str; + } + + /*jshint validthis: true*/ + var nestedStyles = this._styles; + + for (var i = 0; i < nestedStyles.length; i++) { + var code = ansiStyles[nestedStyles[i]]; + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + } + + return str; +} + +function init() { + var ret = {}; + + Object.keys(styles).forEach(function (name) { + ret[name] = { + get: function () { + return build([name]); + } + }; + }); + + return ret; +} + +defineProps(chalk, init()); + +chalk.styles = ansiStyles; +chalk.hasColor = hasAnsi; +chalk.stripColor = stripAnsi; +chalk.supportsColor = supportsColor; + +// detect mode if not set manually +if (chalk.enabled === undefined) { + chalk.enabled = chalk.supportsColor; +} diff --git a/node_modules/gulp-gzip/node_modules/chalk/package.json b/node_modules/gulp-gzip/node_modules/chalk/package.json new file mode 100644 index 000000000..5c30d4512 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/chalk/package.json @@ -0,0 +1,115 @@ +{ + "_args": [ + [ + { + "raw": "chalk@^0.5.0", + "scope": null, + "escapedName": "chalk", + "name": "chalk", + "rawSpec": "^0.5.0", + "spec": ">=0.5.0 <0.6.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util" + ] + ], + "_from": "chalk@>=0.5.0 <0.6.0", + "_id": "chalk@0.5.1", + "_inCache": true, + "_location": "/gulp-gzip/chalk", + "_npmUser": { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + }, + "_npmVersion": "1.4.14", + "_phantomChildren": {}, + "_requested": { + "raw": "chalk@^0.5.0", + "scope": null, + "escapedName": "chalk", + "name": "chalk", + "rawSpec": "^0.5.0", + "spec": ">=0.5.0 <0.6.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/gulp-util" + ], + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz", + "_shasum": "663b3a648b68b55d04690d49167aa837858f2174", + "_shrinkwrap": null, + "_spec": "chalk@^0.5.0", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util", + "bugs": { + "url": "https://github.com/sindresorhus/chalk/issues" + }, + "dependencies": { + "ansi-styles": "^1.1.0", + "escape-string-regexp": "^1.0.0", + "has-ansi": "^0.1.0", + "strip-ansi": "^0.3.0", + "supports-color": "^0.2.0" + }, + "description": "Terminal string styling done right. Created because the `colors` module does some really horrible things.", + "devDependencies": { + "matcha": "^0.5.0", + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "663b3a648b68b55d04690d49167aa837858f2174", + "tarball": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "994758f01293f1fdcf63282e9917cb9f2cfbdaac", + "homepage": "https://github.com/sindresorhus/chalk", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "ansi", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "name": "chalk", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/chalk.git" + }, + "scripts": { + "bench": "matcha benchmark.js", + "test": "mocha" + }, + "version": "0.5.1" +} diff --git a/node_modules/gulp-gzip/node_modules/chalk/readme.md b/node_modules/gulp-gzip/node_modules/chalk/readme.md new file mode 100644 index 000000000..239c791f8 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/chalk/readme.md @@ -0,0 +1,175 @@ +# <img width="300" src="https://cdn.rawgit.com/sindresorhus/chalk/77ae94f63ab1ac61389b190e5a59866569d1a376/logo.svg" alt="chalk"> + +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/sindresorhus/chalk.svg?branch=master)](https://travis-ci.org/sindresorhus/chalk) +![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg) + +[colors.js](https://github.com/Marak/colors.js) is currently the most popular string styling module, but it has serious deficiencies like extending String.prototype which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. + +**Chalk is a clean and focused alternative.** + +![screenshot](https://github.com/sindresorhus/ansi-styles/raw/master/screenshot.png) + + +## Why + +- Highly performant +- Doesn't extend String.prototype +- Expressive API +- Ability to nest styles +- Clean and focused +- Auto-detects color support +- Actively maintained +- [Used by 1000+ modules](https://npmjs.org/browse/depended/chalk) + + +## Install + +```sh +$ npm install --save chalk +``` + + +## Usage + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +var chalk = require('chalk'); + +// style a string +console.log( chalk.blue('Hello world!') ); + +// combine styled and normal strings +console.log( chalk.blue('Hello'), 'World' + chalk.red('!') ); + +// compose multiple styles using the chainable API +console.log( chalk.blue.bgRed.bold('Hello world!') ); + +// pass in multiple arguments +console.log( chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz') ); + +// nest styles +console.log( chalk.red('Hello', chalk.underline.bgBlue('world') + '!') ); + +// nest styles of the same type even (color, underline, background) +console.log( chalk.green('I am a green line ' + chalk.blue('with a blue substring') + ' that becomes green again!') ); +``` + +Easily define your own themes. + +```js +var chalk = require('chalk'); +var error = chalk.bold.red; +console.log(error('Error!')); +``` + +Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). + +```js +var name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> Hello Sindre +``` + + +## API + +### chalk.`<style>[.<style>...](string, [string...])` + +Example: `chalk.red.bold.underline('Hello', 'world');` + +Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter. + +Multiple arguments will be separated by space. + +### chalk.enabled + +Color support is automatically detected, but you can override it. + +### chalk.supportsColor + +Detect whether the terminal [supports color](https://github.com/sindresorhus/supports-color). + +Can be overridden by the user with the flags `--color` and `--no-color`. + +Used internally and handled for you, but exposed for convenience. + +### chalk.styles + +Exposes the styles as [ANSI escape codes](https://github.com/sindresorhus/ansi-styles). + +Generally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with yours. + +```js +var chalk = require('chalk'); + +console.log(chalk.styles.red); +//=> {open: '\u001b[31m', close: '\u001b[39m'} + +console.log(chalk.styles.red.open + 'Hello' + chalk.styles.red.close); +``` + +### chalk.hasColor(string) + +Check whether a string [has color](https://github.com/sindresorhus/has-ansi). + +### chalk.stripColor(string) + +[Strip color](https://github.com/sindresorhus/strip-ansi) from a string. + +Can be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported. + +Example: + +```js +var chalk = require('chalk'); +var styledString = getText(); + +if (!chalk.supportsColor) { + styledString = chalk.stripColor(styledString); +} +``` + + +## Styles + +### General + +- `reset` +- `bold` +- `dim` +- `italic` *(not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(not widely supported)* + +### Text colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/.npmignore b/node_modules/gulp-gzip/node_modules/gulp-util/.npmignore new file mode 100644 index 000000000..5cdb2e5e9 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/.npmignore @@ -0,0 +1,7 @@ +.DS_Store +*.log +node_modules +build +*.node +components +test
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/.travis.yml b/node_modules/gulp-gzip/node_modules/gulp-util/.travis.yml new file mode 100644 index 000000000..7c1662070 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" +after_script: + - npm run coveralls
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/LICENSE b/node_modules/gulp-gzip/node_modules/gulp-util/LICENSE new file mode 100755 index 000000000..7cbe012c6 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2014 Fractal <contact@wearefractal.com> + +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/gulp-gzip/node_modules/gulp-util/README.md b/node_modules/gulp-gzip/node_modules/gulp-util/README.md new file mode 100644 index 000000000..a8d9b19ef --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/README.md @@ -0,0 +1,140 @@ +# gulp-util [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status][depstat-image]][depstat-url] + +## Information + +<table> +<tr> +<td>Package</td><td>gulp-util</td> +</tr> +<tr> +<td>Description</td> +<td>Utility functions for gulp plugins</td> +</tr> +<tr> +<td>Node Version</td> +<td>>= 0.9</td> +</tr> +</table> + +## Usage + +```javascript +var gutil = require('gulp-util'); + +gutil.log('stuff happened', 'Really it did', gutil.colors.cyan('123')); +gutil.beep(); + +gutil.replaceExtension('file.coffee', '.js'); // file.js + +var opt = { + name: 'todd', + file: someGulpFile +}; +gutil.template('test <%= name %> <%= file.path %>', opt) // test todd /js/hi.js +``` + +### log(msg...) + +Logs stuff. Already prefixed with [gulp] and all that. Use the right colors for values. If you pass in multiple arguments it will join them by a space. + +``` +values (files, module names, etc.) = magenta +numbers (times, counts, etc) = cyan +``` + +### replaceExtension(path, newExtension) + +Replaces a file extension in a path. Returns the new path. + +### isStream(obj) + +Returns true or false if an object is a stream. + +### isBuffer(obj) + +Returns true or false if an object is a Buffer. + +### template(string[, data]) + +This is a lodash.template function wrapper. You must pass in a valid gulp file object so it is available to the user or it will error. You can not configure any of the delimiters. Look at the [lodash docs](http://lodash.com/docs#template) for more info. + +## new File(obj) + +This is just [vinyl](https://github.com/wearefractal/vinyl) + +```javascript +var file = new gutil.File({ + base: join(__dirname, './fixtures/'), + cwd: __dirname, + path: join(__dirname, './fixtures/test.coffee') +}); +``` + +## noop() + +Returns a stream that does nothing but pass data straight through. + +```javascript +// gulp should be called like this : +// $ gulp --type production +gulp.task('scripts', function() { + gulp.src('src/**/*.js') + .pipe(concat('script.js')) + .pipe(gutil.env.type === 'production' ? uglify() : gutil.noop()) + .pipe(gulp.dest('dist/'); +}); +``` + +## buffer(cb) + +This is similar to es.wait but instead of buffering text into one string it buffers anything into an array (so very useful for file objects). + +Returns a stream that can be piped to. + +The stream will emit one data event after the stream piped to it has ended. The data will be the same array passed to the callback. + +Callback is optional and receives two arguments: error and data + +```javascript +gulp.src('stuff/*.js') + .pipe(gutil.buffer(function(err, files){ + + }); +``` + +## new PluginError(pluginName, message[, options]) + +- pluginName should be the module name of your plugin +- message can be a string or an existing error +- By default the stack will not be shown. Set `options.showStack` to true if you think the stack is important for your error. +- If you pass an error in as the message the stack will be pulled from that, otherwise one will be created. +- Note that if you pass in a custom stack string you need to include the message along with that. + +These are all acceptable forms of instantiation: + +```javascript +var err = new gutil.PluginError('test', { + message: 'something broke' +}); + +var err = new gutil.PluginError({ + plugin: 'test', + message: 'something broke' +}); + +var err = new gutil.PluginError('test', 'something broke'); + +var err = new gutil.PluginError('test', 'something broke', {showStack: true}); + +var existingError = new Error('OMG'); +var err = new gutil.PluginError('test', existingError, {showStack: true}); +``` + +[npm-url]: https://npmjs.org/package/gulp-util +[npm-image]: https://badge.fury.io/js/gulp-util.svg +[travis-url]: https://travis-ci.org/gulpjs/gulp-util +[travis-image]: https://travis-ci.org/gulpjs/gulp-util.svg?branch=master +[coveralls-url]: https://coveralls.io/r/gulpjs/gulp-util +[coveralls-image]: https://coveralls.io/repos/gulpjs/gulp-util/badge.png +[depstat-url]: https://david-dm.org/gulpjs/gulp-util +[depstat-image]: https://david-dm.org/gulpjs/gulp-util.svg diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/index.js b/node_modules/gulp-gzip/node_modules/gulp-util/index.js new file mode 100644 index 000000000..6746ee4be --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/index.js @@ -0,0 +1,18 @@ +module.exports = { + File: require('./lib/File'), + replaceExtension: require('./lib/replaceExtension'), + colors: require('./lib/colors'), + date: require('./lib/date'), + log: require('./lib/log'), + template: require('./lib/template'), + env: require('./lib/env'), + beep: require('./lib/beep'), + noop: require('./lib/noop'), + isStream: require('./lib/isStream'), + isBuffer: require('./lib/isBuffer'), + isNull: require('./lib/isNull'), + linefeed: require('./lib/linefeed'), + combine: require('./lib/combine'), + buffer: require('./lib/buffer'), + PluginError: require('./lib/PluginError') +};
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/File.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/File.js new file mode 100644 index 000000000..690a508a6 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/File.js @@ -0,0 +1 @@ +module.exports = require('vinyl');
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/PluginError.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/PluginError.js new file mode 100644 index 000000000..6640346ed --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/PluginError.js @@ -0,0 +1,64 @@ +var util = require('util'); +var colors = require('./colors'); + +// wow what a clusterfuck +var parseOptions = function(plugin, message, opt) { + if (!opt) opt = {}; + if (typeof plugin === 'object') { + opt = plugin; + } else if (message instanceof Error) { + opt.error = message; + opt.plugin = plugin; + } else if (typeof message === 'object') { + opt = message; + opt.plugin = plugin; + } else if (typeof opt === 'object') { + opt.plugin = plugin; + opt.message = message; + } + return opt; +}; + +function PluginError(plugin, message, opt) { + if (!(this instanceof PluginError)) throw new Error('Call PluginError using new'); + + Error.call(this); + + var options = parseOptions(plugin, message, opt); + + this.plugin = options.plugin; + this.showStack = options.showStack === true; + + var properties = ['name', 'message', 'fileName', 'lineNumber', 'stack']; + + // if options has an error, grab details from it + if (options.error) { + properties.forEach(function(prop) { + if (prop in options.error) this[prop] = options.error[prop]; + }, this); + } + + // options object can override + properties.forEach(function(prop) { + if (prop in options) this[prop] = options[prop]; + }, this); + + // defaults + if (!this.name) this.name = 'Error'; + + // TODO: figure out why this explodes mocha + if (!this.stack) Error.captureStackTrace(this, arguments.callee || this.constructor); + + if (!this.plugin) throw new Error('Missing plugin name'); + if (!this.message) throw new Error('Missing error message'); +} + +util.inherits(PluginError, Error); + +PluginError.prototype.toString = function () { + var sig = this.name+' in plugin \''+colors.cyan(this.plugin)+'\''; + var msg = this.showStack ? (this._stack || this.stack) : this.message; + return sig+'\n'+msg; +}; + +module.exports = PluginError; diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/beep.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/beep.js new file mode 100644 index 000000000..5473d7548 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/beep.js @@ -0,0 +1,3 @@ +module.exports = function() { + process.stdout.write('\x07'); +}; diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/buffer.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/buffer.js new file mode 100644 index 000000000..4cb064aca --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/buffer.js @@ -0,0 +1,15 @@ +var through = require('through2'); + +module.exports = function(fn) { + var buf = []; + var end = function(cb) { + this.push(buf); + cb(); + if(fn) fn(null, buf); + }; + var push = function(data, enc, cb) { + buf.push(data); + cb(); + }; + return through.obj(push, end); +};
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/colors.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/colors.js new file mode 100644 index 000000000..bc8049406 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/colors.js @@ -0,0 +1 @@ +module.exports = require('chalk');
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/combine.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/combine.js new file mode 100644 index 000000000..f20712d20 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/combine.js @@ -0,0 +1,11 @@ +var pipeline = require('multipipe'); + +module.exports = function(){ + var args = arguments; + if (args.length === 1 && Array.isArray(args[0])) { + args = args[0]; + } + return function(){ + return pipeline.apply(pipeline, args); + }; +}; diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/date.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/date.js new file mode 100644 index 000000000..935793cc6 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/date.js @@ -0,0 +1 @@ +module.exports = require('dateformat');
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/env.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/env.js new file mode 100644 index 000000000..ea1e03e4a --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/env.js @@ -0,0 +1,4 @@ +var parseArgs = require('minimist'); +var argv = parseArgs(process.argv.slice(2)); + +module.exports = argv;
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/isBuffer.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/isBuffer.js new file mode 100644 index 000000000..0e23782c4 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/isBuffer.js @@ -0,0 +1,7 @@ +var buf = require('buffer'); +var Buffer = buf.Buffer; + +// could use Buffer.isBuffer but this is the same exact thing... +module.exports = function(o) { + return typeof o === 'object' && o instanceof Buffer; +};
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/isNull.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/isNull.js new file mode 100644 index 000000000..403bb30e8 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/isNull.js @@ -0,0 +1,3 @@ +module.exports = function(v) { + return v === null; +};
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/isStream.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/isStream.js new file mode 100644 index 000000000..9ce0929b0 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/isStream.js @@ -0,0 +1,5 @@ +var Stream = require('stream').Stream; + +module.exports = function(o) { + return !!o && o instanceof Stream; +};
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/linefeed.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/linefeed.js new file mode 100644 index 000000000..5b0dfa4b1 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/linefeed.js @@ -0,0 +1 @@ +module.exports = '\n';
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/log.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/log.js new file mode 100644 index 000000000..e33d15ed9 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/log.js @@ -0,0 +1,10 @@ +var colors = require('./colors'); +var date = require('./date'); + +module.exports = function(){ + var time = '['+colors.grey(date(new Date(), 'HH:MM:ss'))+']'; + var args = Array.prototype.slice.call(arguments); + args.unshift(time); + console.log.apply(console, args); + return this; +}; diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/noop.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/noop.js new file mode 100644 index 000000000..7862cb161 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/noop.js @@ -0,0 +1,5 @@ +var through = require('through2'); + +module.exports = function () { + return through.obj(); +}; diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/replaceExtension.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/replaceExtension.js new file mode 100644 index 000000000..3f76938e4 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/replaceExtension.js @@ -0,0 +1,9 @@ +var path = require('path'); + +module.exports = function(npath, ext) { + if (typeof npath !== 'string') return npath; + if (npath.length === 0) return npath; + + var nFileName = path.basename(npath, path.extname(npath))+ext; + return path.join(path.dirname(npath), nFileName); +};
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/lib/template.js b/node_modules/gulp-gzip/node_modules/gulp-util/lib/template.js new file mode 100644 index 000000000..c467820f3 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/lib/template.js @@ -0,0 +1,19 @@ +var template = require('lodash.template'); +var reInterpolate = require('lodash._reinterpolate'); + +var forcedSettings = { + escape: /<%-([\s\S]+?)%>/g, + evaluate: /<%([\s\S]+?)%>/g, + interpolate: reInterpolate +}; + +module.exports = function(tmpl, data){ + var fn = template(tmpl, null, forcedSettings); + + var wrapped = function(o) { + if (typeof o === 'undefined' || typeof o.file === 'undefined') throw new Error('Failed to provide the current file as "file" to the template'); + return fn(o); + }; + + return (data ? wrapped(data) : wrapped); +}; diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/.npmignore b/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/.npmignore new file mode 100644 index 000000000..1e1dcab34 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/.npmignore @@ -0,0 +1,3 @@ +test +.jshintrc +.travis.yml
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/LICENSE b/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/LICENSE new file mode 100644 index 000000000..f6a0029de --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/LICENSE @@ -0,0 +1,39 @@ +Copyright 2013, Rod Vagg (the "Original Author") +All rights reserved. + +MIT +no-false-attribs License + +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. + +Distributions of all or part of the Software intended to be used +by the recipients as they would use the unmodified Software, +containing modifications that substantially alter, remove, or +disable functionality of the Software, outside of the documented +configuration mechanisms provided by the Software, shall be +modified such that the Original Author's bug reporting email +addresses and urls are either replaced with the contact information +of the parties responsible for the changes, or removed entirely. + +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. + + +Except where noted, this license applies to any and all software +programs and associated documentation files created by the +Original Author, when distributed with the Software.
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/README.md b/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/README.md new file mode 100644 index 000000000..33aa01ec3 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/README.md @@ -0,0 +1,140 @@ +# through2 + +<!-- + +soon ... + +[![Build Status](https://secure.travis-ci.org/rvagg/through2.png)](http://travis-ci.org/rvagg/through2) + +[![Build Status](https://saucelabs.com/browser-matrix/through2-sauce.svg)](https://travis-ci.org/rvagg/through2) + +--> + +[![NPM](https://nodei.co/npm/through2.png?compact=true)](https://nodei.co/npm/through2/) + +<!-- +not happy with these, we need to peg to readable-stream@1.0.x so it'll always report out-of-date + +[![david-dm](https://david-dm.org/rvagg/through2.png)](https://david-dm.org/rvagg/through2/) +[![david-dm](https://david-dm.org/rvagg/through2/dev-status.png)](https://david-dm.org/rvagg/through2#info=devDependencies/) +--> + +**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: A **Streams3** version of through2 is available in npm with the tag `"1.0"` rather than `"latest"` so an `npm install through2` will get you the current Streams2 version (version number is 0.x.x). To use a Streams3 version use `npm install through2@1` to fetch the latest version 1.x.x. More information about Streams2 vs Streams3 and recommendations [here](http://www.nearform.com/nodecrunch/dont-use-nodes-core-stream-module). + +```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')) +``` + +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) { + + this.push(new Buffer('wut?')) + cb() + + }) + .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. + +If you **do not provide a `transformFunction`** then you will get a simple 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. + +<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. + +## License + +**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/package.json b/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/package.json new file mode 100644 index 000000000..548f1aa61 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "through2@^0.5.0", + "scope": null, + "escapedName": "through2", + "name": "through2", + "rawSpec": "^0.5.0", + "spec": ">=0.5.0 <0.6.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util" + ] + ], + "_from": "through2@>=0.5.0 <0.6.0", + "_id": "through2@0.5.1", + "_inCache": true, + "_location": "/gulp-gzip/gulp-util/through2", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "_npmVersion": "1.4.3", + "_phantomChildren": {}, + "_requested": { + "raw": "through2@^0.5.0", + "scope": null, + "escapedName": "through2", + "name": "through2", + "rawSpec": "^0.5.0", + "spec": ">=0.5.0 <0.6.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/gulp-util" + ], + "_resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz", + "_shasum": "dfdd012eb9c700e2323fd334f38ac622ab372da7", + "_shrinkwrap": null, + "_spec": "through2@^0.5.0", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util", + "author": { + "name": "Rod Vagg", + "email": "r@va.gg", + "url": "https://github.com/rvagg" + }, + "bugs": { + "url": "https://github.com/rvagg/through2/issues" + }, + "dependencies": { + "readable-stream": "~1.0.17", + "xtend": "~3.0.0" + }, + "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", + "devDependencies": { + "bl": "~0.6.0", + "brtapsauce": "~0.2.2", + "stream-spigot": "~3.0.1", + "tape": "~2.3.0" + }, + "directories": {}, + "dist": { + "shasum": "dfdd012eb9c700e2323fd334f38ac622ab372da7", + "tarball": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz" + }, + "homepage": "https://github.com/rvagg/through2", + "keywords": [ + "stream", + "streams2", + "through", + "transform" + ], + "license": "MIT", + "main": "through2.js", + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + }, + { + "name": "bryce", + "email": "bryce@ravenwall.com" + } + ], + "name": "through2", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/through2.git" + }, + "scripts": { + "test": "node test/test.js", + "test-local": "brtapsauce-local test/basic-test.js" + }, + "version": "0.5.1" +} diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/through2.js b/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/through2.js new file mode 100644 index 000000000..d3610aa52 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2/through2.js @@ -0,0 +1,78 @@ +var Transform = require('readable-stream/transform') + , inherits = require('util').inherits + , xtend = require('xtend') + + +// 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 Transform(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) + + Transform.call(this, this.options) + } + + inherits(Through2, Transform) + + Through2.prototype._transform = transform + + if (flush) + Through2.prototype._flush = flush + + return Through2 +}) + + +module.exports.obj = through2(function (options, transform, flush) { + var t2 = new Transform(xtend({ objectMode: true, highWaterMark: 16 }, options)) + + t2._transform = transform + + if (flush) + t2._flush = flush + + return t2 +}) diff --git a/node_modules/gulp-gzip/node_modules/gulp-util/package.json b/node_modules/gulp-gzip/node_modules/gulp-util/package.json new file mode 100644 index 000000000..9c1ae50ab --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/gulp-util/package.json @@ -0,0 +1,112 @@ +{ + "_args": [ + [ + { + "raw": "gulp-util@^2.2.14", + "scope": null, + "escapedName": "gulp-util", + "name": "gulp-util", + "rawSpec": "^2.2.14", + "spec": ">=2.2.14 <3.0.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip" + ] + ], + "_from": "gulp-util@>=2.2.14 <3.0.0", + "_id": "gulp-util@2.2.20", + "_inCache": true, + "_location": "/gulp-gzip/gulp-util", + "_npmUser": { + "name": "fractal", + "email": "contact@wearefractal.com" + }, + "_npmVersion": "1.5.0-alpha-1", + "_phantomChildren": { + "readable-stream": "1.0.34", + "xtend": "3.0.0" + }, + "_requested": { + "raw": "gulp-util@^2.2.14", + "scope": null, + "escapedName": "gulp-util", + "name": "gulp-util", + "rawSpec": "^2.2.14", + "spec": ">=2.2.14 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip" + ], + "_resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-2.2.20.tgz", + "_shasum": "d7146e5728910bd8f047a6b0b1e549bc22dbd64c", + "_shrinkwrap": null, + "_spec": "gulp-util@^2.2.14", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip", + "author": { + "name": "Fractal", + "email": "contact@wearefractal.com", + "url": "http://wearefractal.com/" + }, + "bugs": { + "url": "https://github.com/wearefractal/gulp-util/issues" + }, + "dependencies": { + "chalk": "^0.5.0", + "dateformat": "^1.0.7-1.2.3", + "lodash._reinterpolate": "^2.4.1", + "lodash.template": "^2.4.1", + "minimist": "^0.2.0", + "multipipe": "^0.1.0", + "through2": "^0.5.0", + "vinyl": "^0.2.1" + }, + "description": "Utility functions for gulp plugins", + "devDependencies": { + "buffer-equal": "~0.0.1", + "coveralls": "^2.7.0", + "event-stream": "^3.1.0", + "istanbul": "^0.2.3", + "jshint": "^2.4.1", + "lodash.templatesettings": "^2.4.1", + "mocha": "^1.17.0", + "mocha-lcov-reporter": "^0.0.1", + "rimraf": "^2.2.5", + "should": "^4.0.0" + }, + "directories": {}, + "dist": { + "shasum": "d7146e5728910bd8f047a6b0b1e549bc22dbd64c", + "tarball": "https://registry.npmjs.org/gulp-util/-/gulp-util-2.2.20.tgz" + }, + "engines": { + "node": ">= 0.9" + }, + "gitHead": "a44e450cfbe65fa4902b198bead4c65722cced0a", + "homepage": "http://github.com/wearefractal/gulp-util", + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/wearefractal/gulp-util/raw/master/LICENSE" + } + ], + "main": "./index.js", + "maintainers": [ + { + "name": "fractal", + "email": "contact@wearefractal.com" + } + ], + "name": "gulp-util", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/wearefractal/gulp-util.git" + }, + "scripts": { + "coveralls": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage", + "test": "mocha --reporter spec && jshint" + }, + "version": "2.2.20" +} diff --git a/node_modules/gulp-gzip/node_modules/has-ansi/cli.js b/node_modules/gulp-gzip/node_modules/has-ansi/cli.js new file mode 100755 index 000000000..e0956fcc7 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/has-ansi/cli.js @@ -0,0 +1,53 @@ +#!/usr/bin/env node +'use strict'; +var pkg = require('./package.json'); +var hasAnsi = require('./'); +var input = process.argv[2]; + +function stdin(cb) { + var ret = ''; + process.stdin.setEncoding('utf8'); + process.stdin.on('data', function (data) { + ret += data; + }); + process.stdin.on('end', function () { + cb(ret); + }); +} + +function help() { + console.log([ + pkg.description, + '', + 'Usage', + ' $ has-ansi <string>', + ' $ echo <string> | has-ansi', + '', + 'Exits with code 0 if input has ANSI escape codes and 1 if not' + ].join('\n')); +} + +function init(data) { + process.exit(hasAnsi(data) ? 0 : 1); +} + +if (process.argv.indexOf('--help') !== -1) { + help(); + return; +} + +if (process.argv.indexOf('--version') !== -1) { + console.log(pkg.version); + return; +} + +if (process.stdin.isTTY) { + if (!input) { + help(); + return; + } + + init(input); +} else { + stdin(init); +} diff --git a/node_modules/gulp-gzip/node_modules/has-ansi/index.js b/node_modules/gulp-gzip/node_modules/has-ansi/index.js new file mode 100644 index 000000000..98fae0676 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/has-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +var ansiRegex = require('ansi-regex'); +var re = new RegExp(ansiRegex().source); // remove the `g` flag +module.exports = re.test.bind(re); diff --git a/node_modules/gulp-gzip/node_modules/has-ansi/package.json b/node_modules/gulp-gzip/node_modules/has-ansi/package.json new file mode 100644 index 000000000..4393cd0b7 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/has-ansi/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "has-ansi@^0.1.0", + "scope": null, + "escapedName": "has-ansi", + "name": "has-ansi", + "rawSpec": "^0.1.0", + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/chalk" + ] + ], + "_from": "has-ansi@>=0.1.0 <0.2.0", + "_id": "has-ansi@0.1.0", + "_inCache": true, + "_location": "/gulp-gzip/has-ansi", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "1.4.9", + "_phantomChildren": {}, + "_requested": { + "raw": "has-ansi@^0.1.0", + "scope": null, + "escapedName": "has-ansi", + "name": "has-ansi", + "rawSpec": "^0.1.0", + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/chalk" + ], + "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", + "_shasum": "84f265aae8c0e6a88a12d7022894b7568894c62e", + "_shrinkwrap": null, + "_spec": "has-ansi@^0.1.0", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bin": { + "has-ansi": "cli.js" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-ansi/issues" + }, + "dependencies": { + "ansi-regex": "^0.2.0" + }, + "description": "Check if a string has ANSI escape codes", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "84f265aae8c0e6a88a12d7022894b7568894c62e", + "tarball": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "cli.js" + ], + "homepage": "https://github.com/sindresorhus/has-ansi", + "keywords": [ + "cli", + "bin", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern", + "has" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "has-ansi", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/has-ansi.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.1.0" +} diff --git a/node_modules/gulp-gzip/node_modules/has-ansi/readme.md b/node_modules/gulp-gzip/node_modules/has-ansi/readme.md new file mode 100644 index 000000000..070221231 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/has-ansi/readme.md @@ -0,0 +1,45 @@ +# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) + +> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +```sh +$ npm install --save has-ansi +``` + + +## Usage + +```js +var hasAnsi = require('has-ansi'); + +hasAnsi('\u001b[4mcake\u001b[0m'); +//=> true + +hasAnsi('cake'); +//=> false +``` + + +## CLI + +```sh +$ npm install --global has-ansi +``` + +``` +$ has-ansi --help + +Usage + $ has-ansi <string> + $ echo <string> | has-ansi + +Exits with code 0 if input has ANSI escape codes and 1 if not +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp-gzip/node_modules/lodash._reinterpolate/LICENSE.txt b/node_modules/gulp-gzip/node_modules/lodash._reinterpolate/LICENSE.txt new file mode 100644 index 000000000..49869bbab --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash._reinterpolate/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> + +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/gulp-gzip/node_modules/lodash._reinterpolate/README.md b/node_modules/gulp-gzip/node_modules/lodash._reinterpolate/README.md new file mode 100644 index 000000000..d362e36d6 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash._reinterpolate/README.md @@ -0,0 +1,15 @@ +# lodash._reinterpolate v2.4.1 + +The internal [Lo-Dash](http://lodash.com/) variable `reInterpolate` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/node_modules/gulp-gzip/node_modules/lodash._reinterpolate/index.js b/node_modules/gulp-gzip/node_modules/lodash._reinterpolate/index.js new file mode 100644 index 000000000..0bf92a5cc --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash._reinterpolate/index.js @@ -0,0 +1,13 @@ +/** + * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> + * Build: `lodash modularize modern exports="npm" -o ./npm/` + * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> + * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license <http://lodash.com/license> + */ + +/** Used to match "interpolate" template delimiters */ +var reInterpolate = /<%=([\s\S]+?)%>/g; + +module.exports = reInterpolate; diff --git a/node_modules/gulp-gzip/node_modules/lodash._reinterpolate/package.json b/node_modules/gulp-gzip/node_modules/lodash._reinterpolate/package.json new file mode 100644 index 000000000..6e252eadf --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash._reinterpolate/package.json @@ -0,0 +1,111 @@ +{ + "_args": [ + [ + { + "raw": "lodash._reinterpolate@^2.4.1", + "scope": null, + "escapedName": "lodash._reinterpolate", + "name": "lodash._reinterpolate", + "rawSpec": "^2.4.1", + "spec": ">=2.4.1 <3.0.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util" + ] + ], + "_from": "lodash._reinterpolate@>=2.4.1 <3.0.0", + "_id": "lodash._reinterpolate@2.4.1", + "_inCache": true, + "_location": "/gulp-gzip/lodash._reinterpolate", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "_npmVersion": "1.3.14", + "_phantomChildren": {}, + "_requested": { + "raw": "lodash._reinterpolate@^2.4.1", + "scope": null, + "escapedName": "lodash._reinterpolate", + "name": "lodash._reinterpolate", + "rawSpec": "^2.4.1", + "spec": ">=2.4.1 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/gulp-util", + "/gulp-gzip/lodash.template", + "/gulp-gzip/lodash.templatesettings" + ], + "_resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz", + "_shasum": "4f1227aa5a8711fc632f5b07a1f4607aab8b3222", + "_shrinkwrap": null, + "_spec": "lodash._reinterpolate@^2.4.1", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash-cli/issues" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "http://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The internal Lo-Dash variable `reInterpolate` as a Node.js module generated by lodash-cli.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "4f1227aa5a8711fc632f5b07a1f4607aab8b3222", + "tarball": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz" + }, + "homepage": "http://lodash.com/custom-builds", + "license": "MIT", + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "name": "lodash._reinterpolate", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash-cli.git" + }, + "version": "2.4.1" +} diff --git a/node_modules/gulp-gzip/node_modules/lodash.escape/LICENSE.txt b/node_modules/gulp-gzip/node_modules/lodash.escape/LICENSE.txt new file mode 100644 index 000000000..49869bbab --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.escape/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> + +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/gulp-gzip/node_modules/lodash.escape/README.md b/node_modules/gulp-gzip/node_modules/lodash.escape/README.md new file mode 100644 index 000000000..7cbc65384 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.escape/README.md @@ -0,0 +1,15 @@ +# lodash.escape v2.4.1 + +The [Lo-Dash](http://lodash.com/) function [`_.escape`](http://lodash.com/docs#escape) as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/node_modules/gulp-gzip/node_modules/lodash.escape/index.js b/node_modules/gulp-gzip/node_modules/lodash.escape/index.js new file mode 100644 index 000000000..343a4156d --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.escape/index.js @@ -0,0 +1,31 @@ +/** + * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> + * Build: `lodash modularize modern exports="npm" -o ./npm/` + * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> + * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license <http://lodash.com/license> + */ +var escapeHtmlChar = require('lodash._escapehtmlchar'), + keys = require('lodash.keys'), + reUnescapedHtml = require('lodash._reunescapedhtml'); + +/** + * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their + * corresponding HTML entities. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} string The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('Fred, Wilma, & Pebbles'); + * // => 'Fred, Wilma, & Pebbles' + */ +function escape(string) { + return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar); +} + +module.exports = escape; diff --git a/node_modules/gulp-gzip/node_modules/lodash.escape/package.json b/node_modules/gulp-gzip/node_modules/lodash.escape/package.json new file mode 100644 index 000000000..3d7df2ae2 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.escape/package.json @@ -0,0 +1,121 @@ +{ + "_args": [ + [ + { + "raw": "lodash.escape@~2.4.1", + "scope": null, + "escapedName": "lodash.escape", + "name": "lodash.escape", + "rawSpec": "~2.4.1", + "spec": ">=2.4.1 <2.5.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/lodash.template" + ] + ], + "_from": "lodash.escape@>=2.4.1 <2.5.0", + "_id": "lodash.escape@2.4.1", + "_inCache": true, + "_location": "/gulp-gzip/lodash.escape", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "_npmVersion": "1.3.14", + "_phantomChildren": {}, + "_requested": { + "raw": "lodash.escape@~2.4.1", + "scope": null, + "escapedName": "lodash.escape", + "name": "lodash.escape", + "rawSpec": "~2.4.1", + "spec": ">=2.4.1 <2.5.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/lodash.template", + "/gulp-gzip/lodash.templatesettings" + ], + "_resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-2.4.1.tgz", + "_shasum": "2ce12c5e084db0a57dda5e5d1eeeb9f5d175a3b4", + "_shrinkwrap": null, + "_spec": "lodash.escape@~2.4.1", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/lodash.template", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash-cli/issues" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "http://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._escapehtmlchar": "~2.4.1", + "lodash._reunescapedhtml": "~2.4.1", + "lodash.keys": "~2.4.1" + }, + "description": "The Lo-Dash function `_.escape` as a Node.js module generated by lodash-cli.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "2ce12c5e084db0a57dda5e5d1eeeb9f5d175a3b4", + "tarball": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-2.4.1.tgz" + }, + "homepage": "http://lodash.com/custom-builds", + "keywords": [ + "functional", + "lodash", + "lodash-modularized", + "server", + "util" + ], + "license": "MIT", + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "name": "lodash.escape", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash-cli.git" + }, + "version": "2.4.1" +} diff --git a/node_modules/gulp-gzip/node_modules/lodash.keys/LICENSE.txt b/node_modules/gulp-gzip/node_modules/lodash.keys/LICENSE.txt new file mode 100644 index 000000000..49869bbab --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.keys/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> + +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/gulp-gzip/node_modules/lodash.keys/README.md b/node_modules/gulp-gzip/node_modules/lodash.keys/README.md new file mode 100644 index 000000000..bee29a8d6 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.keys/README.md @@ -0,0 +1,15 @@ +# lodash.keys v2.4.1 + +The [Lo-Dash](http://lodash.com/) function [`_.keys`](http://lodash.com/docs#keys) as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/node_modules/gulp-gzip/node_modules/lodash.keys/index.js b/node_modules/gulp-gzip/node_modules/lodash.keys/index.js new file mode 100644 index 000000000..139568a2f --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.keys/index.js @@ -0,0 +1,36 @@ +/** + * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> + * Build: `lodash modularize modern exports="npm" -o ./npm/` + * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> + * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license <http://lodash.com/license> + */ +var isNative = require('lodash._isnative'), + isObject = require('lodash.isobject'), + shimKeys = require('lodash._shimkeys'); + +/* Native method shortcuts for methods with the same name as other `lodash` methods */ +var nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys; + +/** + * Creates an array composed of the own enumerable property names of an object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + * @example + * + * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); + * // => ['one', 'two', 'three'] (property order is not guaranteed across environments) + */ +var keys = !nativeKeys ? shimKeys : function(object) { + if (!isObject(object)) { + return []; + } + return nativeKeys(object); +}; + +module.exports = keys; diff --git a/node_modules/gulp-gzip/node_modules/lodash.keys/package.json b/node_modules/gulp-gzip/node_modules/lodash.keys/package.json new file mode 100644 index 000000000..feb773898 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.keys/package.json @@ -0,0 +1,121 @@ +{ + "_args": [ + [ + { + "raw": "lodash.keys@~2.4.1", + "scope": null, + "escapedName": "lodash.keys", + "name": "lodash.keys", + "rawSpec": "~2.4.1", + "spec": ">=2.4.1 <2.5.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/lodash.template" + ] + ], + "_from": "lodash.keys@>=2.4.1 <2.5.0", + "_id": "lodash.keys@2.4.1", + "_inCache": true, + "_location": "/gulp-gzip/lodash.keys", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "_npmVersion": "1.3.14", + "_phantomChildren": {}, + "_requested": { + "raw": "lodash.keys@~2.4.1", + "scope": null, + "escapedName": "lodash.keys", + "name": "lodash.keys", + "rawSpec": "~2.4.1", + "spec": ">=2.4.1 <2.5.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/lodash.escape", + "/gulp-gzip/lodash.template" + ], + "_resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", + "_shasum": "48dea46df8ff7632b10d706b8acb26591e2b3727", + "_shrinkwrap": null, + "_spec": "lodash.keys@~2.4.1", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/lodash.template", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash-cli/issues" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "http://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._isnative": "~2.4.1", + "lodash._shimkeys": "~2.4.1", + "lodash.isobject": "~2.4.1" + }, + "description": "The Lo-Dash function `_.keys` as a Node.js module generated by lodash-cli.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "48dea46df8ff7632b10d706b8acb26591e2b3727", + "tarball": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz" + }, + "homepage": "http://lodash.com/custom-builds", + "keywords": [ + "functional", + "lodash", + "lodash-modularized", + "server", + "util" + ], + "license": "MIT", + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "name": "lodash.keys", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash-cli.git" + }, + "version": "2.4.1" +} diff --git a/node_modules/gulp-gzip/node_modules/lodash.template/LICENSE.txt b/node_modules/gulp-gzip/node_modules/lodash.template/LICENSE.txt new file mode 100644 index 000000000..49869bbab --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.template/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> + +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/gulp-gzip/node_modules/lodash.template/README.md b/node_modules/gulp-gzip/node_modules/lodash.template/README.md new file mode 100644 index 000000000..e89bd0db6 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.template/README.md @@ -0,0 +1,15 @@ +# lodash.template v2.4.1 + +The [Lo-Dash](http://lodash.com/) function [`_.template`](http://lodash.com/docs#template) as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/node_modules/gulp-gzip/node_modules/lodash.template/index.js b/node_modules/gulp-gzip/node_modules/lodash.template/index.js new file mode 100644 index 000000000..230f8ee86 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.template/index.js @@ -0,0 +1,216 @@ +/** + * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> + * Build: `lodash modularize modern exports="npm" -o ./npm/` + * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> + * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license <http://lodash.com/license> + */ +var defaults = require('lodash.defaults'), + escape = require('lodash.escape'), + escapeStringChar = require('lodash._escapestringchar'), + keys = require('lodash.keys'), + reInterpolate = require('lodash._reinterpolate'), + templateSettings = require('lodash.templatesettings'), + values = require('lodash.values'); + +/** Used to match empty string literals in compiled template source */ +var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + +/** + * Used to match ES6 template delimiters + * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals + */ +var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + +/** Used to ensure capturing order of template delimiters */ +var reNoMatch = /($^)/; + +/** Used to match unescaped characters in compiled string literals */ +var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; + +/** + * A micro-templating method that handles arbitrary delimiters, preserves + * whitespace, and correctly escapes quotes within interpolated code. + * + * Note: In the development build, `_.template` utilizes sourceURLs for easier + * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl + * + * For more information on precompiling templates see: + * http://lodash.com/custom-builds + * + * For more information on Chrome extension sandboxes see: + * http://developer.chrome.com/stable/extensions/sandboxingEval.html + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} text The template text. + * @param {Object} data The data object used to populate the text. + * @param {Object} [options] The options object. + * @param {RegExp} [options.escape] The "escape" delimiter. + * @param {RegExp} [options.evaluate] The "evaluate" delimiter. + * @param {Object} [options.imports] An object to import into the template as local variables. + * @param {RegExp} [options.interpolate] The "interpolate" delimiter. + * @param {string} [sourceURL] The sourceURL of the template's compiled source. + * @param {string} [variable] The data object variable name. + * @returns {Function|string} Returns a compiled function when no `data` object + * is given, else it returns the interpolated text. + * @example + * + * // using the "interpolate" delimiter to create a compiled template + * var compiled = _.template('hello <%= name %>'); + * compiled({ 'name': 'fred' }); + * // => 'hello fred' + * + * // using the "escape" delimiter to escape HTML in data property values + * _.template('<b><%- value %></b>', { 'value': '<script>' }); + * // => '<b><script></b>' + * + * // using the "evaluate" delimiter to generate HTML + * var list = '<% _.forEach(people, function(name) { %><li><%- name %></li><% }); %>'; + * _.template(list, { 'people': ['fred', 'barney'] }); + * // => '<li>fred</li><li>barney</li>' + * + * // using the ES6 delimiter as an alternative to the default "interpolate" delimiter + * _.template('hello ${ name }', { 'name': 'pebbles' }); + * // => 'hello pebbles' + * + * // using the internal `print` function in "evaluate" delimiters + * _.template('<% print("hello " + name); %>!', { 'name': 'barney' }); + * // => 'hello barney!' + * + * // using a custom template delimiters + * _.templateSettings = { + * 'interpolate': /{{([\s\S]+?)}}/g + * }; + * + * _.template('hello {{ name }}!', { 'name': 'mustache' }); + * // => 'hello mustache!' + * + * // using the `imports` option to import jQuery + * var list = '<% jq.each(people, function(name) { %><li><%- name %></li><% }); %>'; + * _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { 'jq': jQuery } }); + * // => '<li>fred</li><li>barney</li>' + * + * // using the `sourceURL` option to specify a custom sourceURL for the template + * var compiled = _.template('hello <%= name %>', null, { 'sourceURL': '/basic/greeting.jst' }); + * compiled(data); + * // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector + * + * // using the `variable` option to ensure a with-statement isn't used in the compiled template + * var compiled = _.template('hi <%= data.name %>!', null, { 'variable': 'data' }); + * compiled.source; + * // => function(data) { + * var __t, __p = '', __e = _.escape; + * __p += 'hi ' + ((__t = ( data.name )) == null ? '' : __t) + '!'; + * return __p; + * } + * + * // using the `source` property to inline compiled templates for meaningful + * // line numbers in error messages and a stack trace + * fs.writeFileSync(path.join(cwd, 'jst.js'), '\ + * var JST = {\ + * "main": ' + _.template(mainText).source + '\ + * };\ + * '); + */ +function template(text, data, options) { + // based on John Resig's `tmpl` implementation + // http://ejohn.org/blog/javascript-micro-templating/ + // and Laura Doktorova's doT.js + // https://github.com/olado/doT + var settings = templateSettings.imports._.templateSettings || templateSettings; + text = String(text || ''); + + // avoid missing dependencies when `iteratorTemplate` is not defined + options = defaults({}, options, settings); + + var imports = defaults({}, options.imports, settings.imports), + importsKeys = keys(imports), + importsValues = values(imports); + + var isEvaluating, + index = 0, + interpolate = options.interpolate || reNoMatch, + source = "__p += '"; + + // compile the regexp to match each delimiter + var reDelimiters = RegExp( + (options.escape || reNoMatch).source + '|' + + interpolate.source + '|' + + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + + (options.evaluate || reNoMatch).source + '|$' + , 'g'); + + text.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { + interpolateValue || (interpolateValue = esTemplateValue); + + // escape characters that cannot be included in string literals + source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar); + + // replace delimiters with snippets + if (escapeValue) { + source += "' +\n__e(" + escapeValue + ") +\n'"; + } + if (evaluateValue) { + isEvaluating = true; + source += "';\n" + evaluateValue + ";\n__p += '"; + } + if (interpolateValue) { + source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; + } + index = offset + match.length; + + // the JS engine embedded in Adobe products requires returning the `match` + // string in order to produce the correct `offset` value + return match; + }); + + source += "';\n"; + + // if `variable` is not specified, wrap a with-statement around the generated + // code to add the data object to the top of the scope chain + var variable = options.variable, + hasVariable = variable; + + if (!hasVariable) { + variable = 'obj'; + source = 'with (' + variable + ') {\n' + source + '\n}\n'; + } + // cleanup code by stripping empty strings + source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) + .replace(reEmptyStringMiddle, '$1') + .replace(reEmptyStringTrailing, '$1;'); + + // frame code as the function body + source = 'function(' + variable + ') {\n' + + (hasVariable ? '' : variable + ' || (' + variable + ' = {});\n') + + "var __t, __p = '', __e = _.escape" + + (isEvaluating + ? ', __j = Array.prototype.join;\n' + + "function print() { __p += __j.call(arguments, '') }\n" + : ';\n' + ) + + source + + 'return __p\n}'; + + try { + var result = Function(importsKeys, 'return ' + source ).apply(undefined, importsValues); + } catch(e) { + e.source = source; + throw e; + } + if (data) { + return result(data); + } + // provide the compiled function's source by its `toString` method, in + // supported environments, or the `source` property as a convenience for + // inlining compiled templates during the build process + result.source = source; + return result; +} + +module.exports = template; diff --git a/node_modules/gulp-gzip/node_modules/lodash.template/package.json b/node_modules/gulp-gzip/node_modules/lodash.template/package.json new file mode 100644 index 000000000..9b1c578c8 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.template/package.json @@ -0,0 +1,124 @@ +{ + "_args": [ + [ + { + "raw": "lodash.template@^2.4.1", + "scope": null, + "escapedName": "lodash.template", + "name": "lodash.template", + "rawSpec": "^2.4.1", + "spec": ">=2.4.1 <3.0.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util" + ] + ], + "_from": "lodash.template@>=2.4.1 <3.0.0", + "_id": "lodash.template@2.4.1", + "_inCache": true, + "_location": "/gulp-gzip/lodash.template", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "_npmVersion": "1.3.14", + "_phantomChildren": {}, + "_requested": { + "raw": "lodash.template@^2.4.1", + "scope": null, + "escapedName": "lodash.template", + "name": "lodash.template", + "rawSpec": "^2.4.1", + "spec": ">=2.4.1 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/gulp-util" + ], + "_resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-2.4.1.tgz", + "_shasum": "9e611007edf629129a974ab3c48b817b3e1cf20d", + "_shrinkwrap": null, + "_spec": "lodash.template@^2.4.1", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash-cli/issues" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "http://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._escapestringchar": "~2.4.1", + "lodash._reinterpolate": "~2.4.1", + "lodash.defaults": "~2.4.1", + "lodash.escape": "~2.4.1", + "lodash.keys": "~2.4.1", + "lodash.templatesettings": "~2.4.1", + "lodash.values": "~2.4.1" + }, + "description": "The Lo-Dash function `_.template` as a Node.js module generated by lodash-cli.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "9e611007edf629129a974ab3c48b817b3e1cf20d", + "tarball": "https://registry.npmjs.org/lodash.template/-/lodash.template-2.4.1.tgz" + }, + "homepage": "http://lodash.com/custom-builds", + "keywords": [ + "functional", + "lodash", + "lodash-modularized", + "server", + "util" + ], + "license": "MIT", + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "name": "lodash.template", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash-cli.git" + }, + "version": "2.4.1" +} diff --git a/node_modules/gulp-gzip/node_modules/lodash.templatesettings/LICENSE.txt b/node_modules/gulp-gzip/node_modules/lodash.templatesettings/LICENSE.txt new file mode 100644 index 000000000..49869bbab --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.templatesettings/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> +Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> + +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/gulp-gzip/node_modules/lodash.templatesettings/README.md b/node_modules/gulp-gzip/node_modules/lodash.templatesettings/README.md new file mode 100644 index 000000000..d9ce72bcf --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.templatesettings/README.md @@ -0,0 +1,15 @@ +# lodash.templatesettings v2.4.1 + +The [Lo-Dash](http://lodash.com/) object [`_.templateSettings`](http://lodash.com/docs#templateSettings) as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/node_modules/gulp-gzip/node_modules/lodash.templatesettings/index.js b/node_modules/gulp-gzip/node_modules/lodash.templatesettings/index.js new file mode 100644 index 000000000..bba7e231c --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.templatesettings/index.js @@ -0,0 +1,73 @@ +/** + * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> + * Build: `lodash modularize modern exports="npm" -o ./npm/` + * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> + * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license <http://lodash.com/license> + */ +var escape = require('lodash.escape'), + reInterpolate = require('lodash._reinterpolate'); + +/** + * By default, the template delimiters used by Lo-Dash are similar to those in + * embedded Ruby (ERB). Change the following template settings to use alternative + * delimiters. + * + * @static + * @memberOf _ + * @type Object + */ +var templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'escape': /<%-([\s\S]+?)%>/g, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'evaluate': /<%([\s\S]+?)%>/g, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type string + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type Object + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type Function + */ + '_': { 'escape': escape } + } +}; + +module.exports = templateSettings; diff --git a/node_modules/gulp-gzip/node_modules/lodash.templatesettings/package.json b/node_modules/gulp-gzip/node_modules/lodash.templatesettings/package.json new file mode 100644 index 000000000..1c6e962eb --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/lodash.templatesettings/package.json @@ -0,0 +1,119 @@ +{ + "_args": [ + [ + { + "raw": "lodash.templatesettings@~2.4.1", + "scope": null, + "escapedName": "lodash.templatesettings", + "name": "lodash.templatesettings", + "rawSpec": "~2.4.1", + "spec": ">=2.4.1 <2.5.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/lodash.template" + ] + ], + "_from": "lodash.templatesettings@>=2.4.1 <2.5.0", + "_id": "lodash.templatesettings@2.4.1", + "_inCache": true, + "_location": "/gulp-gzip/lodash.templatesettings", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "_npmVersion": "1.3.14", + "_phantomChildren": {}, + "_requested": { + "raw": "lodash.templatesettings@~2.4.1", + "scope": null, + "escapedName": "lodash.templatesettings", + "name": "lodash.templatesettings", + "rawSpec": "~2.4.1", + "spec": ">=2.4.1 <2.5.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/lodash.template" + ], + "_resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz", + "_shasum": "ea76c75d11eb86d4dbe89a83893bb861929ac699", + "_shrinkwrap": null, + "_spec": "lodash.templatesettings@~2.4.1", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/lodash.template", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash-cli/issues" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "http://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._reinterpolate": "~2.4.1", + "lodash.escape": "~2.4.1" + }, + "description": "The Lo-Dash object `_.templateSettings` as a Node.js module generated by lodash-cli.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "ea76c75d11eb86d4dbe89a83893bb861929ac699", + "tarball": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz" + }, + "homepage": "http://lodash.com/custom-builds", + "keywords": [ + "functional", + "lodash", + "lodash-modularized", + "server", + "util" + ], + "license": "MIT", + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "name": "lodash.templatesettings", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash-cli.git" + }, + "version": "2.4.1" +} diff --git a/node_modules/gulp-gzip/node_modules/minimist/.travis.yml b/node_modules/gulp-gzip/node_modules/minimist/.travis.yml new file mode 100644 index 000000000..cc4dba29d --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/gulp-gzip/node_modules/minimist/LICENSE b/node_modules/gulp-gzip/node_modules/minimist/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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/gulp-gzip/node_modules/minimist/example/parse.js b/node_modules/gulp-gzip/node_modules/minimist/example/parse.js new file mode 100644 index 000000000..abff3e8ee --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/example/parse.js @@ -0,0 +1,2 @@ +var argv = require('../')(process.argv.slice(2)); +console.dir(argv); diff --git a/node_modules/gulp-gzip/node_modules/minimist/index.js b/node_modules/gulp-gzip/node_modules/minimist/index.js new file mode 100644 index 000000000..9549c96fb --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/index.js @@ -0,0 +1,200 @@ +module.exports = function (args, opts) { + if (!opts) opts = {}; + + var flags = { bools : {}, strings : {} }; + + if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { + flags.allBools = true; + } else { + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + } + + var aliases = {}; + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + if (aliases[key]) { + flags.strings[aliases[key]] = true; + } + }); + + var defaults = opts['default'] || {}; + + var argv = { _ : [] }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--')+1); + args = args.slice(0, args.indexOf('--')); + } + + function setArg (key, val) { + var value = !flags.strings[key] && isNumber(val) + ? Number(val) : val + ; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (/^--.+=/.test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + setArg(m[1], m[2]); + } + else if (/^--no-.+/.test(arg)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false); + } + else if (/^--.+/.test(arg)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !/^-/.test(next) + && !flags.bools[key] + && !flags.allBools + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true'); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true); + } + } + else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + var next = arg.slice(j+2); + + if (next === '-') { + setArg(letters[j], next) + continue; + } + + if (/[A-Za-z]/.test(letters[j]) + && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next); + broken = true; + break; + } + + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2)); + broken = true; + break; + } + else { + setArg(letters[j], flags.strings[letters[j]] ? '' : true); + } + } + + var key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, args[i+1]); + i++; + } + else if (args[i+1] && /true|false/.test(args[i+1])) { + setArg(key, args[i+1] === 'true'); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true); + } + } + } + else { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ); + } + } + + Object.keys(defaults).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) { + setKey(argv, key.split('.'), defaults[key]); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[key]); + }); + } + }); + + if (opts['--']) { + argv['--'] = new Array(); + notFlags.forEach(function(key) { + argv['--'].push(key); + }); + } + else { + notFlags.forEach(function(key) { + argv._.push(key); + }); + } + + return argv; +}; + +function hasKey (obj, keys) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + o = (o[key] || {}); + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function setKey (obj, keys, value) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + if (o[key] === undefined) o[key] = {}; + o = o[key]; + }); + + var key = keys[keys.length - 1]; + if (o[key] === undefined || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } +} + +function isNumber (x) { + if (typeof x === 'number') return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + diff --git a/node_modules/gulp-gzip/node_modules/minimist/package.json b/node_modules/gulp-gzip/node_modules/minimist/package.json new file mode 100644 index 000000000..ad9ba9a79 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/package.json @@ -0,0 +1,102 @@ +{ + "_args": [ + [ + { + "raw": "minimist@^0.2.0", + "scope": null, + "escapedName": "minimist", + "name": "minimist", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util" + ] + ], + "_from": "minimist@>=0.2.0 <0.3.0", + "_id": "minimist@0.2.0", + "_inCache": true, + "_location": "/gulp-gzip/minimist", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "_npmVersion": "1.4.15", + "_phantomChildren": {}, + "_requested": { + "raw": "minimist@^0.2.0", + "scope": null, + "escapedName": "minimist", + "name": "minimist", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/gulp-util" + ], + "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.2.0.tgz", + "_shasum": "4dffe525dae2b864c66c2e23c6271d7afdecefce", + "_shrinkwrap": null, + "_spec": "minimist@^0.2.0", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/minimist/issues" + }, + "dependencies": {}, + "description": "parse argument options", + "devDependencies": { + "tap": "~0.4.0", + "tape": "~1.0.4" + }, + "directories": {}, + "dist": { + "shasum": "4dffe525dae2b864c66c2e23c6271d7afdecefce", + "tarball": "https://registry.npmjs.org/minimist/-/minimist-0.2.0.tgz" + }, + "gitHead": "f904dcc3c28f10eb11840091e9f0bab9d9519b5c", + "homepage": "https://github.com/substack/minimist", + "keywords": [ + "argv", + "getopt", + "parser", + "optimist" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "minimist", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/minimist.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "ff/5", + "firefox/latest", + "chrome/10", + "chrome/latest", + "safari/5.1", + "safari/latest", + "opera/12" + ] + }, + "version": "0.2.0" +} diff --git a/node_modules/gulp-gzip/node_modules/minimist/readme.markdown b/node_modules/gulp-gzip/node_modules/minimist/readme.markdown new file mode 100644 index 000000000..82532210a --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/readme.markdown @@ -0,0 +1,86 @@ +# minimist + +parse argument options + +This module is the guts of optimist's argument parser without all the +fanciful decoration. + +[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) + +[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) + +# example + +``` js +var argv = require('minimist')(process.argv.slice(2)); +console.dir(argv); +``` + +``` +$ node example/parse.js -a beep -b boop +{ _: [], a: 'beep', b: 'boop' } +``` + +``` +$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +{ _: [ 'foo', 'bar', 'baz' ], + x: 3, + y: 4, + n: 5, + a: true, + b: true, + c: true, + beep: 'boop' } +``` + +# methods + +``` js +var parseArgs = require('minimist') +``` + +## var argv = parseArgs(args, opts={}) + +Return an argument object `argv` populated with the array arguments from `args`. + +`argv._` contains all the arguments that didn't have an option associated with +them. + +Numeric-looking arguments will be returned as numbers unless `opts.string` or +`opts.boolean` is set for that argument name. + +Any arguments after `'--'` will not be parsed and will end up in `argv._`. + +options can be: + +* `opts.string` - a string or array of strings argument names to always treat as +strings +* `opts.boolean` - a boolean, string or array of strings to always treat as +booleans. if `true` will treat all double hyphenated arguments without equal signs +as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) +* `opts.alias` - an object mapping string names to strings or arrays of string +argument names to use as aliases +* `opts.default` - an object mapping string argument names to default values +* `opts['--']` - when true, populate `argv._` with everything before the `--` +and `argv['--']` with everything after the `--`. Here's an example: + +``` +> require('./')('one two three -- four five --six'.split(' '), { '--': true }) +{ _: [ 'one', 'two', 'three' ], + '--': [ 'four', 'five', '--six' ] } +``` + +Note that with `opts['--']` set, parsing for arguments still stops after the +`--`. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install minimist +``` + +# license + +MIT diff --git a/node_modules/gulp-gzip/node_modules/minimist/test/all_bool.js b/node_modules/gulp-gzip/node_modules/minimist/test/all_bool.js new file mode 100644 index 000000000..4575ec0b4 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/test/all_bool.js @@ -0,0 +1,32 @@ +var parse = require('../'); +var test = require('tape'); + +test('flag boolean true (default all --args to boolean)', function (t) { + var argv = parse(['moo', '--honk', 'cow'], { + boolean: true + }); + + t.deepEqual(argv, { + honk: true, + _: ['moo', 'cow'] + }); + + t.deepEqual(typeof argv.honk, 'boolean'); + t.end(); +}); + +test('flag boolean true only affects double hyphen arguments without equals signs', function (t) { + var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], { + boolean: true + }); + + t.deepEqual(argv, { + honk: true, + tacos: 'good', + p: '55', + _: ['moo', 'cow'] + }); + + t.deepEqual(typeof argv.honk, 'boolean'); + t.end(); +}); diff --git a/node_modules/gulp-gzip/node_modules/minimist/test/bool.js b/node_modules/gulp-gzip/node_modules/minimist/test/bool.js new file mode 100644 index 000000000..749e083cb --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/test/bool.js @@ -0,0 +1,119 @@ +var parse = require('../'); +var test = require('tape'); + +test('flag boolean default false', function (t) { + var argv = parse(['moo'], { + boolean: ['t', 'verbose'], + default: { verbose: false, t: false } + }); + + t.deepEqual(argv, { + verbose: false, + t: false, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { + boolean: ['x','y','z'] + }); + + t.deepEqual(argv, { + x : true, + y : false, + z : true, + _ : [ 'one', 'two', 'three' ] + }); + + t.deepEqual(typeof argv.x, 'boolean'); + t.deepEqual(typeof argv.y, 'boolean'); + t.deepEqual(typeof argv.z, 'boolean'); + t.end(); +}); +test('boolean and alias with chainable api', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = parse(aliased, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var propertyArgv = parse(regular, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + alias: { 'h': 'herp' }, + boolean: 'herp' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = [ '-h', 'true' ]; + var regular = [ '--herp', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function(t) { + var parsed = parse(['--boool', '--other=true'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = parse(['--boool', '--other=false'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); diff --git a/node_modules/gulp-gzip/node_modules/minimist/test/dash.js b/node_modules/gulp-gzip/node_modules/minimist/test/dash.js new file mode 100644 index 000000000..5a4fa5be4 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/test/dash.js @@ -0,0 +1,31 @@ +var parse = require('../'); +var test = require('tape'); + +test('-', function (t) { + t.plan(5); + t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); + t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); + t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); + t.deepEqual( + parse([ '-b', '-' ], { boolean: 'b' }), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + parse([ '-s', '-' ], { string: 's' }), + { s: '-', _: [] } + ); +}); + +test('-a -- b', function (t) { + t.plan(3); + t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); +}); + +test('move arguments after the -- into their own `--` array', function(t) { + t.plan(1); + t.deepEqual( + parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }), + { name: 'John', _: [ 'before' ], '--': [ 'after' ] }); +}); diff --git a/node_modules/gulp-gzip/node_modules/minimist/test/default_bool.js b/node_modules/gulp-gzip/node_modules/minimist/test/default_bool.js new file mode 100644 index 000000000..f0041ee40 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/test/default_bool.js @@ -0,0 +1,20 @@ +var test = require('tape'); +var parse = require('../'); + +test('boolean default true', function (t) { + var argv = parse([], { + boolean: 'sometrue', + default: { sometrue: true } + }); + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = parse([], { + boolean: 'somefalse', + default: { somefalse: false } + }); + t.equal(argv.somefalse, false); + t.end(); +}); diff --git a/node_modules/gulp-gzip/node_modules/minimist/test/dotted.js b/node_modules/gulp-gzip/node_modules/minimist/test/dotted.js new file mode 100644 index 000000000..d8b3e856e --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/test/dotted.js @@ -0,0 +1,22 @@ +var parse = require('../'); +var test = require('tape'); + +test('dotted alias', function (t) { + var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 22); + t.equal(argv.aa.bb, 22); + t.end(); +}); + +test('dotted default', function (t) { + var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 11); + t.equal(argv.aa.bb, 11); + t.end(); +}); + +test('dotted default with no alias', function (t) { + var argv = parse('', {default: {'a.b': 11}}); + t.equal(argv.a.b, 11); + t.end(); +}); diff --git a/node_modules/gulp-gzip/node_modules/minimist/test/long.js b/node_modules/gulp-gzip/node_modules/minimist/test/long.js new file mode 100644 index 000000000..5d3a1e09d --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/test/long.js @@ -0,0 +1,31 @@ +var test = require('tape'); +var parse = require('../'); + +test('long opts', function (t) { + t.deepEqual( + parse([ '--bool' ]), + { bool : true, _ : [] }, + 'long boolean' + ); + t.deepEqual( + parse([ '--pow', 'xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture sp' + ); + t.deepEqual( + parse([ '--pow=xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture eq' + ); + t.deepEqual( + parse([ '--host', 'localhost', '--port', '555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures sp' + ); + t.deepEqual( + parse([ '--host=localhost', '--port=555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures eq' + ); + t.end(); +}); diff --git a/node_modules/gulp-gzip/node_modules/minimist/test/num.js b/node_modules/gulp-gzip/node_modules/minimist/test/num.js new file mode 100644 index 000000000..2cc77f4d6 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/test/num.js @@ -0,0 +1,36 @@ +var parse = require('../'); +var test = require('tape'); + +test('nums', function (t) { + var argv = parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789' + ]); + t.deepEqual(argv, { + x : 1234, + y : 5.67, + z : 1e7, + w : '10f', + hex : 0xdeadbeef, + _ : [ 789 ] + }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv.y, 'number'); + t.deepEqual(typeof argv.z, 'number'); + t.deepEqual(typeof argv.w, 'string'); + t.deepEqual(typeof argv.hex, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); + +test('already a number', function (t) { + var argv = parse([ '-x', 1234, 789 ]); + t.deepEqual(argv, { x : 1234, _ : [ 789 ] }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); diff --git a/node_modules/gulp-gzip/node_modules/minimist/test/parse.js b/node_modules/gulp-gzip/node_modules/minimist/test/parse.js new file mode 100644 index 000000000..7b4a2a17c --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/test/parse.js @@ -0,0 +1,197 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse args', function (t) { + t.deepEqual( + parse([ '--no-moo' ]), + { moo : false, _ : [] }, + 'no' + ); + t.deepEqual( + parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), + { v : ['a','b','c'], _ : [] }, + 'multi' + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.deepEqual( + parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek' + ]), + { + c : true, + a : true, + t : true, + s : 'woo', + h : 'awesome', + b : true, + bool : true, + key : 'value', + multi : [ 'quux', 'baz' ], + meep : false, + name : 'meowmers', + _ : [ 'bare', '--not-a-flag', 'eek' ] + } + ); + t.end(); +}); + +test('flag boolean', function (t) { + var argv = parse([ '-t', 'moo' ], { boolean: 't' }); + t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { + boolean: [ 't', 'verbose' ], + default: { verbose: true } + }); + + t.deepEqual(argv, { + verbose: false, + t: true, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('newlines in params' , function (t) { + var args = parse([ '-s', "X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = parse([ "--s=X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + t.end(); +}); + +test('strings' , function (t) { + var s = parse([ '-s', '0001234' ], { string: 's' }).s; + t.equal(s, '0001234'); + t.equal(typeof s, 'string'); + + var x = parse([ '-x', '56' ], { string: 'x' }).x; + t.equal(x, '56'); + t.equal(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = parse([ ' ', ' ' ], { string: '_' })._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('empty strings', function(t) { + var s = parse([ '-s' ], { string: 's' }).s; + t.equal(s, ''); + t.equal(typeof s, 'string'); + + var str = parse([ '--str' ], { string: 'str' }).str; + t.equal(str, ''); + t.equal(typeof str, 'string'); + + var letters = parse([ '-art' ], { + string: [ 'a', 't' ] + }); + + t.equal(letters.a, ''); + t.equal(letters.r, true); + t.equal(letters.t, ''); + + t.end(); +}); + + +test('string and alias', function(t) { + var x = parse([ '--str', '000123' ], { + string: 's', + alias: { s: 'str' } + }); + + t.equal(x.str, '000123'); + t.equal(typeof x.str, 'string'); + t.equal(x.s, '000123'); + t.equal(typeof x.s, 'string'); + + var y = parse([ '-s', '000123' ], { + string: 'str', + alias: { str: 's' } + }); + + t.equal(y.str, '000123'); + t.equal(typeof y.str, 'string'); + t.equal(y.s, '000123'); + t.equal(typeof y.s, 'string'); + t.end(); +}); + +test('slashBreak', function (t) { + t.same( + parse([ '-I/foo/bar/baz' ]), + { I : '/foo/bar/baz', _ : [] } + ); + t.same( + parse([ '-xyz/foo/bar/baz' ]), + { x : true, y : true, z : '/foo/bar/baz', _ : [] } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: 'zoom' } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: [ 'zm', 'zoom' ] } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = parse([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop' + ]); + + t.same(argv.foo, { + bar : 3, + baz : 4, + quux : { + quibble : 5, + o_O : true + } + }); + t.same(argv.beep, { boop : true }); + t.end(); +}); diff --git a/node_modules/gulp-gzip/node_modules/minimist/test/parse_modified.js b/node_modules/gulp-gzip/node_modules/minimist/test/parse_modified.js new file mode 100644 index 000000000..21851b036 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/test/parse_modified.js @@ -0,0 +1,9 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse with modifier functions' , function (t) { + t.plan(1); + + var argv = parse([ '-b', '123' ], { boolean: 'b' }); + t.deepEqual(argv, { b: true, _: ['123'] }); +}); diff --git a/node_modules/gulp-gzip/node_modules/minimist/test/short.js b/node_modules/gulp-gzip/node_modules/minimist/test/short.js new file mode 100644 index 000000000..d513a1c25 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/test/short.js @@ -0,0 +1,67 @@ +var parse = require('../'); +var test = require('tape'); + +test('numeric short args', function (t) { + t.plan(2); + t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); + t.deepEqual( + parse([ '-123', '456' ]), + { 1: true, 2: true, 3: 456, _: [] } + ); +}); + +test('short', function (t) { + t.deepEqual( + parse([ '-b' ]), + { b : true, _ : [] }, + 'short boolean' + ); + t.deepEqual( + parse([ 'foo', 'bar', 'baz' ]), + { _ : [ 'foo', 'bar', 'baz' ] }, + 'bare' + ); + t.deepEqual( + parse([ '-cats' ]), + { c : true, a : true, t : true, s : true, _ : [] }, + 'group' + ); + t.deepEqual( + parse([ '-cats', 'meow' ]), + { c : true, a : true, t : true, s : 'meow', _ : [] }, + 'short group next' + ); + t.deepEqual( + parse([ '-h', 'localhost' ]), + { h : 'localhost', _ : [] }, + 'short capture' + ); + t.deepEqual( + parse([ '-h', 'localhost', '-p', '555' ]), + { h : 'localhost', p : 555, _ : [] }, + 'short captures' + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.deepEqual( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); diff --git a/node_modules/gulp-gzip/node_modules/minimist/test/whitespace.js b/node_modules/gulp-gzip/node_modules/minimist/test/whitespace.js new file mode 100644 index 000000000..8a52a58ce --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/minimist/test/whitespace.js @@ -0,0 +1,8 @@ +var parse = require('../'); +var test = require('tape'); + +test('whitespace should be whitespace' , function (t) { + t.plan(1); + var x = parse([ '-x', '\t' ]).x; + t.equal(x, '\t'); +}); diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/.npmignore b/node_modules/gulp-gzip/node_modules/readable-stream/.npmignore new file mode 100644 index 000000000..38344f87a --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/.npmignore @@ -0,0 +1,5 @@ +build/ +test/ +examples/ +fs.js +zlib.js
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/LICENSE b/node_modules/gulp-gzip/node_modules/readable-stream/LICENSE new file mode 100644 index 000000000..e3d4e695a --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/LICENSE @@ -0,0 +1,18 @@ +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +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/gulp-gzip/node_modules/readable-stream/README.md b/node_modules/gulp-gzip/node_modules/readable-stream/README.md new file mode 100644 index 000000000..3fb3e8023 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/README.md @@ -0,0 +1,15 @@ +# readable-stream + +***Node-core streams for userland*** + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + +This package is a mirror of the Streams2 and Streams3 implementations in Node-core. + +If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core. + +**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12. + +**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"` + diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/duplex.js b/node_modules/gulp-gzip/node_modules/readable-stream/duplex.js new file mode 100644 index 000000000..ca807af87 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_duplex.js") diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 000000000..b513d61a9 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,89 @@ +// Copyright Joyent, Inc. and other Node 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. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +module.exports = Duplex; + +/*<replacement>*/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} +/*</replacement>*/ + + +/*<replacement>*/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/*</replacement>*/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +forEach(objectKeys(Writable.prototype), function(method) { + if (!Duplex.prototype[method]) + Duplex.prototype[method] = Writable.prototype[method]; +}); + +function Duplex(options) { + if (!(this instanceof Duplex)) + return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) + this.readable = false; + + if (options && options.writable === false) + this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) + this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) + return; + + // no more data can be written. + // But allow more writes to happen in this tick. + process.nextTick(this.end.bind(this)); +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 000000000..895ca50a1 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,46 @@ +// Copyright Joyent, Inc. and other Node 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. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/*<replacement>*/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/*</replacement>*/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) + return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); +}; diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 000000000..630722099 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,982 @@ +// Copyright Joyent, Inc. and other Node 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. + +module.exports = Readable; + +/*<replacement>*/ +var isArray = require('isarray'); +/*</replacement>*/ + + +/*<replacement>*/ +var Buffer = require('buffer').Buffer; +/*</replacement>*/ + +Readable.ReadableState = ReadableState; + +var EE = require('events').EventEmitter; + +/*<replacement>*/ +if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { + return emitter.listeners(type).length; +}; +/*</replacement>*/ + +var Stream = require('stream'); + +/*<replacement>*/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/*</replacement>*/ + +var StringDecoder; + +util.inherits(Readable, Stream); + +function ReadableState(options, stream) { + options = options || {}; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = false; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // In streams that never have any data, and do push(null) right away, + // the consumer can miss the 'end' event if they do some I/O before + // consuming the stream. So, we don't emit('end') until some reading + // happens. + this.calledRead = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, becuase any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + if (!(this instanceof Readable)) + return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function(chunk, encoding) { + var state = this._readableState; + + if (typeof chunk === 'string' && !state.objectMode) { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = new Buffer(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function(chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null || chunk === undefined) { + state.reading = false; + if (!state.ended) + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + if (state.decoder && !addToFront && !encoding) + chunk = state.decoder.write(chunk); + + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) { + state.buffer.unshift(chunk); + } else { + state.reading = false; + state.buffer.push(chunk); + } + + if (state.needReadable) + emitReadable(stream); + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + + + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && + (state.needReadable || + state.length < state.highWaterMark || + state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function(enc) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; +}; + +// Don't raise the hwm > 128MB +var MAX_HWM = 0x800000; +function roundUpToNextPowerOf2(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + for (var p = 1; p < 32; p <<= 1) n |= n >> p; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) + return 0; + + if (state.objectMode) + return n === 0 ? 0 : 1; + + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) + return state.buffer[0].length; + else + return state.length; + } + + if (n <= 0) + return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) + state.highWaterMark = roundUpToNextPowerOf2(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else + return state.length; + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function(n) { + var state = this._readableState; + state.calledRead = true; + var nOrig = n; + var ret; + + if (typeof n !== 'number' || n > 0) + state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && + state.needReadable && + (state.length >= state.highWaterMark || state.ended)) { + emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + ret = null; + + // In cases where the decoder did not receive enough data + // to produce a full chunk, then immediately received an + // EOF, state.buffer will contain [<Buffer >, <Buffer 00 ...>]. + // howMuchToRead will see this and coerce the amount to + // read to zero (because it's looking at the length of the + // first <Buffer > in state.buffer), and we'll end up here. + // + // This can only happen via state.decoder -- no other venue + // exists for pushing a zero-length chunk into state.buffer + // and triggering this behavior. In this case, we return our + // remaining data and end the stream, if appropriate. + if (state.length > 0 && state.decoder) { + ret = fromList(n, state); + state.length -= ret.length; + } + + if (state.length === 0) + endReadable(this); + + return ret; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + + // if we currently have less than the highWaterMark, then also read some + if (state.length - n <= state.highWaterMark) + doRead = true; + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) + doRead = false; + + if (doRead) { + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) + state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read called its callback synchronously, then `reading` + // will be false, and we need to re-evaluate how much data we + // can return to the user. + if (doRead && !state.reading) + n = howMuchToRead(nOrig, state); + + if (n > 0) + ret = fromList(n, state); + else + ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) + state.needReadable = true; + + // If we happened to read() exactly the remaining amount in the + // buffer, and the EOF has been seen at this point, then make sure + // that we emit 'end' on the very next tick. + if (state.ended && !state.endEmitted && state.length === 0) + endReadable(this); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && + 'string' !== typeof chunk && + chunk !== null && + chunk !== undefined && + !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + + +function onEofChunk(stream, state) { + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // if we've ended and we have some data left, then emit + // 'readable' now to make sure it gets picked up. + if (state.length > 0) + emitReadable(stream); + else + endReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (state.emittedReadable) + return; + + state.emittedReadable = true; + if (state.sync) + process.nextTick(function() { + emitReadable_(stream); + }); + else + emitReadable_(stream); +} + +function emitReadable_(stream) { + stream.emit('readable'); +} + + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(function() { + maybeReadMore_(stream, state); + }); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && + state.length < state.highWaterMark) { + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break; + else + len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function(n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && + dest !== process.stdout && + dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) + process.nextTick(endFn); + else + src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + if (readable !== src) return; + cleanup(); + } + + function onend() { + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + function cleanup() { + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (!dest._writableState || dest._writableState.needDrain) + ondrain(); + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + unpipe(); + dest.removeListener('error', onerror); + if (EE.listenerCount(dest, 'error') === 0) + dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) + dest.on('error', onerror); + else if (isArray(dest._events.error)) + dest._events.error.unshift(onerror); + else + dest._events.error = [onerror, dest._events.error]; + + + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + // the handler that waits for readable events after all + // the data gets sucked out in flow. + // This would be easier to follow with a .once() handler + // in flow(), but that is too slow. + this.on('readable', pipeOnReadable); + + state.flowing = true; + process.nextTick(function() { + flow(src); + }); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function() { + var dest = this; + var state = src._readableState; + state.awaitDrain--; + if (state.awaitDrain === 0) + flow(src); + }; +} + +function flow(src) { + var state = src._readableState; + var chunk; + state.awaitDrain = 0; + + function write(dest, i, list) { + var written = dest.write(chunk); + if (false === written) { + state.awaitDrain++; + } + } + + while (state.pipesCount && null !== (chunk = src.read())) { + + if (state.pipesCount === 1) + write(state.pipes, 0, null); + else + forEach(state.pipes, write); + + src.emit('data', chunk); + + // if anyone needs a drain, then we have to wait for that. + if (state.awaitDrain > 0) + return; + } + + // if every destination was unpiped, either before entering this + // function, or in the while loop, then stop flowing. + // + // NB: This is a pretty rare edge case. + if (state.pipesCount === 0) { + state.flowing = false; + + // if there were data event listeners added, then switch to old mode. + if (EE.listenerCount(src, 'data') > 0) + emitDataEvents(src); + return; + } + + // at this point, no one needed a drain, so we just ran out of data + // on the next readable event, start it over again. + state.ranOut = true; +} + +function pipeOnReadable() { + if (this._readableState.ranOut) { + this._readableState.ranOut = false; + flow(this); + } +} + + +Readable.prototype.unpipe = function(dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) + return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) + return this; + + if (!dest) + dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + this.removeListener('readable', pipeOnReadable); + state.flowing = false; + if (dest) + dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + this.removeListener('readable', pipeOnReadable); + state.flowing = false; + + for (var i = 0; i < len; i++) + dests[i].emit('unpipe', this); + return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) + return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function(ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data' && !this._readableState.flowing) + emitDataEvents(this); + + if (ev === 'readable' && this.readable) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + this.read(0); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function() { + emitDataEvents(this); + this.read(0); + this.emit('resume'); +}; + +Readable.prototype.pause = function() { + emitDataEvents(this, true); + this.emit('pause'); +}; + +function emitDataEvents(stream, startPaused) { + var state = stream._readableState; + + if (state.flowing) { + // https://github.com/isaacs/readable-stream/issues/16 + throw new Error('Cannot switch to old mode now.'); + } + + var paused = startPaused || false; + var readable = false; + + // convert to an old-style stream. + stream.readable = true; + stream.pipe = Stream.prototype.pipe; + stream.on = stream.addListener = Stream.prototype.on; + + stream.on('readable', function() { + readable = true; + + var c; + while (!paused && (null !== (c = stream.read()))) + stream.emit('data', c); + + if (c === null) { + readable = false; + stream._readableState.needReadable = true; + } + }); + + stream.pause = function() { + paused = true; + this.emit('pause'); + }; + + stream.resume = function() { + paused = false; + if (readable) + process.nextTick(function() { + stream.emit('readable'); + }); + else + this.read(0); + this.emit('resume'); + }; + + // now make it start, just in case it hadn't already. + stream.emit('readable'); +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function(stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function() { + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) + self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function(chunk) { + if (state.decoder) + chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + //if (state.objectMode && util.isNullOrUndefined(chunk)) + if (state.objectMode && (chunk === null || chunk === undefined)) + return; + else if (!state.objectMode && (!chunk || !chunk.length)) + return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (typeof stream[i] === 'function' && + typeof this[i] === 'undefined') { + this[i] = function(method) { return function() { + return stream[method].apply(stream, arguments); + }}(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function(ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function(n) { + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + + + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) + return null; + + if (length === 0) + ret = null; + else if (objectMode) + ret = list.shift(); + else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) + ret = list.join(''); + else + ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) + ret = ''; + else + ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) + ret += buf.slice(0, cpy); + else + buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) + list[0] = buf.slice(cpy); + else + list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) + throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted && state.calledRead) { + state.ended = true; + process.nextTick(function() { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } + }); + } +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf (xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 000000000..eb188df3e --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,210 @@ +// Copyright Joyent, Inc. and other Node 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. + + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/*<replacement>*/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/*</replacement>*/ + +util.inherits(Transform, Duplex); + + +function TransformState(options, stream) { + this.afterTransform = function(er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) + return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) + stream.push(data); + + if (cb) + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + + +function Transform(options) { + if (!(this instanceof Transform)) + return new Transform(options); + + Duplex.call(this, options); + + var ts = this._transformState = new TransformState(options, this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + this.once('finish', function() { + if ('function' === typeof this._flush) + this._flush(function(er) { + done(stream, er); + }); + else + done(stream); + }); +} + +Transform.prototype.push = function(chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function(chunk, encoding, cb) { + throw new Error('not implemented'); +}; + +Transform.prototype._write = function(chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || + rs.needReadable || + rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function(n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + + +function done(stream, er) { + if (er) + return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var rs = stream._readableState; + var ts = stream._transformState; + + if (ws.length) + throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) + throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 000000000..4bdaa4fa4 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,386 @@ +// Copyright Joyent, Inc. and other Node 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. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, cb), and it'll handle all +// the drain event emission and buffering. + +module.exports = Writable; + +/*<replacement>*/ +var Buffer = require('buffer').Buffer; +/*</replacement>*/ + +Writable.WritableState = WritableState; + + +/*<replacement>*/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/*</replacement>*/ + +var Stream = require('stream'); + +util.inherits(Writable, Stream); + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; +} + +function WritableState(options, stream) { + options = options || {}; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, becuase any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function(er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.buffer = []; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; +} + +function Writable(options) { + var Duplex = require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) + return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function() { + this.emit('error', new Error('Cannot pipe. Not readable.')); +}; + + +function writeAfterEnd(stream, state, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + if (!Buffer.isBuffer(chunk) && + 'string' !== typeof chunk && + chunk !== null && + chunk !== undefined && + !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); + valid = false; + } + return valid; +} + +Writable.prototype.write = function(chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + else if (!encoding) + encoding = state.defaultEncoding; + + if (typeof cb !== 'function') + cb = function() {}; + + if (state.ended) + writeAfterEnd(this, state, cb); + else if (validChunk(this, state, chunk, cb)) + ret = writeOrBuffer(this, state, chunk, encoding, cb); + + return ret; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && + state.decodeStrings !== false && + typeof chunk === 'string') { + chunk = new Buffer(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) + state.needDrain = true; + + if (state.writing) + state.buffer.push(new WriteReq(chunk, encoding, cb)); + else + doWrite(stream, state, len, chunk, encoding, cb); + + return ret; +} + +function doWrite(stream, state, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + if (sync) + process.nextTick(function() { + cb(er); + }); + else + cb(er); + + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) + onwriteError(stream, state, sync, er, cb); + else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(stream, state); + + if (!finished && !state.bufferProcessing && state.buffer.length) + clearBuffer(stream, state); + + if (sync) { + process.nextTick(function() { + afterWrite(stream, state, finished, cb); + }); + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) + onwriteDrain(stream, state); + cb(); + if (finished) + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + + for (var c = 0; c < state.buffer.length; c++) { + var entry = state.buffer[c]; + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, len, chunk, encoding, cb); + + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + c++; + break; + } + } + + state.bufferProcessing = false; + if (c < state.buffer.length) + state.buffer = state.buffer.slice(c); + else + state.buffer.length = 0; +} + +Writable.prototype._write = function(chunk, encoding, cb) { + cb(new Error('not implemented')); +}; + +Writable.prototype.end = function(chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (typeof chunk !== 'undefined' && chunk !== null) + this.write(chunk, encoding); + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) + endWritable(this, state, cb); +}; + + +function needFinish(stream, state) { + return (state.ending && + state.length === 0 && + !state.finished && + !state.writing); +} + +function finishMaybe(stream, state) { + var need = needFinish(stream, state); + if (need) { + state.finished = true; + stream.emit('finish'); + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) + process.nextTick(cb); + else + stream.once('finish', cb); + } + state.ended = true; +} diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/package.json b/node_modules/gulp-gzip/node_modules/readable-stream/package.json new file mode 100644 index 000000000..08b096d9a --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "readable-stream@~1.0.17", + "scope": null, + "escapedName": "readable-stream", + "name": "readable-stream", + "rawSpec": "~1.0.17", + "spec": ">=1.0.17 <1.1.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2" + ] + ], + "_from": "readable-stream@>=1.0.17 <1.1.0", + "_id": "readable-stream@1.0.34", + "_inCache": true, + "_location": "/gulp-gzip/readable-stream", + "_nodeVersion": "5.10.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/readable-stream-1.0.34.tgz_1460562521506_0.019665231462568045" + }, + "_npmUser": { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + "_npmVersion": "3.8.3", + "_phantomChildren": {}, + "_requested": { + "raw": "readable-stream@~1.0.17", + "scope": null, + "escapedName": "readable-stream", + "name": "readable-stream", + "rawSpec": "~1.0.17", + "spec": ">=1.0.17 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/gulp-util/through2", + "/gulp-gzip/through2" + ], + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "_shasum": "125820e34bc842d2f2aaafafe4c2916ee32c157c", + "_shrinkwrap": null, + "_spec": "readable-stream@~1.0.17", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "browser": { + "util": false + }, + "bugs": { + "url": "https://github.com/isaacs/readable-stream/issues" + }, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + }, + "description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x", + "devDependencies": { + "tap": "~0.2.6" + }, + "directories": {}, + "dist": { + "shasum": "125820e34bc842d2f2aaafafe4c2916ee32c157c", + "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + }, + "gitHead": "1227c7b66deedb1dc5284a89425854d5f7ad9576", + "homepage": "https://github.com/isaacs/readable-stream#readme", + "keywords": [ + "readable", + "stream", + "pipe" + ], + "license": "MIT", + "main": "readable.js", + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + }, + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "name": "readable-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/readable-stream.git" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "version": "1.0.34" +} diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/passthrough.js b/node_modules/gulp-gzip/node_modules/readable-stream/passthrough.js new file mode 100644 index 000000000..27e8d8a55 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_passthrough.js") diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/readable.js b/node_modules/gulp-gzip/node_modules/readable-stream/readable.js new file mode 100644 index 000000000..26511e87b --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/readable.js @@ -0,0 +1,11 @@ +var Stream = require('stream'); // hack to fix a circular dependency issue when used with browserify +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = Stream; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); +if (!process.browser && process.env.READABLE_STREAM === 'disable') { + module.exports = require('stream'); +} diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/transform.js b/node_modules/gulp-gzip/node_modules/readable-stream/transform.js new file mode 100644 index 000000000..5d482f078 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_transform.js") diff --git a/node_modules/gulp-gzip/node_modules/readable-stream/writable.js b/node_modules/gulp-gzip/node_modules/readable-stream/writable.js new file mode 100644 index 000000000..e1e9efdf3 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/readable-stream/writable.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_writable.js") diff --git a/node_modules/gulp-gzip/node_modules/strip-ansi/cli.js b/node_modules/gulp-gzip/node_modules/strip-ansi/cli.js new file mode 100755 index 000000000..602ae00e8 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/strip-ansi/cli.js @@ -0,0 +1,39 @@ +#!/usr/bin/env node +'use strict'; +var fs = require('fs'); +var pkg = require('./package.json'); +var strip = require('./'); +var input = process.argv[2]; + +function help() { + console.log([ + pkg.description, + '', + 'Usage', + ' $ strip-ansi <input-file> > <output-file>', + ' $ cat <input-file> | strip-ansi > <output-file>', + '', + 'Example', + ' $ strip-ansi unicorn.txt > unicorn-stripped.txt' + ].join('\n')); +} + +if (process.argv.indexOf('--help') !== -1) { + help(); + return; +} + +if (process.argv.indexOf('--version') !== -1) { + console.log(pkg.version); + return; +} + +if (input) { + process.stdout.write(strip(fs.readFileSync(input, 'utf8'))); + return; +} + +process.stdin.setEncoding('utf8'); +process.stdin.on('data', function (data) { + process.stdout.write(strip(data)); +}); diff --git a/node_modules/gulp-gzip/node_modules/strip-ansi/index.js b/node_modules/gulp-gzip/node_modules/strip-ansi/index.js new file mode 100644 index 000000000..099480fbf --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/strip-ansi/index.js @@ -0,0 +1,6 @@ +'use strict'; +var ansiRegex = require('ansi-regex')(); + +module.exports = function (str) { + return typeof str === 'string' ? str.replace(ansiRegex, '') : str; +}; diff --git a/node_modules/gulp-gzip/node_modules/strip-ansi/package.json b/node_modules/gulp-gzip/node_modules/strip-ansi/package.json new file mode 100644 index 000000000..34fbe7882 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/strip-ansi/package.json @@ -0,0 +1,117 @@ +{ + "_args": [ + [ + { + "raw": "strip-ansi@^0.3.0", + "scope": null, + "escapedName": "strip-ansi", + "name": "strip-ansi", + "rawSpec": "^0.3.0", + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/chalk" + ] + ], + "_from": "strip-ansi@>=0.3.0 <0.4.0", + "_id": "strip-ansi@0.3.0", + "_inCache": true, + "_location": "/gulp-gzip/strip-ansi", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "1.4.9", + "_phantomChildren": {}, + "_requested": { + "raw": "strip-ansi@^0.3.0", + "scope": null, + "escapedName": "strip-ansi", + "name": "strip-ansi", + "rawSpec": "^0.3.0", + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/chalk" + ], + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz", + "_shasum": "25f48ea22ca79187f3174a4db8759347bb126220", + "_shrinkwrap": null, + "_spec": "strip-ansi@^0.3.0", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bin": { + "strip-ansi": "cli.js" + }, + "bugs": { + "url": "https://github.com/sindresorhus/strip-ansi/issues" + }, + "dependencies": { + "ansi-regex": "^0.2.1" + }, + "description": "Strip ANSI escape codes", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "25f48ea22ca79187f3174a4db8759347bb126220", + "tarball": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "cli.js" + ], + "homepage": "https://github.com/sindresorhus/strip-ansi", + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "strip-ansi", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/strip-ansi.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.3.0" +} diff --git a/node_modules/gulp-gzip/node_modules/strip-ansi/readme.md b/node_modules/gulp-gzip/node_modules/strip-ansi/readme.md new file mode 100644 index 000000000..5477079d0 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/strip-ansi/readme.md @@ -0,0 +1,43 @@ +# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi) + +> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +```sh +$ npm install --save strip-ansi +``` + + +## Usage + +```js +var stripAnsi = require('strip-ansi'); + +stripAnsi('\x1b[4mcake\x1b[0m'); +//=> 'cake' +``` + + +## CLI + +```sh +$ npm install --global strip-ansi +``` + +```sh +$ strip-ansi --help + +Usage + $ strip-ansi <input-file> > <output-file> + $ cat <input-file> | strip-ansi > <output-file> + +Example + $ strip-ansi unicorn.txt > unicorn-stripped.txt +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp-gzip/node_modules/supports-color/cli.js b/node_modules/gulp-gzip/node_modules/supports-color/cli.js new file mode 100755 index 000000000..0617971e6 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/supports-color/cli.js @@ -0,0 +1,28 @@ +#!/usr/bin/env node +'use strict'; +var pkg = require('./package.json'); +var supportsColor = require('./'); +var input = process.argv[2]; + +function help() { + console.log([ + pkg.description, + '', + 'Usage', + ' $ supports-color', + '', + 'Exits with code 0 if color is supported and 1 if not' + ].join('\n')); +} + +if (!input || process.argv.indexOf('--help') !== -1) { + help(); + return; +} + +if (process.argv.indexOf('--version') !== -1) { + console.log(pkg.version); + return; +} + +process.exit(supportsColor ? 0 : 1); diff --git a/node_modules/gulp-gzip/node_modules/supports-color/index.js b/node_modules/gulp-gzip/node_modules/supports-color/index.js new file mode 100644 index 000000000..092d0baef --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/supports-color/index.js @@ -0,0 +1,32 @@ +'use strict'; +module.exports = (function () { + if (process.argv.indexOf('--no-color') !== -1) { + return false; + } + + if (process.argv.indexOf('--color') !== -1) { + return true; + } + + if (process.stdout && !process.stdout.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return true; + } + + if ('COLORTERM' in process.env) { + return true; + } + + if (process.env.TERM === 'dumb') { + return false; + } + + if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { + return true; + } + + return false; +})(); diff --git a/node_modules/gulp-gzip/node_modules/supports-color/package.json b/node_modules/gulp-gzip/node_modules/supports-color/package.json new file mode 100644 index 000000000..f7b127804 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/supports-color/package.json @@ -0,0 +1,112 @@ +{ + "_args": [ + [ + { + "raw": "supports-color@^0.2.0", + "scope": null, + "escapedName": "supports-color", + "name": "supports-color", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/chalk" + ] + ], + "_from": "supports-color@>=0.2.0 <0.3.0", + "_id": "supports-color@0.2.0", + "_inCache": true, + "_location": "/gulp-gzip/supports-color", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "1.4.9", + "_phantomChildren": {}, + "_requested": { + "raw": "supports-color@^0.2.0", + "scope": null, + "escapedName": "supports-color", + "name": "supports-color", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/chalk" + ], + "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz", + "_shasum": "d92de2694eb3f67323973d7ae3d8b55b4c22190a", + "_shrinkwrap": null, + "_spec": "supports-color@^0.2.0", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bin": { + "supports-color": "cli.js" + }, + "bugs": { + "url": "https://github.com/sindresorhus/supports-color/issues" + }, + "dependencies": {}, + "description": "Detect whether a terminal supports color", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "d92de2694eb3f67323973d7ae3d8b55b4c22190a", + "tarball": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "cli.js" + ], + "homepage": "https://github.com/sindresorhus/supports-color", + "keywords": [ + "cli", + "bin", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "supports-color", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/supports-color.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.2.0" +} diff --git a/node_modules/gulp-gzip/node_modules/supports-color/readme.md b/node_modules/gulp-gzip/node_modules/supports-color/readme.md new file mode 100644 index 000000000..7f07e5fb0 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/supports-color/readme.md @@ -0,0 +1,44 @@ +# supports-color [![Build Status](https://travis-ci.org/sindresorhus/supports-color.svg?branch=master)](https://travis-ci.org/sindresorhus/supports-color) + +> Detect whether a terminal supports color + + +## Install + +```sh +$ npm install --save supports-color +``` + + +## Usage + +```js +var supportsColor = require('supports-color'); + +if (supportsColor) { + console.log('Terminal supports color'); +} +``` + +It obeys the `--color` and `--no-color` CLI flags. + + +## CLI + +```sh +$ npm install --global supports-color +``` + +```sh +$ supports-color --help + +Usage + $ supports-color + +# Exits with code 0 if color is supported and 1 if not +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/gulp-gzip/node_modules/through2/.npmignore b/node_modules/gulp-gzip/node_modules/through2/.npmignore new file mode 100644 index 000000000..1e1dcab34 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/.npmignore @@ -0,0 +1,3 @@ +test +.jshintrc +.travis.yml
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/through2/LICENSE b/node_modules/gulp-gzip/node_modules/through2/LICENSE new file mode 100644 index 000000000..f6a0029de --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/LICENSE @@ -0,0 +1,39 @@ +Copyright 2013, Rod Vagg (the "Original Author") +All rights reserved. + +MIT +no-false-attribs License + +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. + +Distributions of all or part of the Software intended to be used +by the recipients as they would use the unmodified Software, +containing modifications that substantially alter, remove, or +disable functionality of the Software, outside of the documented +configuration mechanisms provided by the Software, shall be +modified such that the Original Author's bug reporting email +addresses and urls are either replaced with the contact information +of the parties responsible for the changes, or removed entirely. + +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. + + +Except where noted, this license applies to any and all software +programs and associated documentation files created by the +Original Author, when distributed with the Software.
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/through2/README.md b/node_modules/gulp-gzip/node_modules/through2/README.md new file mode 100644 index 000000000..33aa01ec3 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/README.md @@ -0,0 +1,140 @@ +# through2 + +<!-- + +soon ... + +[![Build Status](https://secure.travis-ci.org/rvagg/through2.png)](http://travis-ci.org/rvagg/through2) + +[![Build Status](https://saucelabs.com/browser-matrix/through2-sauce.svg)](https://travis-ci.org/rvagg/through2) + +--> + +[![NPM](https://nodei.co/npm/through2.png?compact=true)](https://nodei.co/npm/through2/) + +<!-- +not happy with these, we need to peg to readable-stream@1.0.x so it'll always report out-of-date + +[![david-dm](https://david-dm.org/rvagg/through2.png)](https://david-dm.org/rvagg/through2/) +[![david-dm](https://david-dm.org/rvagg/through2/dev-status.png)](https://david-dm.org/rvagg/through2#info=devDependencies/) +--> + +**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: A **Streams3** version of through2 is available in npm with the tag `"1.0"` rather than `"latest"` so an `npm install through2` will get you the current Streams2 version (version number is 0.x.x). To use a Streams3 version use `npm install through2@1` to fetch the latest version 1.x.x. More information about Streams2 vs Streams3 and recommendations [here](http://www.nearform.com/nodecrunch/dont-use-nodes-core-stream-module). + +```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')) +``` + +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) { + + this.push(new Buffer('wut?')) + cb() + + }) + .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. + +If you **do not provide a `transformFunction`** then you will get a simple 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. + +<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. + +## License + +**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/.npmignore b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/.npmignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/LICENCE b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/LICENCE new file mode 100644 index 000000000..a23e08a85 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2012 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.
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/Makefile b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/Makefile new file mode 100644 index 000000000..d583fcf49 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/Makefile @@ -0,0 +1,4 @@ +browser: + node ./support/compile + +.PHONY: browser
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/README.md b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/README.md new file mode 100644 index 000000000..389adae38 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/README.md @@ -0,0 +1,27 @@ +# xtend + +[![browser support][3]][4] + +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 presedence. + +## Examples + +```js +var extend = require("xtend") + +var combination = extend({ + a: "a" +}, { + b: "b" +}) +// { a: "a", b: "b" } +``` + + +## MIT Licenced + + + [3]: http://ci.testling.com/Raynos/xtend.png + [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/has-keys.js b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/has-keys.js new file mode 100644 index 000000000..62391e786 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/has-keys.js @@ -0,0 +1,7 @@ +module.exports = hasKeys + +function hasKeys(source) { + return source !== null && + (typeof source === "object" || + typeof source === "function") +} diff --git a/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/index.js b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/index.js new file mode 100644 index 000000000..20937d19a --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/index.js @@ -0,0 +1,25 @@ +var Keys = require("object-keys") +var hasKeys = require("./has-keys") + +module.exports = extend + +function extend() { + var target = {} + + for (var i = 0; i < arguments.length; i++) { + var source = arguments[i] + + if (!hasKeys(source)) { + continue + } + + var keys = Keys(source) + + for (var j = 0; j < keys.length; j++) { + var name = keys[j] + target[name] = source[name] + } + } + + return target +} diff --git a/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/mutable.js b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/mutable.js new file mode 100644 index 000000000..17454ae40 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/mutable.js @@ -0,0 +1,25 @@ +var Keys = require("object-keys") +var hasKeys = require("./has-keys") + +module.exports = extend + +function extend(target) { + var sources = [].slice.call(arguments, 1) + + for (var i = 0; i < sources.length; i++) { + var source = sources[i] + + if (!hasKeys(source)) { + continue + } + + var keys = Keys(source) + + for (var j = 0; j < keys.length; j++) { + var name = keys[j] + target[name] = source[name] + } + } + + return target +} diff --git a/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/package.json b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/package.json new file mode 100644 index 000000000..d889103f7 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/package.json @@ -0,0 +1,122 @@ +{ + "_args": [ + [ + { + "raw": "xtend@~2.1.1", + "scope": null, + "escapedName": "xtend", + "name": "xtend", + "rawSpec": "~2.1.1", + "spec": ">=2.1.1 <2.2.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/through2" + ] + ], + "_from": "xtend@>=2.1.1 <2.2.0", + "_id": "xtend@2.1.2", + "_inCache": true, + "_location": "/gulp-gzip/through2/xtend", + "_npmUser": { + "name": "raynos", + "email": "raynos2@gmail.com" + }, + "_npmVersion": "1.3.14", + "_phantomChildren": {}, + "_requested": { + "raw": "xtend@~2.1.1", + "scope": null, + "escapedName": "xtend", + "name": "xtend", + "rawSpec": "~2.1.1", + "spec": ">=2.1.1 <2.2.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/through2" + ], + "_resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "_shasum": "6efecc2a4dad8e6962c4901b337ce7ba87b5d28b", + "_shrinkwrap": null, + "_spec": "xtend@~2.1.1", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/through2", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/xtend/issues", + "email": "raynos2@gmail.com" + }, + "contributors": [ + { + "name": "Jake Verbaten" + }, + { + "name": "Matt Esch" + } + ], + "dependencies": { + "object-keys": "~0.4.0" + }, + "description": "extend like a boss", + "devDependencies": { + "tape": "~1.1.0" + }, + "directories": {}, + "dist": { + "shasum": "6efecc2a4dad8e6962c4901b337ce7ba87b5d28b", + "tarball": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz" + }, + "engines": { + "node": ">=0.4" + }, + "homepage": "https://github.com/Raynos/xtend", + "keywords": [ + "extend", + "merge", + "options", + "opts", + "object", + "array" + ], + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/raynos/xtend/raw/master/LICENSE" + } + ], + "main": "index", + "maintainers": [ + { + "name": "raynos", + "email": "raynos2@gmail.com" + } + ], + "name": "xtend", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "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": "2.1.2" +} diff --git a/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/test.js b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/test.js new file mode 100644 index 000000000..3369d7966 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/node_modules/xtend/test.js @@ -0,0 +1,63 @@ +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() +}) diff --git a/node_modules/gulp-gzip/node_modules/through2/package.json b/node_modules/gulp-gzip/node_modules/through2/package.json new file mode 100644 index 000000000..35ca7a3bc --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + { + "raw": "through2@^0.4.1", + "scope": null, + "escapedName": "through2", + "name": "through2", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip" + ] + ], + "_from": "through2@>=0.4.1 <0.5.0", + "_id": "through2@0.4.2", + "_inCache": true, + "_location": "/gulp-gzip/through2", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "_npmVersion": "1.4.3", + "_phantomChildren": { + "object-keys": "0.4.0" + }, + "_requested": { + "raw": "through2@^0.4.1", + "scope": null, + "escapedName": "through2", + "name": "through2", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip" + ], + "_resolved": "https://registry.npmjs.org/through2/-/through2-0.4.2.tgz", + "_shasum": "dbf5866031151ec8352bb6c4db64a2292a840b9b", + "_shrinkwrap": null, + "_spec": "through2@^0.4.1", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip", + "author": { + "name": "Rod Vagg", + "email": "r@va.gg", + "url": "https://github.com/rvagg" + }, + "bugs": { + "url": "https://github.com/rvagg/through2/issues" + }, + "dependencies": { + "readable-stream": "~1.0.17", + "xtend": "~2.1.1" + }, + "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", + "devDependencies": { + "bl": "~0.6.0", + "brtapsauce": "~0.2.2", + "stream-spigot": "~3.0.1", + "tape": "~2.3.0" + }, + "directories": {}, + "dist": { + "shasum": "dbf5866031151ec8352bb6c4db64a2292a840b9b", + "tarball": "https://registry.npmjs.org/through2/-/through2-0.4.2.tgz" + }, + "homepage": "https://github.com/rvagg/through2", + "keywords": [ + "stream", + "streams2", + "through", + "transform" + ], + "license": "MIT", + "main": "through2.js", + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + }, + { + "name": "bryce", + "email": "bryce@ravenwall.com" + } + ], + "name": "through2", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/through2.git" + }, + "scripts": { + "test": "node test/test.js", + "test-local": "brtapsauce-local test/basic-test.js" + }, + "version": "0.4.2" +} diff --git a/node_modules/gulp-gzip/node_modules/through2/through2.js b/node_modules/gulp-gzip/node_modules/through2/through2.js new file mode 100644 index 000000000..c11048481 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/through2/through2.js @@ -0,0 +1,78 @@ +var Transform = require('readable-stream/transform') + , inherits = require('util').inherits + , xtend = require('xtend') + + +// 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 Transform(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) + + Transform.call(this, this.options) + } + + inherits(Through2, Transform) + + Through2.prototype._transform = transform + + if (flush) + Through2.prototype._flush = flush + + return Through2 +}) + + +module.exports.obj = through2(function (options, transform, flush) { + var t2 = new Transform(xtend({ objectMode: true }, options)) + + t2._transform = transform + + if (flush) + t2._flush = flush + + return t2 +}) diff --git a/node_modules/gulp-gzip/node_modules/vinyl/.npmignore b/node_modules/gulp-gzip/node_modules/vinyl/.npmignore new file mode 100644 index 000000000..b5ef13a3c --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/.npmignore @@ -0,0 +1,6 @@ +.DS_Store +*.log +node_modules +build +*.node +components
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/vinyl/.travis.yml b/node_modules/gulp-gzip/node_modules/vinyl/.travis.yml new file mode 100644 index 000000000..33ad9f8c8 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "0.9" + - "0.10" +after_script: + - npm run coveralls
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/vinyl/LICENSE b/node_modules/gulp-gzip/node_modules/vinyl/LICENSE new file mode 100755 index 000000000..4f482f9ba --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2013 Fractal <contact@wearefractal.com> + +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/gulp-gzip/node_modules/vinyl/README.md b/node_modules/gulp-gzip/node_modules/vinyl/README.md new file mode 100644 index 000000000..3f97efc56 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/README.md @@ -0,0 +1,123 @@ +# vinyl [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status](https://david-dm.org/wearefractal/vinyl.png?theme=shields.io)](https://david-dm.org/wearefractal/vinyl) + + +## Information + +<table> +<tr> +<td>Package</td><td>vinyl</td> +</tr> +<tr> +<td>Description</td> +<td>A virtual file format</td> +</tr> +<tr> +<td>Node Version</td> +<td>>= 0.9</td> +</tr> +</table> + +## File + +```javascript +var File = require('vinyl'); + +var coffeeFile = new File({ + cwd: "/", + base: "/test/", + path: "/test/file.coffee" + contents: new Buffer("test = 123") +}); +``` + +### constructor(options) + +#### options.cwd + +Type: `String` +Default: `process.cwd()` + +#### options.base + +Used for relative pathing. Typically where a glob starts. + +Type: `String` +Default: `options.cwd` + +#### options.path + +Full path to the file. + +Type: `String` +Default: `null` + +#### options.stat + +The result of an fs.stat call. See [fs.Stats](http://nodejs.org/api/fs.html#fs_class_fs_stats) for more information. + +Type: `fs.Stats` +Default: `null` + +#### options.contents + +File contents. + +Type: `Buffer, Stream, or null` +Default: `null` + +### isBuffer() + +Returns true if file.contents is a Buffer. + +### isStream() + +Returns true if file.contents is a Stream. + +### isNull() + +Returns true if file.contents is null. + +### clone() + +Returns a new File object with all attributes cloned. + +### pipe(stream[, opt]) + +If file.contents is a Buffer, it will write it to the stream. + +If file.contents is a Stream, it will pipe it to the stream. + +If file.contents is null, it will do nothing. + +If opt.end is true, the destination stream will not be ended (same as node core). + +Returns the stream. + +### inspect() + +Returns a pretty String interpretation of the File. Useful for console.log. + +### relative + +Returns path.relative for the file base and file path. + +Example: + +```javascript +var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/file.coffee" +}); + +console.log(file.relative); // file.coffee +``` + +[npm-url]: https://npmjs.org/package/vinyl +[npm-image]: https://badge.fury.io/js/vinyl.png +[travis-url]: https://travis-ci.org/wearefractal/vinyl +[travis-image]: https://travis-ci.org/wearefractal/vinyl.png?branch=master +[coveralls-url]: https://coveralls.io/r/wearefractal/vinyl +[coveralls-image]: https://coveralls.io/repos/wearefractal/vinyl/badge.png +[depstat-url]: https://david-dm.org/wearefractal/vinyl +[depstat-image]: https://david-dm.org/wearefractal/vinyl.png
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/vinyl/index.js b/node_modules/gulp-gzip/node_modules/vinyl/index.js new file mode 100644 index 000000000..97f5c7529 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/index.js @@ -0,0 +1,128 @@ +var path = require('path'); + +var cloneStats = require('clone-stats'); + +var isBuffer = require('./lib/isBuffer'); +var isStream = require('./lib/isStream'); +var isNull = require('./lib/isNull'); +var inspectStream = require('./lib/inspectStream'); +var cloneBuffer = require('./lib/cloneBuffer'); + +function File(file) { + if (!file) file = {}; + + // TODO: should this be moved to vinyl-fs? + this.cwd = file.cwd || process.cwd(); + this.base = file.base || this.cwd; + + this.path = file.path || null; + + // stat = fs stats object + // TODO: should this be moved to vinyl-fs? + this.stat = file.stat || null; + + // contents = stream, buffer, or null if not read + this.contents = file.contents || null; +} + +File.prototype.isBuffer = function() { + return isBuffer(this.contents); +}; + +File.prototype.isStream = function() { + return isStream(this.contents); +}; + +File.prototype.isNull = function() { + return isNull(this.contents); +}; + +// TODO: should this be moved to vinyl-fs? +File.prototype.isDirectory = function() { + return this.isNull() && this.stat && this.stat.isDirectory(); +}; + +File.prototype.clone = function() { + var clonedContents = this.isBuffer() ? cloneBuffer(this.contents) : this.contents; + var clonedStat = this.stat ? cloneStats(this.stat) : null; + + return new File({ + cwd: this.cwd, + base: this.base, + path: this.path, + stat: clonedStat, + contents: clonedContents + }); +}; + +File.prototype.pipe = function(stream, opt) { + if (!opt) opt = {}; + if (typeof opt.end === 'undefined') opt.end = true; + + if (this.isStream()) { + return this.contents.pipe(stream, opt); + } + if (this.isBuffer()) { + if (opt.end) { + stream.end(this.contents); + } else { + stream.write(this.contents); + } + return stream; + } + if (this.isNull()) { + if (opt.end) stream.end(); + return stream; + } + + return stream; +}; + +File.prototype.inspect = function() { + var inspect = []; + + // use relative path if possible + var filePath = (this.base && this.path) ? this.relative : this.path; + + if (filePath) { + inspect.push('"'+filePath+'"'); + } + + if (this.isBuffer()) { + inspect.push(this.contents.inspect()); + } + + if (this.isStream()) { + inspect.push(inspectStream(this.contents)); + } + + return '<File '+inspect.join(' ')+'>'; +}; + +// virtual attributes +// or stuff with extra logic +Object.defineProperty(File.prototype, 'contents', { + get: function() { + return this._contents; + }, + set: function(val) { + if (!isBuffer(val) && !isStream(val) && !isNull(val)) { + throw new Error("File.contents can only be a Buffer, a Stream, or null."); + } + this._contents = val; + } +}); + +// TODO: should this be moved to vinyl-fs? +Object.defineProperty(File.prototype, 'relative', { + get: function() { + if (!this.base) throw new Error('No base specified! Can not get relative.'); + if (!this.path) throw new Error('No path specified! Can not get relative.'); + return path.relative(this.base, this.path); + }, + set: function() { + throw new Error('File.relative is generated from the base and path attributes. Do not modify it.'); + } +}); + +module.exports = File; diff --git a/node_modules/gulp-gzip/node_modules/vinyl/lib/cloneBuffer.js b/node_modules/gulp-gzip/node_modules/vinyl/lib/cloneBuffer.js new file mode 100644 index 000000000..3a861f22f --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/lib/cloneBuffer.js @@ -0,0 +1,7 @@ +var Buffer = require('buffer').Buffer; + +module.exports = function(buf) { + var out = new Buffer(buf.length); + buf.copy(out); + return out; +};
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/vinyl/lib/inspectStream.js b/node_modules/gulp-gzip/node_modules/vinyl/lib/inspectStream.js new file mode 100644 index 000000000..2c9067892 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/lib/inspectStream.js @@ -0,0 +1,12 @@ +var Stream = require('stream').Stream; +var isStream = require('./isStream'); + +module.exports = function(stream) { + if (!isStream(stream)) return; + + var streamType = stream.constructor.name; + // avoid StreamStream + if (streamType === 'Stream') streamType = ''; + + return '<'+streamType+'Stream>'; +};
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/vinyl/lib/isBuffer.js b/node_modules/gulp-gzip/node_modules/vinyl/lib/isBuffer.js new file mode 100644 index 000000000..0e23782c4 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/lib/isBuffer.js @@ -0,0 +1,7 @@ +var buf = require('buffer'); +var Buffer = buf.Buffer; + +// could use Buffer.isBuffer but this is the same exact thing... +module.exports = function(o) { + return typeof o === 'object' && o instanceof Buffer; +};
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/vinyl/lib/isNull.js b/node_modules/gulp-gzip/node_modules/vinyl/lib/isNull.js new file mode 100644 index 000000000..403bb30e8 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/lib/isNull.js @@ -0,0 +1,3 @@ +module.exports = function(v) { + return v === null; +};
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/vinyl/lib/isStream.js b/node_modules/gulp-gzip/node_modules/vinyl/lib/isStream.js new file mode 100644 index 000000000..9ce0929b0 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/lib/isStream.js @@ -0,0 +1,5 @@ +var Stream = require('stream').Stream; + +module.exports = function(o) { + return !!o && o instanceof Stream; +};
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/vinyl/package.json b/node_modules/gulp-gzip/node_modules/vinyl/package.json new file mode 100644 index 000000000..abe8102a7 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + { + "raw": "vinyl@^0.2.1", + "scope": null, + "escapedName": "vinyl", + "name": "vinyl", + "rawSpec": "^0.2.1", + "spec": ">=0.2.1 <0.3.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util" + ] + ], + "_from": "vinyl@>=0.2.1 <0.3.0", + "_id": "vinyl@0.2.3", + "_inCache": true, + "_location": "/gulp-gzip/vinyl", + "_npmUser": { + "name": "fractal", + "email": "contact@wearefractal.com" + }, + "_npmVersion": "1.3.23", + "_phantomChildren": {}, + "_requested": { + "raw": "vinyl@^0.2.1", + "scope": null, + "escapedName": "vinyl", + "name": "vinyl", + "rawSpec": "^0.2.1", + "spec": ">=0.2.1 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/gulp-util" + ], + "_resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.2.3.tgz", + "_shasum": "bca938209582ec5a49ad538a00fa1f125e513252", + "_shrinkwrap": null, + "_spec": "vinyl@^0.2.1", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util", + "author": { + "name": "Fractal", + "email": "contact@wearefractal.com", + "url": "http://wearefractal.com/" + }, + "bugs": { + "url": "https://github.com/wearefractal/vinyl/issues" + }, + "dependencies": { + "clone-stats": "~0.0.1" + }, + "description": "A virtual file format", + "devDependencies": { + "buffer-equal": "0.0.0", + "coveralls": "~2.6.1", + "event-stream": "~3.1.0", + "istanbul": "~0.2.3", + "jshint": "~2.4.1", + "lodash.templatesettings": "~2.4.1", + "mocha": "~1.17.0", + "mocha-lcov-reporter": "0.0.1", + "rimraf": "~2.2.5", + "should": "~2.1.1" + }, + "directories": {}, + "dist": { + "shasum": "bca938209582ec5a49ad538a00fa1f125e513252", + "tarball": "https://registry.npmjs.org/vinyl/-/vinyl-0.2.3.tgz" + }, + "engines": { + "node": ">= 0.9" + }, + "homepage": "http://github.com/wearefractal/vinyl", + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/wearefractal/vinyl/raw/master/LICENSE" + } + ], + "main": "./index.js", + "maintainers": [ + { + "name": "fractal", + "email": "contact@wearefractal.com" + } + ], + "name": "vinyl", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/wearefractal/vinyl.git" + }, + "scripts": { + "coveralls": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage", + "test": "mocha --reporter spec && jshint" + }, + "version": "0.2.3" +} diff --git a/node_modules/gulp-gzip/node_modules/vinyl/test/File.js b/node_modules/gulp-gzip/node_modules/vinyl/test/File.js new file mode 100644 index 000000000..1f2a83a0c --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/test/File.js @@ -0,0 +1,540 @@ +var File = require('../'); +var Stream = require('stream'); +var fs = require('fs'); + +var should = require('should'); +require('mocha'); + +describe('File', function() { + + describe('constructor()', function() { + it('should default cwd to process.cwd', function(done) { + var file = new File(); + file.cwd.should.equal(process.cwd()); + done(); + }); + + it('should default base to cwd', function(done) { + var cwd = "/"; + var file = new File({cwd: cwd}); + file.base.should.equal(cwd); + done(); + }); + + it('should default base to cwd even when none is given', function(done) { + var file = new File(); + file.base.should.equal(process.cwd()); + done(); + }); + + it('should default path to null', function(done) { + var file = new File(); + should.not.exist(file.path); + done(); + }); + + it('should default stat to null', function(done) { + var file = new File(); + should.not.exist(file.stat); + done(); + }); + + it('should default contents to null', function(done) { + var file = new File(); + should.not.exist(file.contents); + done(); + }); + + it('should set base to given value', function(done) { + var val = "/"; + var file = new File({base: val}); + file.base.should.equal(val); + done(); + }); + + it('should set cwd to given value', function(done) { + var val = "/"; + var file = new File({cwd: val}); + file.cwd.should.equal(val); + done(); + }); + + it('should set path to given value', function(done) { + var val = "/test.coffee"; + var file = new File({path: val}); + file.path.should.equal(val); + done(); + }); + + it('should set stat to given value', function(done) { + var val = {}; + var file = new File({stat: val}); + file.stat.should.equal(val); + done(); + }); + + it('should set contents to given value', function(done) { + var val = new Buffer("test"); + var file = new File({contents: val}); + file.contents.should.equal(val); + done(); + }); + }); + + describe('isBuffer()', function() { + it('should return true when the contents are a Buffer', function(done) { + var val = new Buffer("test"); + var file = new File({contents: val}); + file.isBuffer().should.equal(true); + done(); + }); + + it('should return false when the contents are a Stream', function(done) { + var val = new Stream(); + var file = new File({contents: val}); + file.isBuffer().should.equal(false); + done(); + }); + + it('should return false when the contents are a null', function(done) { + var file = new File({contents: null}); + file.isBuffer().should.equal(false); + done(); + }); + }); + + describe('isStream()', function() { + it('should return false when the contents are a Buffer', function(done) { + var val = new Buffer("test"); + var file = new File({contents: val}); + file.isStream().should.equal(false); + done(); + }); + + it('should return true when the contents are a Stream', function(done) { + var val = new Stream(); + var file = new File({contents: val}); + file.isStream().should.equal(true); + done(); + }); + + it('should return false when the contents are a null', function(done) { + var file = new File({contents: null}); + file.isStream().should.equal(false); + done(); + }); + }); + + describe('isNull()', function() { + it('should return false when the contents are a Buffer', function(done) { + var val = new Buffer("test"); + var file = new File({contents: val}); + file.isNull().should.equal(false); + done(); + }); + + it('should return false when the contents are a Stream', function(done) { + var val = new Stream(); + var file = new File({contents: val}); + file.isNull().should.equal(false); + done(); + }); + + it('should return true when the contents are a null', function(done) { + var file = new File({contents: null}); + file.isNull().should.equal(true); + done(); + }); + }); + + describe('isDirectory()', function() { + var fakeStat = { + isDirectory: function() { + return true; + } + }; + + it('should return false when the contents are a Buffer', function(done) { + var val = new Buffer("test"); + var file = new File({contents: val, stat: fakeStat}); + file.isDirectory().should.equal(false); + done(); + }); + + it('should return false when the contents are a Stream', function(done) { + var val = new Stream(); + var file = new File({contents: val, stat: fakeStat}); + file.isDirectory().should.equal(false); + done(); + }); + + it('should return true when the contents are a null', function(done) { + var file = new File({contents: null, stat: fakeStat}); + file.isDirectory().should.equal(true); + done(); + }); + }); + + describe('clone()', function() { + it('should copy all attributes over with Buffer', function(done) { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Buffer("test") + }; + var file = new File(options); + var file2 = file.clone(); + + file2.should.not.equal(file, 'refs should be different'); + file2.cwd.should.equal(file.cwd); + file2.base.should.equal(file.base); + file2.path.should.equal(file.path); + file2.contents.should.not.equal(file.contents, 'buffer ref should be different'); + file2.contents.toString('utf8').should.equal(file.contents.toString('utf8')); + done(); + }); + + it('should copy all attributes over with Stream', function(done) { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Stream() + }; + var file = new File(options); + var file2 = file.clone(); + + file2.should.not.equal(file, 'refs should be different'); + file2.cwd.should.equal(file.cwd); + file2.base.should.equal(file.base); + file2.path.should.equal(file.path); + file2.contents.should.equal(file.contents, 'stream ref should be the same'); + done(); + }); + + it('should copy all attributes over with null', function(done) { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: null + }; + var file = new File(options); + var file2 = file.clone(); + + file2.should.not.equal(file, 'refs should be different'); + file2.cwd.should.equal(file.cwd); + file2.base.should.equal(file.base); + file2.path.should.equal(file.path); + should.not.exist(file2.contents); + done(); + }); + + it('should properly clone the `stat` property', function(done) { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.js", + contents: new Buffer("test"), + stat: fs.statSync(__filename) + }; + + var file = new File(options); + var copy = file.clone(); + + copy.stat.isFile().should.be.true; + copy.stat.isDirectory().should.be.false; + should(file.stat instanceof fs.Stats).be.true; + should(copy.stat instanceof fs.Stats).be.true; + + done(); + }); + }); + + describe('pipe()', function() { + it('should write to stream with Buffer', function(done) { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Buffer("test") + }; + var file = new File(options); + var stream = new Stream.PassThrough(); + stream.on('data', function(chunk) { + should.exist(chunk); + (chunk instanceof Buffer).should.equal(true, 'should write as a buffer'); + chunk.toString('utf8').should.equal(options.contents.toString('utf8')); + }); + stream.on('end', function(chunk) { + done(); + }); + var ret = file.pipe(stream); + ret.should.equal(stream, 'should return the stream'); + }); + + it('should pipe to stream with Stream', function(done) { + var testChunk = new Buffer("test"); + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Stream.PassThrough() + }; + var file = new File(options); + var stream = new Stream.PassThrough(); + stream.on('data', function(chunk) { + should.exist(chunk); + (chunk instanceof Buffer).should.equal(true, 'should write as a buffer'); + chunk.toString('utf8').should.equal(testChunk.toString('utf8')); + done(); + }); + var ret = file.pipe(stream); + ret.should.equal(stream, 'should return the stream'); + + file.contents.write(testChunk); + }); + + it('should do nothing with null', function(done) { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: null + }; + var file = new File(options); + var stream = new Stream.PassThrough(); + stream.on('data', function(chunk) { + throw new Error("should not write"); + }); + stream.on('end', function() { + done(); + }); + var ret = file.pipe(stream); + ret.should.equal(stream, 'should return the stream'); + }); + + it('should write to stream with Buffer', function(done) { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Buffer("test") + }; + var file = new File(options); + var stream = new Stream.PassThrough(); + stream.on('data', function(chunk) { + should.exist(chunk); + (chunk instanceof Buffer).should.equal(true, 'should write as a buffer'); + chunk.toString('utf8').should.equal(options.contents.toString('utf8')); + done(); + }); + stream.on('end', function(chunk) { + throw new Error("should not end"); + }); + var ret = file.pipe(stream, {end: false}); + ret.should.equal(stream, 'should return the stream'); + }); + + it('should pipe to stream with Stream', function(done) { + var testChunk = new Buffer("test"); + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Stream.PassThrough() + }; + var file = new File(options); + var stream = new Stream.PassThrough(); + stream.on('data', function(chunk) { + should.exist(chunk); + (chunk instanceof Buffer).should.equal(true, 'should write as a buffer'); + chunk.toString('utf8').should.equal(testChunk.toString('utf8')); + done(); + }); + stream.on('end', function(chunk) { + throw new Error("should not end"); + }); + var ret = file.pipe(stream, {end: false}); + ret.should.equal(stream, 'should return the stream'); + + file.contents.write(testChunk); + }); + + it('should do nothing with null', function(done) { + var options = { + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: null + }; + var file = new File(options); + var stream = new Stream.PassThrough(); + stream.on('data', function(chunk) { + throw new Error("should not write"); + }); + stream.on('end', function(chunk) { + throw new Error("should not end"); + }); + var ret = file.pipe(stream, {end: false}); + ret.should.equal(stream, 'should return the stream'); + process.nextTick(done); + }); + }); + + describe('inspect()', function() { + it('should return correct format when no contents and no path', function(done) { + var file = new File(); + file.inspect().should.equal('<File >'); + done(); + }); + + it('should return correct format when Buffer and no path', function(done) { + var val = new Buffer("test"); + var file = new File({ + contents: val + }); + file.inspect().should.equal('<File <Buffer 74 65 73 74>>'); + done(); + }); + + it('should return correct format when Buffer and relative path', function(done) { + var val = new Buffer("test"); + var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: val + }); + file.inspect().should.equal('<File "test.coffee" <Buffer 74 65 73 74>>'); + done(); + }); + + it('should return correct format when Buffer and only path and no base', function(done) { + var val = new Buffer("test"); + var file = new File({ + cwd: "/", + path: "/test/test.coffee", + contents: val + }); + delete file.base; + file.inspect().should.equal('<File "/test/test.coffee" <Buffer 74 65 73 74>>'); + done(); + }); + + it('should return correct format when Stream and relative path', function(done) { + var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: new Stream.PassThrough() + }); + file.inspect().should.equal('<File "test.coffee" <PassThroughStream>>'); + done(); + }); + + it('should return correct format when null and relative path', function(done) { + var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/test.coffee", + contents: null + }); + file.inspect().should.equal('<File "test.coffee">'); + done(); + }); + }); + + describe('contents get/set', function() { + it('should work with Buffer', function(done) { + var val = new Buffer("test"); + var file = new File(); + file.contents = val; + file.contents.should.equal(val); + done(); + }); + + it('should work with Stream', function(done) { + var val = new Stream.PassThrough(); + var file = new File(); + file.contents = val; + file.contents.should.equal(val); + done(); + }); + + it('should work with null', function(done) { + var val = null; + var file = new File(); + file.contents = val; + (file.contents === null).should.equal(true); + done(); + }); + + it('should not work with string', function(done) { + var val = "test"; + var file = new File(); + try { + file.contents = val; + } catch (err) { + should.exist(err); + done(); + } + }); + }); + + describe('relative get/set', function() { + it('should error on set', function(done) { + var file = new File(); + try { + file.relative = "test"; + } catch (err) { + should.exist(err); + done(); + } + }); + + it('should error on get when no base', function(done) { + var a; + var file = new File(); + delete file.base; + try { + a = file.relative; + } catch (err) { + should.exist(err); + done(); + } + }); + + it('should error on get when no path', function(done) { + var a; + var file = new File(); + try { + a = file.relative; + } catch (err) { + should.exist(err); + done(); + } + }); + + it('should return a relative path from base', function(done) { + var file = new File({ + cwd: "/", + base: "/test/", + path: "/test/test.coffee" + }); + file.relative.should.equal("test.coffee"); + done(); + }); + + it('should return a relative path from cwd', function(done) { + var file = new File({ + cwd: "/", + path: "/test/test.coffee" + }); + file.relative.should.equal("test/test.coffee"); + done(); + }); + }); + +}); diff --git a/node_modules/gulp-gzip/node_modules/vinyl/test/cloneBuffer.js b/node_modules/gulp-gzip/node_modules/vinyl/test/cloneBuffer.js new file mode 100644 index 000000000..7d2868141 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/test/cloneBuffer.js @@ -0,0 +1,28 @@ +var cloneBuffer = require('../lib/cloneBuffer'); +var Stream = require('stream'); +var should = require('should'); +require('mocha'); + +describe('cloneBuffer()', function() { + it('should return a new Buffer reference', function(done) { + var testBuffer = new Buffer('test'); + var testBuffer2 = cloneBuffer(testBuffer); + + should.exist(testBuffer2, 'should return something'); + (testBuffer2 instanceof Buffer).should.equal(true, 'should return a Buffer'); + testBuffer2.should.not.equal(testBuffer, 'pointer should change'); + done(); + }); + + it('should not replicate modifications to the original buffer', function(done) { + var testBuffer = new Buffer('test'); + var testBuffer2 = cloneBuffer(testBuffer); + + // test that changes dont modify both pointers + testBuffer2.write('w'); + + testBuffer.toString('utf8').should.equal('test', 'original should stay the same'); + testBuffer2.toString('utf8').should.equal('west', 'new buffer should be modified'); + done(); + }); +});
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/vinyl/test/inspectStream.js b/node_modules/gulp-gzip/node_modules/vinyl/test/inspectStream.js new file mode 100644 index 000000000..fe1802c5d --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/test/inspectStream.js @@ -0,0 +1,53 @@ +var inspectStream = require('../lib/inspectStream'); +var Stream = require('stream'); +var should = require('should'); +require('mocha'); + +describe('inspectStream()', function() { + it('should work on a core Stream', function(done) { + var testStream = new Stream(); + inspectStream(testStream).should.equal('<Stream>'); + done(); + }); + + it('should work on a core Readable Stream', function(done) { + var testStream = new Stream.Readable(); + inspectStream(testStream).should.equal('<ReadableStream>'); + done(); + }); + + it('should work on a core Writable Stream', function(done) { + var testStream = new Stream.Writable(); + inspectStream(testStream).should.equal('<WritableStream>'); + done(); + }); + + it('should work on a core Duplex Stream', function(done) { + var testStream = new Stream.Duplex(); + inspectStream(testStream).should.equal('<DuplexStream>'); + done(); + }); + + it('should work on a core Transform Stream', function(done) { + var testStream = new Stream.Transform(); + inspectStream(testStream).should.equal('<TransformStream>'); + done(); + }); + + it('should work on a core PassThrough Stream', function(done) { + var testStream = new Stream.PassThrough(); + inspectStream(testStream).should.equal('<PassThroughStream>'); + done(); + }); + + it('should not work on a Buffer', function(done) { + var testBuffer = new Buffer('test'); + should.not.exist(inspectStream(testBuffer)); + done(); + }); + + it('should not work on a null', function(done) { + should.not.exist(inspectStream(null)); + done(); + }); +});
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/vinyl/test/isBuffer.js b/node_modules/gulp-gzip/node_modules/vinyl/test/isBuffer.js new file mode 100644 index 000000000..5bb1cb91d --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/test/isBuffer.js @@ -0,0 +1,29 @@ +var isBuffer = require('../lib/isBuffer'); +var Stream = require('stream'); +var should = require('should'); +require('mocha'); + +describe('isBuffer()', function() { + it('should return true on a Buffer', function(done) { + var testBuffer = new Buffer('test'); + isBuffer(testBuffer).should.equal(true); + done(); + }); + + it('should return false on a Stream', function(done) { + var testStream = new Stream(); + isBuffer(testStream).should.equal(false); + done(); + }); + + it('should return false on a null', function(done) { + isBuffer(null).should.equal(false); + done(); + }); + + it('should return false on a array of numbers', function(done) { + var testArray = [1, 2, 3]; + isBuffer(testArray).should.equal(false); + done(); + }); +});
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/vinyl/test/isNull.js b/node_modules/gulp-gzip/node_modules/vinyl/test/isNull.js new file mode 100644 index 000000000..db70c0135 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/test/isNull.js @@ -0,0 +1,23 @@ +var isNull = require('../lib/isNull'); +var Stream = require('stream'); +var should = require('should'); +require('mocha'); + +describe('isNull()', function() { + it('should return true on null', function(done) { + isNull(null).should.equal(true); + done(); + }); + + it('should return false on undefined', function(done) { + isNull().should.equal(false); + isNull(undefined).should.equal(false); + done(); + }); + + it('should return false on defined values', function(done) { + isNull(1).should.equal(false); + isNull("test").should.equal(false); + done(); + }); +});
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/vinyl/test/isStream.js b/node_modules/gulp-gzip/node_modules/vinyl/test/isStream.js new file mode 100644 index 000000000..f22584c51 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/vinyl/test/isStream.js @@ -0,0 +1,29 @@ +var isStream = require('../lib/isStream'); +var Stream = require('stream'); +var should = require('should'); +require('mocha'); + +describe('isStream()', function() { + it('should return true on a Stream', function(done) { + var testStream = new Stream(); + isStream(testStream).should.equal(true); + done(); + }); + + it('should return false on a Buffer', function(done) { + var testBuffer = new Buffer('test'); + isStream(testBuffer).should.equal(false); + done(); + }); + + it('should return false on a null', function(done) { + isStream(null).should.equal(false); + done(); + }); + + it('should return false on a array of numbers', function(done) { + var testArray = [1, 2, 3]; + isStream(testArray).should.equal(false); + done(); + }); +});
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/xtend/.jshintrc b/node_modules/gulp-gzip/node_modules/xtend/.jshintrc new file mode 100644 index 000000000..77887b5f0 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/xtend/.jshintrc @@ -0,0 +1,30 @@ +{ + "maxdepth": 4, + "maxstatements": 200, + "maxcomplexity": 12, + "maxlen": 80, + "maxparams": 5, + + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": false, + "noarg": true, + "noempty": true, + "nonew": true, + "undef": true, + "unused": "vars", + "trailing": true, + + "quotmark": true, + "expr": true, + "asi": true, + + "browser": false, + "esnext": true, + "devel": false, + "node": false, + "nonstandard": false, + + "predef": ["require", "module", "__dirname", "__filename"] +} diff --git a/node_modules/gulp-gzip/node_modules/xtend/.npmignore b/node_modules/gulp-gzip/node_modules/xtend/.npmignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/xtend/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/gulp-gzip/node_modules/xtend/LICENCE b/node_modules/gulp-gzip/node_modules/xtend/LICENCE new file mode 100644 index 000000000..1a14b437e --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/xtend/LICENCE @@ -0,0 +1,19 @@ +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/gulp-gzip/node_modules/xtend/Makefile b/node_modules/gulp-gzip/node_modules/xtend/Makefile new file mode 100644 index 000000000..d583fcf49 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/xtend/Makefile @@ -0,0 +1,4 @@ +browser: + node ./support/compile + +.PHONY: browser
\ No newline at end of file diff --git a/node_modules/gulp-gzip/node_modules/xtend/README.md b/node_modules/gulp-gzip/node_modules/xtend/README.md new file mode 100644 index 000000000..e75483189 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/xtend/README.md @@ -0,0 +1,28 @@ +# xtend + +[![browser support][3]][4] + +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 presedence. + +## Examples + +```js +var extend = require("xtend") + +// extend returns a new object. Does not mutate arguments +var combination = extend({ + a: "a" +}, { + b: "b" +}) +// { a: "a", b: "b" } +``` + + +## MIT Licenced + + + [3]: http://ci.testling.com/Raynos/xtend.png + [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/gulp-gzip/node_modules/xtend/index.js b/node_modules/gulp-gzip/node_modules/xtend/index.js new file mode 100644 index 000000000..5b760152b --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/xtend/index.js @@ -0,0 +1,17 @@ +module.exports = extend + +function extend() { + var target = {} + + for (var i = 0; i < arguments.length; i++) { + var source = arguments[i] + + for (var key in source) { + if (source.hasOwnProperty(key)) { + target[key] = source[key] + } + } + } + + return target +} diff --git a/node_modules/gulp-gzip/node_modules/xtend/mutable.js b/node_modules/gulp-gzip/node_modules/xtend/mutable.js new file mode 100644 index 000000000..a34475ebd --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/xtend/mutable.js @@ -0,0 +1,15 @@ +module.exports = extend + +function extend(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] + + for (var key in source) { + if (source.hasOwnProperty(key)) { + target[key] = source[key] + } + } + } + + return target +} diff --git a/node_modules/gulp-gzip/node_modules/xtend/package.json b/node_modules/gulp-gzip/node_modules/xtend/package.json new file mode 100644 index 000000000..4686bcd98 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/xtend/package.json @@ -0,0 +1,120 @@ +{ + "_args": [ + [ + { + "raw": "xtend@~3.0.0", + "scope": null, + "escapedName": "xtend", + "name": "xtend", + "rawSpec": "~3.0.0", + "spec": ">=3.0.0 <3.1.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2" + ] + ], + "_from": "xtend@>=3.0.0 <3.1.0", + "_id": "xtend@3.0.0", + "_inCache": true, + "_location": "/gulp-gzip/xtend", + "_npmUser": { + "name": "raynos", + "email": "raynos2@gmail.com" + }, + "_npmVersion": "1.4.6", + "_phantomChildren": {}, + "_requested": { + "raw": "xtend@~3.0.0", + "scope": null, + "escapedName": "xtend", + "name": "xtend", + "rawSpec": "~3.0.0", + "spec": ">=3.0.0 <3.1.0", + "type": "range" + }, + "_requiredBy": [ + "/gulp-gzip/gulp-util/through2" + ], + "_resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", + "_shasum": "5cce7407baf642cba7becda568111c493f59665a", + "_shrinkwrap": null, + "_spec": "xtend@~3.0.0", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp-gzip/node_modules/gulp-util/node_modules/through2", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/xtend/issues", + "email": "raynos2@gmail.com" + }, + "contributors": [ + { + "name": "Jake Verbaten" + }, + { + "name": "Matt Esch" + } + ], + "dependencies": {}, + "description": "extend like a boss", + "devDependencies": { + "tape": "~1.1.0" + }, + "directories": {}, + "dist": { + "shasum": "5cce7407baf642cba7becda568111c493f59665a", + "tarball": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz" + }, + "engines": { + "node": ">=0.4" + }, + "homepage": "https://github.com/Raynos/xtend", + "keywords": [ + "extend", + "merge", + "options", + "opts", + "object", + "array" + ], + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/raynos/xtend/raw/master/LICENSE" + } + ], + "main": "index", + "maintainers": [ + { + "name": "raynos", + "email": "raynos2@gmail.com" + } + ], + "name": "xtend", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "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": "3.0.0" +} diff --git a/node_modules/gulp-gzip/node_modules/xtend/test.js b/node_modules/gulp-gzip/node_modules/xtend/test.js new file mode 100644 index 000000000..3369d7966 --- /dev/null +++ b/node_modules/gulp-gzip/node_modules/xtend/test.js @@ -0,0 +1,63 @@ +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() +}) diff --git a/node_modules/gulp-gzip/package.json b/node_modules/gulp-gzip/package.json new file mode 100755 index 000000000..cb78fa91d --- /dev/null +++ b/node_modules/gulp-gzip/package.json @@ -0,0 +1,132 @@ +{ + "_args": [ + [ + { + "raw": "gulp-gzip@^1.2.0", + "scope": null, + "escapedName": "gulp-gzip", + "name": "gulp-gzip", + "rawSpec": "^1.2.0", + "spec": ">=1.2.0 <2.0.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex" + ] + ], + "_from": "gulp-gzip@>=1.2.0 <2.0.0", + "_id": "gulp-gzip@1.4.0", + "_inCache": true, + "_location": "/gulp-gzip", + "_nodeVersion": "0.12.7", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/gulp-gzip-1.4.0.tgz_1464748546654_0.8321727789007127" + }, + "_npmUser": { + "name": "jstuckey", + "email": "klash64@gmail.com" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": { + "clone-stats": "0.0.1", + "core-util-is": "1.0.2", + "dateformat": "1.0.12", + "escape-string-regexp": "1.0.5", + "inherits": "2.0.3", + "isarray": "0.0.1", + "lodash._escapehtmlchar": "2.4.1", + "lodash._escapestringchar": "2.4.1", + "lodash._isnative": "2.4.1", + "lodash._reunescapedhtml": "2.4.1", + "lodash._shimkeys": "2.4.1", + "lodash.defaults": "2.4.1", + "lodash.isobject": "2.4.1", + "lodash.values": "2.4.1", + "multipipe": "0.1.2", + "object-keys": "0.4.0", + "string_decoder": "0.10.31" + }, + "_requested": { + "raw": "gulp-gzip@^1.2.0", + "scope": null, + "escapedName": "gulp-gzip", + "name": "gulp-gzip", + "rawSpec": "^1.2.0", + "spec": ">=1.2.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "#DEV:/" + ], + "_resolved": "https://registry.npmjs.org/gulp-gzip/-/gulp-gzip-1.4.0.tgz", + "_shasum": "5ff8dff837cac2ebc2c89743dc0ac76e2be5e6c2", + "_shrinkwrap": null, + "_spec": "gulp-gzip@^1.2.0", + "_where": "/home/dold/repos/taler/wallet-webex", + "author": { + "name": "Jeremy Stuckey", + "email": "jeremystuckey@gmail.com" + }, + "bugs": { + "url": "https://github.com/jstuckey/gulp-gzip/issues" + }, + "dependencies": { + "bytes": "^0.3.0", + "gulp-util": "^2.2.14", + "stream-to-array": "~1.0.0", + "through2": "^0.4.1" + }, + "description": "Gzip plugin for gulp.", + "devDependencies": { + "gulp": "^3.6.2", + "gulp-clean": "^0.2.4", + "gulp-filter": "^0.3.1", + "gulp-jshint": "~1.5.4", + "gulp-mocha": "^0.4.1", + "gulp-rename": "^1.2.0", + "gulp-tap": "^0.1.1", + "gulp-watch": "^0.6.4", + "jshint-stylish": "~0.1.5", + "mocha": "^1.18.2", + "nid": "^0.3.2", + "should": "^3.2.0-beta1" + }, + "directories": {}, + "dist": { + "shasum": "5ff8dff837cac2ebc2c89743dc0ac76e2be5e6c2", + "tarball": "https://registry.npmjs.org/gulp-gzip/-/gulp-gzip-1.4.0.tgz" + }, + "engines": { + "node": ">= 0.10.0" + }, + "homepage": "https://github.com/jstuckey/gulp-gzip/", + "keywords": [ + "compress", + "gulpplugin", + "gzip" + ], + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/jstuckey/gulp-gzip/raw/master/LICENSE" + } + ], + "main": "index.js", + "maintainers": [ + { + "name": "jstuckey", + "email": "jeremystuckey@gmail.com" + } + ], + "name": "gulp-gzip", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jstuckey/gulp-gzip.git" + }, + "scripts": { + "test": "gulp" + }, + "version": "1.4.0" +} diff --git a/node_modules/gulp-gzip/test/files/big.txt b/node_modules/gulp-gzip/test/files/big.txt new file mode 100755 index 000000000..61779e6d4 --- /dev/null +++ b/node_modules/gulp-gzip/test/files/big.txt @@ -0,0 +1 @@ +Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus, eaque animi autem distinctio assumenda. Necessitatibus, dicta, aliquam architecto aut error quaerat at beatae harum modi earum sequi accusantium labore nisi rerum neque nemo et quae dolorem voluptas dolorum blanditiis accusamus repellat illo saepe quisquam alias doloribus non temporibus quasi maiores distinctio eos unde ad ipsam excepturi vel praesentium repudiandae minus amet consequatur suscipit laboriosam qui asperiores possimus exercitationem nesciunt ratione odio reprehenderit deserunt iure! Doloremque deserunt rem vitae iure ipsam esse tempore veritatis voluptate natus blanditiis. Velit, porro, fuga enim quasi voluptatum praesentium ea autem fugit unde non architecto quisquam reprehenderit cumque laboriosam dolore saepe eligendi similique iste quis expedita beatae itaque possimus repellendus officiis nam minima blanditiis numquam voluptatem optio temporibus asperiores adipisci quas necessitatibus cum natus hic provident? Autem, atque, voluptate, dicta, sequi adipisci doloribus aspernatur ipsa beatae rem odio doloremque odit consequuntur vitae cupiditate quos repellendus id eligendi excepturi pariatur molestiae praesentium quasi perspiciatis quaerat quisquam blanditiis architecto minus ad possimus porro illum quibusdam ipsam culpa voluptatibus iste ex earum quae quam laboriosam deleniti in expedita esse! Nihil, laboriosam, rem, consequatur ullam ipsam reiciendis tempora aliquam quos cupiditate saepe facere recusandae tenetur odio nulla officia molestiae atque harum ipsa nobis dolorum voluptatum suscipit consequuntur deleniti iusto delectus hic a numquam neque aliquid asperiores ipsum impedit nisi voluptas beatae facilis culpa eveniet unde animi architecto omnis fugiat magni? Placeat, autem, vero, aspernatur, ab impedit nisi delectus sequi hic aliquid officia cupiditate praesentium voluptates veniam doloremque cumque aliquam enim quas reprehenderit aut dolor possimus inventore saepe fuga in dignissimos ipsam ut et eum sed tempore error a labore beatae incidunt repellat animi perferendis rerum iure tempora odio nam earum nulla asperiores est laboriosam facilis? Perspiciatis, fugiat, veniam, voluptatem ad eligendi optio veritatis autem voluptas deleniti incidunt provident soluta mollitia nesciunt fugit recusandae. Porro, nostrum, ab, inventore velit quidem impedit voluptatum placeat tempora mollitia unde nisi itaque dolorum perspiciatis temporibus excepturi omnis nobis. Itaque, provident, laudantium aperiam unde ex laborum vero quam placeat porro accusantium quia non alias facilis illum corporis dolor voluptatum aspernatur expedita deserunt labore beatae illo nobis hic ea vel omnis velit iste magnam odit asperiores delectus autem praesentium minima recusandae ipsa nisi eligendi ipsam. Est, animi, ipsam natus culpa cumque excepturi molestiae sit tenetur rem aspernatur assumenda laborum sequi sed tempora praesentium rerum reiciendis qui quidem cum possimus. Dolorem, ad delectus temporibus quasi repudiandae dicta repellendus! diff --git a/node_modules/gulp-gzip/test/files/small.txt b/node_modules/gulp-gzip/test/files/small.txt new file mode 100755 index 000000000..a18737279 --- /dev/null +++ b/node_modules/gulp-gzip/test/files/small.txt @@ -0,0 +1 @@ +Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quis, eaque, rerum maxime quod repellat ipsam modi sit voluptatibus quidem et. Mollitia dicta atque modi. Recusandae, doloribus dolores praesentium culpa quisquam quasi maiores aperiam itaque minima incidunt hic in similique quas. Unde, ut nam ipsum doloribus praesentium neque sapiente dolorum beatae totam rem! Tempora, dolorem, nesciunt, dolorum veritatis earum aliquam a quae rem saepe vitae quaerat ex aliquid voluptates eum nobis repellat natus neque voluptatem veniam exercitationem nam eaque iste sequi officia perspiciatis! Earum, hic alias aperiam repellat tenetur labore mollitia unde dolorum eligendi consequatur asperiores neque excepturi officia? Ducimus sed velit ipsa iure libero eos doloremque at eveniet facilis quibusdam! Optio, veniam adipisci eius error sequi. Pariatur, vitae vero quia et illum alias saepe aperiam enim! Deleniti ipsam repellat labore. diff --git a/node_modules/gulp-gzip/test/files/too_small.txt b/node_modules/gulp-gzip/test/files/too_small.txt new file mode 100755 index 000000000..8baef1b4a --- /dev/null +++ b/node_modules/gulp-gzip/test/files/too_small.txt @@ -0,0 +1 @@ +abc diff --git a/node_modules/gulp-gzip/test/test.js b/node_modules/gulp-gzip/test/test.js new file mode 100755 index 000000000..ee62dfb60 --- /dev/null +++ b/node_modules/gulp-gzip/test/test.js @@ -0,0 +1,492 @@ +var clean = require('gulp-clean'); +var fs = require('fs'); +var gulp = require('gulp'); +var log = require('gulp-util').log; +var gzip = require('../'); +var nid = require('nid'); +var rename = require('gulp-rename'); +var should = require('should'); +var Stream = require('stream'); +var tap = require('gulp-tap'); +var zlib = require('zlib'); + +// monkeys are fixing cwd for gulp-mocha +// node lives in one process/scope/directory +process.chdir('./test'); + +describe('gulp-gzip', function() { + + describe('config', function() { + + it('should have default config', function(done) { + var instance = gzip(); + instance.config.should.eql({ + append: true, + gzipOptions: {}, + skipGrowingFiles: false, + threshold: false + }); + done(); + }); + + it('should merge options with defaults', function(done) { + var instance = gzip({ append: false }); + instance.config.should.eql({ + append: false, + gzipOptions: {}, + skipGrowingFiles: false, + threshold: false + }); + done(); + }); + }); + + describe('file extension', function() { + + it('should append .gz to the file extension, by default', function(done) { + gulp.src('files/small.txt') + .pipe(gzip()) + .pipe(tap(function(file) { + file.path.should.endWith('.gz'); + done(); + })); + }); + + it('should not append .gz to the file extension receiving { append: false }', function(done) { + gulp.src('files/small.txt') + .pipe(gzip({ append: false })) + .pipe(tap(function(file) { + file.path.should.not.endWith('.gz'); + done(); + })); + }); + + it('should accept an arbitrary extension with the `extension` option', function(done) { + gulp.src('files/small.txt') + .pipe(gzip({ extension: 'zip' })) + .pipe(tap(function(file) { + file.path.should.endWith('.zip'); + done(); + })); + }); + + it('should accept an arbitrary pre-extension with the `preExtension` option', function(done) { + gulp.src('files/small.txt') + .pipe(gzip({ preExtension: 'gz' })) + .pipe(tap(function(file) { + file.path.should.endWith('.gz.txt'); + done(); + })); + }); + }); + + describe('file type', function() { + + it('should return file contents as a Buffer', function(done) { + gulp.src('files/small.txt') + .pipe(gzip()) + .pipe(tap(function(file) { + file.contents.should.be.instanceof(Buffer); + done(); + })); + }); + + it('should return file contents as a Stream', function(done) { + gulp.src('files/small.txt', { buffer: false }) + .pipe(gzip()) + .pipe(tap(function(file) { + file.contents.should.be.instanceof(Stream); + done(); + })); + }); + }); + + describe('file properties', function() { + it('should not lose any properties from the Vinyl file', function(done) { + gulp.src('files/small.txt') + .pipe(tap(function(file) { + file.test = 'test'; + })) + .pipe(gzip()) + .pipe(tap(function(file) { + file.should.have.property('test', 'test'); + done(); + })); + }); + + it('should set `contentEncoding`', function(done) { + gulp.src('files/small.txt') + .pipe(gzip()) + .pipe(tap(function(file) { + file.should.have.property('contentEncoding'); + file.contentEncoding.should.containEql('gzip'); + done(); + })); + }); + }); + + describe('gzip options', function() { + + it('should set gzipOptions object', function(done) { + var instance = gzip({ gzipOptions: { level: 9, memLevel: 1} }); + instance.config.should.have.property('gzipOptions'); + instance.config.gzipOptions.should.have.property('level', 9); + instance.config.gzipOptions.should.have.property('memLevel', 1); + done(); + }); + + it('should handle compression level in buffer mode', function(done) { + var id_lowest_compression = nid(); + var id_highest_compression = nid(); + + var out_lowest_compression = gulp.dest('tmp'); + var out_highest_compression = gulp.dest('tmp'); + + var size_lowest_compression = 0; + var size_highest_compression = 0; + + out_lowest_compression.on('end', function() { + fs.stat('./tmp/' + id_lowest_compression + '.txt.gz', function (err, stats) { + size_lowest_compression = stats.size; + + if (size_highest_compression > 0) { + size_highest_compression.should.be.lessThan(size_lowest_compression); + done(); + } + }); + }); + + out_highest_compression.on('end', function() { + fs.stat('./tmp/' + id_highest_compression + '.txt.gz', function (err, stats) { + size_highest_compression = stats.size; + + if (size_lowest_compression > 0) { + size_highest_compression.should.be.lessThan(size_lowest_compression); + done(); + } + }); + }); + + gulp.src('files/big.txt') + .pipe(rename({ basename: id_lowest_compression })) + .pipe(gzip({ gzipOptions: { level: 1 } })) + .pipe(out_lowest_compression); + + gulp.src('files/big.txt') + .pipe(rename({ basename: id_highest_compression })) + .pipe(gzip({ gzipOptions: { level: 9 } })) + .pipe(out_highest_compression); + }); + + it('should handle compression level in stream mode', function(done) { + var id_lowest_compression = nid(); + var id_highest_compression = nid(); + + var out_lowest_compression = gulp.dest('tmp'); + var out_highest_compression = gulp.dest('tmp'); + + var size_lowest_compression = 0; + var size_highest_compression = 0; + + out_lowest_compression.on('end', function() { + fs.stat('./tmp/' + id_lowest_compression + '.txt.gz', function (err, stats) { + size_lowest_compression = stats.size; + + if (size_highest_compression > 0) { + size_highest_compression.should.be.lessThan(size_lowest_compression); + done(); + } + }); + }); + + out_highest_compression.on('end', function() { + fs.stat('./tmp/' + id_highest_compression + '.txt.gz', function (err, stats) { + size_highest_compression = stats.size; + + if (size_lowest_compression > 0) { + size_highest_compression.should.be.lessThan(size_lowest_compression); + done(); + } + }); + }); + + gulp.src('files/big.txt', { buffer: false }) + .pipe(rename({ basename: id_lowest_compression })) + .pipe(gzip({ gzipOptions: { level: 1 } })) + .pipe(out_lowest_compression); + + gulp.src('files/big.txt', { buffer: false }) + .pipe(rename({ basename: id_highest_compression })) + .pipe(gzip({ gzipOptions: { level: 9 } })) + .pipe(out_highest_compression); + }); + }); + + describe('threshold option', function() { + + it('should set threshold to false while receiving false', function(done) { + var instance = gzip({ threshold: false }); + instance.config.threshold.should.be.false; + done(); + }); + + it('should set threshold to 150 while receiving true', function(done) { + var instance = gzip({ threshold: true }); + instance.config.threshold.should.eql(150); + done(); + }); + + it('should set threshold to Number while receiving Number', function(done) { + var instance = gzip({ threshold: 1024 }); + instance.config.should.have.property('threshold', 1024); + done(); + }); + + it('should set threshold to 150 while receiving Number < 150', function(done) { + var instance = gzip({ threshold: 100 }); + instance.config.should.have.property('threshold', 150); + done(); + }); + + it('should set threshold to Number while receiving String (bytes result)', function(done) { + var instance = gzip({ threshold: '1kb' }); + instance.config.should.have.property('threshold', 1024); + done(); + }); + + it('should set threshold to 150 while receiving String (bytes result < 150)', function(done) { + var instance = gzip({ threshold: '1kb' }); + instance.config.should.have.property('threshold', 1024); + done(); + }); + + it('should handle threshold of 1kb by passing through small.txt (<1kb)', function(done) { + var id = nid(); + var out = gulp.dest('tmp'); + + out.on('end', function() { + fs.readFile('./tmp/' + id + '.txt', { encoding: 'utf-8' }, function(err, file) { + fs.readFile('./files/small.txt', { encoding: 'utf-8' }, function(err, original) { + file.should.equal(original); + done(); + }); + }); + }); + + gulp.src('files/small.txt') + .pipe(rename({ basename: id })) + .pipe(gzip({ threshold: '1kb' })) + .pipe(out); + }); + + it('should handle threshold of 1kb by compressing big.txt (>1kb)', function(done) { + var id = nid(); + var out = gulp.dest('tmp'); + + out.on('end', function() { + fs.readFile('./tmp/' + id + '.txt.gz', function(err, file) { + zlib.unzip(file, function(err, buffer) { + file = buffer.toString('utf-8'); + + fs.readFile('./files/big.txt', { encoding: 'utf-8' }, function(err, original) { + file.should.equal(original); + done(); + }); + }); + }); + }); + + gulp.src('files/big.txt') + .pipe(rename({ basename: id })) + .pipe(gzip({ threshold: '1kb' })) + .pipe(out); + }); + + it('should handle threshold of 1kb by passing through small.txt (<1kb)', function(done) { + var id = nid(); + var out = gulp.dest('tmp'); + + out.on('end', function() { + fs.readFile('./tmp/' + id + '.txt', { encoding: 'utf-8' }, function(err, file) { + fs.readFile('./files/small.txt', { encoding: 'utf-8' }, function(err, original) { + file.should.equal(original); + done(); + }); + }); + }); + + gulp.src('files/small.txt', { buffer: false }) + .pipe(rename({ basename: id })) + .pipe(gzip({ threshold: '1kb' })) + .pipe(out); + }); + + it('should handle threshold of 1kb by compressing big.txt (>1kb)', function(done) { + var id = nid(); + var out = gulp.dest('tmp'); + + out.on('end', function() { + fs.readFile('./tmp/' + id + '.txt.gz', function(err, file) { + zlib.unzip(file, function(err, buffer) { + file = buffer.toString('utf-8'); + + fs.readFile('./files/big.txt', { encoding: 'utf-8' }, function(err, original) { + file.should.equal(original); + done(); + }); + }); + }); + }); + + gulp.src('files/big.txt', { buffer: false }) + .pipe(rename({ basename: id })) + .pipe(gzip({ threshold: '1kb' })) + .pipe(out); + }); + }); + + describe('delete mode', function() { + + it('should not delete existing gzipped files when { deleteMode : false }', function(done) { + var id = nid(); + var out = gulp.dest('tmp'); + + out.on('end', function() { + fs.readFile('./tmp/' + id + '.txt.gz', function(err, file) { + should.not.exist(err); + should.exist(file); + file.should.not.be.empty; + + var out = gulp.dest('tmp'); + out.on('end', function() { + fs.readFile('./tmp/' + id + '.txt.gz', function(err, file) { + should.not.exist(err); + should.exist(file); + file.should.not.be.empty; + done(); + }); + }); + + gulp.src('files/small.txt') + .pipe(rename({ basename: id })) + .pipe(gzip({ threshold: 1024 })) + .pipe(out); + }); + }); + + gulp.src('files/big.txt') + .pipe(rename({ basename: id })) + .pipe(gzip({ threshold: 1024 })) + .pipe(out); + }); + + it('should delete existing gzipped files if the files changed from big.txt (over threshold) to small.txt (under threshold) when { deleteMode : true }', function(done) { + var id = nid(); + var out = gulp.dest('tmp'); + + out.on('end', function() { + fs.readFile('./tmp/' + id + '.txt.gz', function(err, file) { + should.not.exist(err); + should.exist(file); + file.should.not.be.empty; + + var out = gulp.dest('tmp'); + + out.on('end', function() { + fs.exists('./tmp/' + id + '.txt.gz', function(exists) { + exists.should.be.false; + done(); + }); + }); + + gulp.src('files/small.txt') + .pipe(rename({ basename: id })) + .pipe(gzip({ threshold: 1024, deleteMode: 'tmp' })) + .pipe(out); + }); + }); + + gulp.src('files/big.txt') + .pipe(rename({ basename: id })) + .pipe(gzip({ threshold: 1024, deleteMode: 'tmp' })) + .pipe(out); + }); + }); + + describe ('uncompress the compressed file', function() { + + it('should match original in buffer mode', function(done) { + var id = nid(); + var out = gulp.dest('tmp'); + + out.on('end', function() { + fs.readFile('./tmp/' + id + '.txt.gz', function(err, file) { + zlib.unzip(file, function(err, buffer) { + file = buffer.toString('utf-8', 0, buffer.length); + + fs.readFile('./files/small.txt', { encoding: 'utf-8' }, function(err, original) { + file.should.equal(original); + done(); + }); + }); + }); + }); + + gulp.src('files/small.txt') + .pipe(rename({ basename: id })) + .pipe(gzip()) + .pipe(out); + }); + + it('should match original in stream mode', function(done) { + var id = nid(); + var out = gulp.dest('tmp'); + + out.on('end', function() { + fs.readFile('./tmp/' + id + '.txt.gz', function(err, file) { + zlib.unzip(file, function(err, buffer) { + file = buffer.toString('utf-8', 0, buffer.length); + + fs.readFile('./files/small.txt', { encoding: 'utf-8' }, function(err, original) { + file.should.equal(original); + done(); + }); + }); + }); + }); + + gulp.src('files/small.txt', { buffer: false }) + .pipe(rename({ basename: id })) + .pipe(gzip()) + .pipe(out); + }); + }); + + describe('skip files that get larger after compression', function() { + it('handles buffers', function(done) { + var originalBuffer; + gulp.src('files/too_small.txt') + .pipe(tap(function(file) { + originalBuffer = file.contents; + })) + .pipe(gzip({ skipGrowingFiles: true })) + .pipe(tap(function(file) { + file.contents.should.equal(originalBuffer); + done(); + })); + }); + + it('handles streams', function(done) { + var originalStream; + gulp.src('files/too_small.txt', { buffer: false }) + .pipe(tap(function(file) { + originalStream = file.contents; + })) + .pipe(gzip({ skipGrowingFiles: true })) + .pipe(tap(function(file) { + file.contents.should.equal(originalStream); + done(); + })); + }); + }); +}); |