Galerie und tage
This commit is contained in:
20
node_modules/gulp-util/LICENSE
generated
vendored
Executable file
20
node_modules/gulp-util/LICENSE
generated
vendored
Executable file
@@ -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.
|
||||
145
node_modules/gulp-util/README.md
generated
vendored
Normal file
145
node_modules/gulp-util/README.md
generated
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
# 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.10</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var gutil = require('gulp-util');
|
||||
|
||||
gutil.log('stuff happened', 'Really it did', gutil.colors.magenta('123'));
|
||||
|
||||
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. If you pass in multiple arguments it will join them by a space.
|
||||
|
||||
The default gulp coloring using gutil.colors.<color>:
|
||||
```
|
||||
values (files, module names, etc.) = cyan
|
||||
numbers (times, counts, etc) = magenta
|
||||
```
|
||||
|
||||
### colors
|
||||
|
||||
Is an instance of [chalk](https://github.com/sindresorhus/chalk).
|
||||
|
||||
### 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: path.join(__dirname, './fixtures/'),
|
||||
cwd: __dirname,
|
||||
path: 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.
|
||||
- Error properties will be included in `err.toString()`. Can be omitted by including `{showProperties: false}` in the options.
|
||||
|
||||
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://www.npmjs.com/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://img.shields.io/travis/gulpjs/gulp-util.svg?branch=master
|
||||
[coveralls-url]: https://coveralls.io/r/gulpjs/gulp-util
|
||||
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/gulp-util.svg
|
||||
[depstat-url]: https://david-dm.org/gulpjs/gulp-util
|
||||
[depstat-image]: https://david-dm.org/gulpjs/gulp-util.svg
|
||||
18
node_modules/gulp-util/index.js
generated
vendored
Normal file
18
node_modules/gulp-util/index.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
File: require('vinyl'),
|
||||
replaceExtension: require('replace-ext'),
|
||||
colors: require('chalk'),
|
||||
date: require('dateformat'),
|
||||
log: require('./lib/log'),
|
||||
template: require('./lib/template'),
|
||||
env: require('./lib/env'),
|
||||
beep: require('beeper'),
|
||||
noop: require('./lib/noop'),
|
||||
isStream: require('./lib/isStream'),
|
||||
isBuffer: require('./lib/isBuffer'),
|
||||
isNull: require('./lib/isNull'),
|
||||
linefeed: '\n',
|
||||
combine: require('./lib/combine'),
|
||||
buffer: require('./lib/buffer'),
|
||||
PluginError: require('./lib/PluginError')
|
||||
};
|
||||
130
node_modules/gulp-util/lib/PluginError.js
generated
vendored
Normal file
130
node_modules/gulp-util/lib/PluginError.js
generated
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
var util = require('util');
|
||||
var arrayDiffer = require('array-differ');
|
||||
var arrayUniq = require('array-uniq');
|
||||
var chalk = require('chalk');
|
||||
var objectAssign = require('object-assign');
|
||||
|
||||
var nonEnumberableProperties = ['name', 'message', 'stack'];
|
||||
var propertiesNotToDisplay = nonEnumberableProperties.concat(['plugin', 'showStack', 'showProperties', '__safety', '_stack']);
|
||||
|
||||
// wow what a clusterfuck
|
||||
var parseOptions = function(plugin, message, opt) {
|
||||
opt = opt || {};
|
||||
if (typeof plugin === 'object') {
|
||||
opt = plugin;
|
||||
} else {
|
||||
if (message instanceof Error) {
|
||||
opt.error = message;
|
||||
} else if (typeof message === 'object') {
|
||||
opt = message;
|
||||
} else {
|
||||
opt.message = message;
|
||||
}
|
||||
opt.plugin = plugin;
|
||||
}
|
||||
|
||||
return objectAssign({
|
||||
showStack: false,
|
||||
showProperties: true
|
||||
}, 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);
|
||||
var self = this;
|
||||
|
||||
// if options has an error, grab details from it
|
||||
if (options.error) {
|
||||
// These properties are not enumerable, so we have to add them explicitly.
|
||||
arrayUniq(Object.keys(options.error).concat(nonEnumberableProperties))
|
||||
.forEach(function(prop) {
|
||||
self[prop] = options.error[prop];
|
||||
});
|
||||
}
|
||||
|
||||
var properties = ['name', 'message', 'fileName', 'lineNumber', 'stack', 'showStack', 'showProperties', 'plugin'];
|
||||
|
||||
// options object can override
|
||||
properties.forEach(function(prop) {
|
||||
if (prop in options) this[prop] = options[prop];
|
||||
}, this);
|
||||
|
||||
// defaults
|
||||
if (!this.name) this.name = 'Error';
|
||||
|
||||
if (!this.stack) {
|
||||
// Error.captureStackTrace appends a stack property which relies on the toString method of the object it is applied to.
|
||||
// Since we are using our own toString method which controls when to display the stack trace if we don't go through this
|
||||
// safety object, then we'll get stack overflow problems.
|
||||
var safety = {
|
||||
toString: function() {
|
||||
return this._messageWithDetails() + '\nStack:';
|
||||
}.bind(this)
|
||||
};
|
||||
Error.captureStackTrace(safety, arguments.callee || this.constructor);
|
||||
this.__safety = safety;
|
||||
}
|
||||
|
||||
if (!this.plugin) throw new Error('Missing plugin name');
|
||||
if (!this.message) throw new Error('Missing error message');
|
||||
}
|
||||
|
||||
util.inherits(PluginError, Error);
|
||||
|
||||
PluginError.prototype._messageWithDetails = function() {
|
||||
var messageWithDetails = 'Message:\n ' + this.message;
|
||||
var details = this._messageDetails();
|
||||
|
||||
if (details !== '') {
|
||||
messageWithDetails += '\n' + details;
|
||||
}
|
||||
|
||||
return messageWithDetails;
|
||||
};
|
||||
|
||||
PluginError.prototype._messageDetails = function() {
|
||||
if (!this.showProperties) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var properties = arrayDiffer(Object.keys(this), propertiesNotToDisplay);
|
||||
|
||||
if (properties.length === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var self = this;
|
||||
properties = properties.map(function stringifyProperty(prop) {
|
||||
return ' ' + prop + ': ' + self[prop];
|
||||
});
|
||||
|
||||
return 'Details:\n' + properties.join('\n');
|
||||
};
|
||||
|
||||
PluginError.prototype.toString = function () {
|
||||
var sig = chalk.red(this.name) + ' in plugin \'' + chalk.cyan(this.plugin) + '\'';
|
||||
var detailsWithStack = function(stack) {
|
||||
return this._messageWithDetails() + '\nStack:\n' + stack;
|
||||
}.bind(this);
|
||||
|
||||
var msg;
|
||||
if (this.showStack) {
|
||||
if (this.__safety) { // There is no wrapped error, use the stack captured in the PluginError ctor
|
||||
msg = this.__safety.stack;
|
||||
} else if (this._stack) {
|
||||
msg = detailsWithStack(this._stack);
|
||||
} else { // Stack from wrapped error
|
||||
msg = detailsWithStack(this.stack);
|
||||
}
|
||||
} else {
|
||||
msg = this._messageWithDetails();
|
||||
}
|
||||
|
||||
return sig + '\n' + msg;
|
||||
};
|
||||
|
||||
module.exports = PluginError;
|
||||
15
node_modules/gulp-util/lib/buffer.js
generated
vendored
Normal file
15
node_modules/gulp-util/lib/buffer.js
generated
vendored
Normal file
@@ -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);
|
||||
};
|
||||
11
node_modules/gulp-util/lib/combine.js
generated
vendored
Normal file
11
node_modules/gulp-util/lib/combine.js
generated
vendored
Normal file
@@ -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);
|
||||
};
|
||||
};
|
||||
4
node_modules/gulp-util/lib/env.js
generated
vendored
Normal file
4
node_modules/gulp-util/lib/env.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var parseArgs = require('minimist');
|
||||
var argv = parseArgs(process.argv.slice(2));
|
||||
|
||||
module.exports = argv;
|
||||
7
node_modules/gulp-util/lib/isBuffer.js
generated
vendored
Normal file
7
node_modules/gulp-util/lib/isBuffer.js
generated
vendored
Normal file
@@ -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;
|
||||
};
|
||||
3
node_modules/gulp-util/lib/isNull.js
generated
vendored
Normal file
3
node_modules/gulp-util/lib/isNull.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = function(v) {
|
||||
return v === null;
|
||||
};
|
||||
5
node_modules/gulp-util/lib/isStream.js
generated
vendored
Normal file
5
node_modules/gulp-util/lib/isStream.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
var Stream = require('stream').Stream;
|
||||
|
||||
module.exports = function(o) {
|
||||
return !!o && o instanceof Stream;
|
||||
};
|
||||
14
node_modules/gulp-util/lib/log.js
generated
vendored
Normal file
14
node_modules/gulp-util/lib/log.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
var hasGulplog = require('has-gulplog');
|
||||
|
||||
module.exports = function(){
|
||||
if(hasGulplog()){
|
||||
// specifically deferring loading here to keep from registering it globally
|
||||
var gulplog = require('gulplog');
|
||||
gulplog.info.apply(gulplog, arguments);
|
||||
} else {
|
||||
// specifically defering loading because it might not be used
|
||||
var fancylog = require('fancy-log');
|
||||
fancylog.apply(null, arguments);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
5
node_modules/gulp-util/lib/noop.js
generated
vendored
Normal file
5
node_modules/gulp-util/lib/noop.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
var through = require('through2');
|
||||
|
||||
module.exports = function () {
|
||||
return through.obj();
|
||||
};
|
||||
23
node_modules/gulp-util/lib/template.js
generated
vendored
Normal file
23
node_modules/gulp-util/lib/template.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
var template = require('lodash.template');
|
||||
var reEscape = require('lodash._reescape');
|
||||
var reEvaluate = require('lodash._reevaluate');
|
||||
var reInterpolate = require('lodash._reinterpolate');
|
||||
|
||||
var forcedSettings = {
|
||||
escape: reEscape,
|
||||
evaluate: reEvaluate,
|
||||
interpolate: reInterpolate
|
||||
};
|
||||
|
||||
module.exports = function(tmpl, data) {
|
||||
var fn = template(tmpl, 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);
|
||||
};
|
||||
21
node_modules/gulp-util/node_modules/clone-stats/LICENSE.md
generated
vendored
Normal file
21
node_modules/gulp-util/node_modules/clone-stats/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
## The MIT License (MIT) ##
|
||||
|
||||
Copyright (c) 2014 Hugh Kennedy
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
17
node_modules/gulp-util/node_modules/clone-stats/README.md
generated
vendored
Normal file
17
node_modules/gulp-util/node_modules/clone-stats/README.md
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# clone-stats [](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/clone-stats&title=clone-stats&description=hughsk/clone-stats%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[](http://github.com/hughsk/stability-badges) #
|
||||
|
||||
Safely clone node's
|
||||
[`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) instances without
|
||||
losing their class methods, i.e. `stat.isDirectory()` and co.
|
||||
|
||||
## Usage ##
|
||||
|
||||
[](https://nodei.co/npm/clone-stats)
|
||||
|
||||
### `copy = require('clone-stats')(stat)` ###
|
||||
|
||||
Returns a clone of the original `fs.Stats` instance (`stat`).
|
||||
|
||||
## License ##
|
||||
|
||||
MIT. See [LICENSE.md](http://github.com/hughsk/clone-stats/blob/master/LICENSE.md) for details.
|
||||
13
node_modules/gulp-util/node_modules/clone-stats/index.js
generated
vendored
Normal file
13
node_modules/gulp-util/node_modules/clone-stats/index.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
var Stat = require('fs').Stats
|
||||
|
||||
module.exports = cloneStats
|
||||
|
||||
function cloneStats(stats) {
|
||||
var replacement = new Stat
|
||||
|
||||
Object.keys(stats).forEach(function(key) {
|
||||
replacement[key] = stats[key]
|
||||
})
|
||||
|
||||
return replacement
|
||||
}
|
||||
31
node_modules/gulp-util/node_modules/clone-stats/package.json
generated
vendored
Normal file
31
node_modules/gulp-util/node_modules/clone-stats/package.json
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "clone-stats",
|
||||
"description": "Safely clone node's fs.Stats instances without losing their class methods",
|
||||
"version": "0.0.1",
|
||||
"main": "index.js",
|
||||
"browser": "index.js",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"tape": "~2.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test"
|
||||
},
|
||||
"author": "Hugh Kennedy <hughskennedy@gmail.com> (http://hughsk.io/)",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/hughsk/clone-stats"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/hughsk/clone-stats/issues"
|
||||
},
|
||||
"homepage": "https://github.com/hughsk/clone-stats",
|
||||
"keywords": [
|
||||
"stats",
|
||||
"fs",
|
||||
"clone",
|
||||
"copy",
|
||||
"prototype"
|
||||
]
|
||||
}
|
||||
36
node_modules/gulp-util/node_modules/clone-stats/test.js
generated
vendored
Normal file
36
node_modules/gulp-util/node_modules/clone-stats/test.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
var test = require('tape')
|
||||
var clone = require('./')
|
||||
var fs = require('fs')
|
||||
|
||||
test('file', function(t) {
|
||||
compare(t, fs.statSync(__filename))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('directory', function(t) {
|
||||
compare(t, fs.statSync(__dirname))
|
||||
t.end()
|
||||
})
|
||||
|
||||
function compare(t, stat) {
|
||||
var copy = clone(stat)
|
||||
|
||||
t.deepEqual(stat, copy, 'clone has equal properties')
|
||||
t.ok(stat instanceof fs.Stats, 'original is an fs.Stat')
|
||||
t.ok(copy instanceof fs.Stats, 'copy is an fs.Stat')
|
||||
|
||||
;['isDirectory'
|
||||
, 'isFile'
|
||||
, 'isBlockDevice'
|
||||
, 'isCharacterDevice'
|
||||
, 'isSymbolicLink'
|
||||
, 'isFIFO'
|
||||
, 'isSocket'
|
||||
].forEach(function(method) {
|
||||
t.equal(
|
||||
stat[method].call(stat)
|
||||
, copy[method].call(copy)
|
||||
, 'equal value for stat.' + method + '()'
|
||||
)
|
||||
})
|
||||
}
|
||||
4
node_modules/gulp-util/node_modules/clone/.npmignore
generated
vendored
Normal file
4
node_modules/gulp-util/node_modules/clone/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/node_modules/
|
||||
/test.js
|
||||
/*.html
|
||||
/.travis.yml
|
||||
18
node_modules/gulp-util/node_modules/clone/LICENSE
generated
vendored
Normal file
18
node_modules/gulp-util/node_modules/clone/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
Copyright © 2011-2015 Paul Vorbach <paul@vorba.ch>
|
||||
|
||||
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, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
126
node_modules/gulp-util/node_modules/clone/README.md
generated
vendored
Normal file
126
node_modules/gulp-util/node_modules/clone/README.md
generated
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
# clone
|
||||
|
||||
[](http://travis-ci.org/pvorb/node-clone)
|
||||
|
||||
[](http://npm-stat.com/charts.html?package=clone)
|
||||
|
||||
offers foolproof _deep cloning_ of objects, arrays, numbers, strings etc. in JavaScript.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
npm install clone
|
||||
|
||||
(It also works with browserify, ender or standalone.)
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
~~~ javascript
|
||||
var clone = require('clone');
|
||||
|
||||
var a, b;
|
||||
|
||||
a = { foo: { bar: 'baz' } }; // initial value of a
|
||||
|
||||
b = clone(a); // clone a -> b
|
||||
a.foo.bar = 'foo'; // change a
|
||||
|
||||
console.log(a); // show a
|
||||
console.log(b); // show b
|
||||
~~~
|
||||
|
||||
This will print:
|
||||
|
||||
~~~ javascript
|
||||
{ foo: { bar: 'foo' } }
|
||||
{ foo: { bar: 'baz' } }
|
||||
~~~
|
||||
|
||||
**clone** masters cloning simple objects (even with custom prototype), arrays,
|
||||
Date objects, and RegExp objects. Everything is cloned recursively, so that you
|
||||
can clone dates in arrays in objects, for example.
|
||||
|
||||
|
||||
## API
|
||||
|
||||
`clone(val, circular, depth)`
|
||||
|
||||
* `val` -- the value that you want to clone, any type allowed
|
||||
* `circular` -- boolean
|
||||
|
||||
Call `clone` with `circular` set to `false` if you are certain that `obj`
|
||||
contains no circular references. This will give better performance if needed.
|
||||
There is no error if `undefined` or `null` is passed as `obj`.
|
||||
* `depth` -- depth to which the object is to be cloned (optional,
|
||||
defaults to infinity)
|
||||
|
||||
`clone.clonePrototype(obj)`
|
||||
|
||||
* `obj` -- the object that you want to clone
|
||||
|
||||
Does a prototype clone as
|
||||
[described by Oran Looney](http://oranlooney.com/functional-javascript/).
|
||||
|
||||
|
||||
## Circular References
|
||||
|
||||
~~~ javascript
|
||||
var a, b;
|
||||
|
||||
a = { hello: 'world' };
|
||||
|
||||
a.myself = a;
|
||||
b = clone(a);
|
||||
|
||||
console.log(b);
|
||||
~~~
|
||||
|
||||
This will print:
|
||||
|
||||
~~~ javascript
|
||||
{ hello: "world", myself: [Circular] }
|
||||
~~~
|
||||
|
||||
So, `b.myself` points to `b`, not `a`. Neat!
|
||||
|
||||
|
||||
## Test
|
||||
|
||||
npm test
|
||||
|
||||
|
||||
## Caveat
|
||||
|
||||
Some special objects like a socket or `process.stdout`/`stderr` are known to not
|
||||
be cloneable. If you find other objects that cannot be cloned, please [open an
|
||||
issue](https://github.com/pvorb/node-clone/issues/new).
|
||||
|
||||
|
||||
## Bugs and Issues
|
||||
|
||||
If you encounter any bugs or issues, feel free to [open an issue at
|
||||
github](https://github.com/pvorb/node-clone/issues) or send me an email to
|
||||
<paul@vorba.ch>. I also always like to hear from you, if you’re using my code.
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2011-2015 [Paul Vorbach](http://paul.vorba.ch/) and
|
||||
[contributors](https://github.com/pvorb/node-clone/graphs/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, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
10
node_modules/gulp-util/node_modules/clone/clone.iml
generated
vendored
Normal file
10
node_modules/gulp-util/node_modules/clone/clone.iml
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="clone node_modules" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
166
node_modules/gulp-util/node_modules/clone/clone.js
generated
vendored
Normal file
166
node_modules/gulp-util/node_modules/clone/clone.js
generated
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
var clone = (function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Clones (copies) an Object using deep copying.
|
||||
*
|
||||
* This function supports circular references by default, but if you are certain
|
||||
* there are no circular references in your object, you can save some CPU time
|
||||
* by calling clone(obj, false).
|
||||
*
|
||||
* Caution: if `circular` is false and `parent` contains circular references,
|
||||
* your program may enter an infinite loop and crash.
|
||||
*
|
||||
* @param `parent` - the object to be cloned
|
||||
* @param `circular` - set to true if the object to be cloned may contain
|
||||
* circular references. (optional - true by default)
|
||||
* @param `depth` - set to a number if the object is only to be cloned to
|
||||
* a particular depth. (optional - defaults to Infinity)
|
||||
* @param `prototype` - sets the prototype to be used when cloning an object.
|
||||
* (optional - defaults to parent prototype).
|
||||
*/
|
||||
function clone(parent, circular, depth, prototype) {
|
||||
var filter;
|
||||
if (typeof circular === 'object') {
|
||||
depth = circular.depth;
|
||||
prototype = circular.prototype;
|
||||
filter = circular.filter;
|
||||
circular = circular.circular
|
||||
}
|
||||
// maintain two arrays for circular references, where corresponding parents
|
||||
// and children have the same index
|
||||
var allParents = [];
|
||||
var allChildren = [];
|
||||
|
||||
var useBuffer = typeof Buffer != 'undefined';
|
||||
|
||||
if (typeof circular == 'undefined')
|
||||
circular = true;
|
||||
|
||||
if (typeof depth == 'undefined')
|
||||
depth = Infinity;
|
||||
|
||||
// recurse this function so we don't reset allParents and allChildren
|
||||
function _clone(parent, depth) {
|
||||
// cloning null always returns null
|
||||
if (parent === null)
|
||||
return null;
|
||||
|
||||
if (depth == 0)
|
||||
return parent;
|
||||
|
||||
var child;
|
||||
var proto;
|
||||
if (typeof parent != 'object') {
|
||||
return parent;
|
||||
}
|
||||
|
||||
if (clone.__isArray(parent)) {
|
||||
child = [];
|
||||
} else if (clone.__isRegExp(parent)) {
|
||||
child = new RegExp(parent.source, __getRegExpFlags(parent));
|
||||
if (parent.lastIndex) child.lastIndex = parent.lastIndex;
|
||||
} else if (clone.__isDate(parent)) {
|
||||
child = new Date(parent.getTime());
|
||||
} else if (useBuffer && Buffer.isBuffer(parent)) {
|
||||
if (Buffer.allocUnsafe) {
|
||||
// Node.js >= 4.5.0
|
||||
child = Buffer.allocUnsafe(parent.length);
|
||||
} else {
|
||||
// Older Node.js versions
|
||||
child = new Buffer(parent.length);
|
||||
}
|
||||
parent.copy(child);
|
||||
return child;
|
||||
} else {
|
||||
if (typeof prototype == 'undefined') {
|
||||
proto = Object.getPrototypeOf(parent);
|
||||
child = Object.create(proto);
|
||||
}
|
||||
else {
|
||||
child = Object.create(prototype);
|
||||
proto = prototype;
|
||||
}
|
||||
}
|
||||
|
||||
if (circular) {
|
||||
var index = allParents.indexOf(parent);
|
||||
|
||||
if (index != -1) {
|
||||
return allChildren[index];
|
||||
}
|
||||
allParents.push(parent);
|
||||
allChildren.push(child);
|
||||
}
|
||||
|
||||
for (var i in parent) {
|
||||
var attrs;
|
||||
if (proto) {
|
||||
attrs = Object.getOwnPropertyDescriptor(proto, i);
|
||||
}
|
||||
|
||||
if (attrs && attrs.set == null) {
|
||||
continue;
|
||||
}
|
||||
child[i] = _clone(parent[i], depth - 1);
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
return _clone(parent, depth);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple flat clone using prototype, accepts only objects, usefull for property
|
||||
* override on FLAT configuration object (no nested props).
|
||||
*
|
||||
* USE WITH CAUTION! This may not behave as you wish if you do not know how this
|
||||
* works.
|
||||
*/
|
||||
clone.clonePrototype = function clonePrototype(parent) {
|
||||
if (parent === null)
|
||||
return null;
|
||||
|
||||
var c = function () {};
|
||||
c.prototype = parent;
|
||||
return new c();
|
||||
};
|
||||
|
||||
// private utility functions
|
||||
|
||||
function __objToStr(o) {
|
||||
return Object.prototype.toString.call(o);
|
||||
};
|
||||
clone.__objToStr = __objToStr;
|
||||
|
||||
function __isDate(o) {
|
||||
return typeof o === 'object' && __objToStr(o) === '[object Date]';
|
||||
};
|
||||
clone.__isDate = __isDate;
|
||||
|
||||
function __isArray(o) {
|
||||
return typeof o === 'object' && __objToStr(o) === '[object Array]';
|
||||
};
|
||||
clone.__isArray = __isArray;
|
||||
|
||||
function __isRegExp(o) {
|
||||
return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
|
||||
};
|
||||
clone.__isRegExp = __isRegExp;
|
||||
|
||||
function __getRegExpFlags(re) {
|
||||
var flags = '';
|
||||
if (re.global) flags += 'g';
|
||||
if (re.ignoreCase) flags += 'i';
|
||||
if (re.multiline) flags += 'm';
|
||||
return flags;
|
||||
};
|
||||
clone.__getRegExpFlags = __getRegExpFlags;
|
||||
|
||||
return clone;
|
||||
})();
|
||||
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
module.exports = clone;
|
||||
}
|
||||
51
node_modules/gulp-util/node_modules/clone/package.json
generated
vendored
Normal file
51
node_modules/gulp-util/node_modules/clone/package.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "clone",
|
||||
"description": "deep cloning of objects and arrays",
|
||||
"tags": [
|
||||
"clone",
|
||||
"object",
|
||||
"array",
|
||||
"function",
|
||||
"date"
|
||||
],
|
||||
"version": "1.0.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/pvorb/node-clone.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/pvorb/node-clone/issues"
|
||||
},
|
||||
"main": "clone.js",
|
||||
"author": "Paul Vorbach <paul@vorba.ch> (http://paul.vorba.ch/)",
|
||||
"contributors": [
|
||||
"Blake Miner <miner.blake@gmail.com> (http://www.blakeminer.com/)",
|
||||
"Tian You <axqd001@gmail.com> (http://blog.axqd.net/)",
|
||||
"George Stagas <gstagas@gmail.com> (http://stagas.com/)",
|
||||
"Tobiasz Cudnik <tobiasz.cudnik@gmail.com> (https://github.com/TobiaszCudnik)",
|
||||
"Pavel Lang <langpavel@phpskelet.org> (https://github.com/langpavel)",
|
||||
"Dan MacTough (http://yabfog.com/)",
|
||||
"w1nk (https://github.com/w1nk)",
|
||||
"Hugh Kennedy (http://twitter.com/hughskennedy)",
|
||||
"Dustin Diaz (http://dustindiaz.com)",
|
||||
"Ilya Shaisultanov (https://github.com/diversario)",
|
||||
"Nathan MacInnes <nathan@macinn.es> (http://macinn.es/)",
|
||||
"Benjamin E. Coe <ben@npmjs.com> (https://twitter.com/benjamincoe)",
|
||||
"Nathan Zadoks (https://github.com/nathan7)",
|
||||
"Róbert Oroszi <robert+gh@oroszi.net> (https://github.com/oroce)",
|
||||
"Aurélio A. Heckert (http://softwarelivre.org/aurium)",
|
||||
"Guy Ellis (http://www.guyellisrocks.com/)"
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"nodeunit": "~0.9.0"
|
||||
},
|
||||
"optionalDependencies": {},
|
||||
"scripts": {
|
||||
"test": "nodeunit test.js"
|
||||
}
|
||||
}
|
||||
39
node_modules/gulp-util/node_modules/object-assign/index.js
generated
vendored
Normal file
39
node_modules/gulp-util/node_modules/object-assign/index.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
|
||||
function ToObject(val) {
|
||||
if (val == null) {
|
||||
throw new TypeError('Object.assign cannot be called with null or undefined');
|
||||
}
|
||||
|
||||
return Object(val);
|
||||
}
|
||||
|
||||
function ownEnumerableKeys(obj) {
|
||||
var keys = Object.getOwnPropertyNames(obj);
|
||||
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
keys = keys.concat(Object.getOwnPropertySymbols(obj));
|
||||
}
|
||||
|
||||
return keys.filter(function (key) {
|
||||
return propIsEnumerable.call(obj, key);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = Object.assign || function (target, source) {
|
||||
var from;
|
||||
var keys;
|
||||
var to = ToObject(target);
|
||||
|
||||
for (var s = 1; s < arguments.length; s++) {
|
||||
from = arguments[s];
|
||||
keys = ownEnumerableKeys(Object(from));
|
||||
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
to[keys[i]] = from[keys[i]];
|
||||
}
|
||||
}
|
||||
|
||||
return to;
|
||||
};
|
||||
21
node_modules/gulp-util/node_modules/object-assign/license
generated
vendored
Normal file
21
node_modules/gulp-util/node_modules/object-assign/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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.
|
||||
38
node_modules/gulp-util/node_modules/object-assign/package.json
generated
vendored
Normal file
38
node_modules/gulp-util/node_modules/object-assign/package.json
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "object-assign",
|
||||
"version": "3.0.0",
|
||||
"description": "ES6 Object.assign() ponyfill",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/object-assign",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "http://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"object",
|
||||
"assign",
|
||||
"extend",
|
||||
"properties",
|
||||
"es6",
|
||||
"ecmascript",
|
||||
"harmony",
|
||||
"ponyfill",
|
||||
"prollyfill",
|
||||
"polyfill",
|
||||
"shim",
|
||||
"browser"
|
||||
],
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
}
|
||||
}
|
||||
51
node_modules/gulp-util/node_modules/object-assign/readme.md
generated
vendored
Normal file
51
node_modules/gulp-util/node_modules/object-assign/readme.md
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
# object-assign [](https://travis-ci.org/sindresorhus/object-assign)
|
||||
|
||||
> ES6 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill
|
||||
|
||||
> Ponyfill: A polyfill that doesn't overwrite the native method
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save object-assign
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var objectAssign = require('object-assign');
|
||||
|
||||
objectAssign({foo: 0}, {bar: 1});
|
||||
//=> {foo: 0, bar: 1}
|
||||
|
||||
// multiple sources
|
||||
objectAssign({foo: 0}, {bar: 1}, {baz: 2});
|
||||
//=> {foo: 0, bar: 1, baz: 2}
|
||||
|
||||
// overwrites equal keys
|
||||
objectAssign({foo: 0}, {foo: 1}, {foo: 2});
|
||||
//=> {foo: 2}
|
||||
|
||||
// ignores null and undefined sources
|
||||
objectAssign({foo: 0}, null, {bar: 1}, undefined);
|
||||
//=> {foo: 0, bar: 1}
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### objectAssign(target, source, [source, ...])
|
||||
|
||||
Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones.
|
||||
|
||||
|
||||
## Resources
|
||||
|
||||
- [ES6 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
6
node_modules/gulp-util/node_modules/replace-ext/.npmignore
generated
vendored
Normal file
6
node_modules/gulp-util/node_modules/replace-ext/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
.DS_Store
|
||||
*.log
|
||||
node_modules
|
||||
build
|
||||
*.node
|
||||
components
|
||||
8
node_modules/gulp-util/node_modules/replace-ext/.travis.yml
generated
vendored
Normal file
8
node_modules/gulp-util/node_modules/replace-ext/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.7"
|
||||
- "0.8"
|
||||
- "0.9"
|
||||
- "0.10"
|
||||
after_script:
|
||||
- npm run coveralls
|
||||
20
node_modules/gulp-util/node_modules/replace-ext/LICENSE
generated
vendored
Executable file
20
node_modules/gulp-util/node_modules/replace-ext/LICENSE
generated
vendored
Executable file
@@ -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.
|
||||
44
node_modules/gulp-util/node_modules/replace-ext/README.md
generated
vendored
Normal file
44
node_modules/gulp-util/node_modules/replace-ext/README.md
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
# replace-ext [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status][david-image]][david-url]
|
||||
|
||||
|
||||
## Information
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>Package</td><td>replace-ext</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td>Replaces a file extension with another one</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Node Version</td>
|
||||
<td>>= 0.4</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var replaceExt = require('replace-ext');
|
||||
|
||||
var path = '/some/dir/file.js';
|
||||
var npath = replaceExt(path, '.coffee');
|
||||
|
||||
console.log(npath); // /some/dir/file.coffee
|
||||
```
|
||||
|
||||
[npm-url]: https://npmjs.org/package/replace-ext
|
||||
[npm-image]: https://badge.fury.io/js/replace-ext.png
|
||||
|
||||
[travis-url]: https://travis-ci.org/wearefractal/replace-ext
|
||||
[travis-image]: https://travis-ci.org/wearefractal/replace-ext.png?branch=master
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/wearefractal/replace-ext
|
||||
[coveralls-image]: https://coveralls.io/repos/wearefractal/replace-ext/badge.png
|
||||
|
||||
[depstat-url]: https://david-dm.org/wearefractal/replace-ext
|
||||
[depstat-image]: https://david-dm.org/wearefractal/replace-ext.png
|
||||
|
||||
[david-url]: https://david-dm.org/wearefractal/replace-ext
|
||||
[david-image]: https://david-dm.org/wearefractal/replace-ext.png?theme=shields.io
|
||||
9
node_modules/gulp-util/node_modules/replace-ext/index.js
generated
vendored
Normal file
9
node_modules/gulp-util/node_modules/replace-ext/index.js
generated
vendored
Normal file
@@ -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);
|
||||
};
|
||||
35
node_modules/gulp-util/node_modules/replace-ext/package.json
generated
vendored
Normal file
35
node_modules/gulp-util/node_modules/replace-ext/package.json
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name":"replace-ext",
|
||||
"description":"Replaces a file extension with another one",
|
||||
"version":"0.0.1",
|
||||
"homepage":"http://github.com/wearefractal/replace-ext",
|
||||
"repository":"git://github.com/wearefractal/replace-ext.git",
|
||||
"author":"Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
|
||||
"main":"./index.js",
|
||||
|
||||
"dependencies":{
|
||||
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "~1.17.0",
|
||||
"should": "~3.1.0",
|
||||
"mocha-lcov-reporter": "~0.0.1",
|
||||
"coveralls": "~2.6.1",
|
||||
"istanbul": "~0.2.3",
|
||||
"rimraf": "~2.2.5",
|
||||
"jshint": "~2.4.1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha --reporter spec && jshint",
|
||||
"coveralls": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"licenses":[
|
||||
{
|
||||
"type":"MIT",
|
||||
"url":"http://github.com/wearefractal/replace-ext/raw/master/LICENSE"
|
||||
}
|
||||
]
|
||||
}
|
||||
51
node_modules/gulp-util/node_modules/replace-ext/test/main.js
generated
vendored
Normal file
51
node_modules/gulp-util/node_modules/replace-ext/test/main.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
var replaceExt = require('../');
|
||||
var path = require('path');
|
||||
var should = require('should');
|
||||
require('mocha');
|
||||
|
||||
describe('replace-ext', function() {
|
||||
it('should return a valid replaced extension on nested', function(done) {
|
||||
var fname = path.join(__dirname, './fixtures/test.coffee');
|
||||
var expected = path.join(__dirname, './fixtures/test.js');
|
||||
var nu = replaceExt(fname, '.js');
|
||||
should.exist(nu);
|
||||
nu.should.equal(expected);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return a valid replaced extension on flat', function(done) {
|
||||
var fname = 'test.coffee';
|
||||
var expected = 'test.js';
|
||||
var nu = replaceExt(fname, '.js');
|
||||
should.exist(nu);
|
||||
nu.should.equal(expected);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should not return a valid replaced extension on empty string', function(done) {
|
||||
var fname = '';
|
||||
var expected = '';
|
||||
var nu = replaceExt(fname, '.js');
|
||||
should.exist(nu);
|
||||
nu.should.equal(expected);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return a valid removed extension on nested', function(done) {
|
||||
var fname = path.join(__dirname, './fixtures/test.coffee');
|
||||
var expected = path.join(__dirname, './fixtures/test');
|
||||
var nu = replaceExt(fname, '');
|
||||
should.exist(nu);
|
||||
nu.should.equal(expected);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return a valid added extension on nested', function(done) {
|
||||
var fname = path.join(__dirname, './fixtures/test');
|
||||
var expected = path.join(__dirname, './fixtures/test.js');
|
||||
var nu = replaceExt(fname, '.js');
|
||||
should.exist(nu);
|
||||
nu.should.equal(expected);
|
||||
done();
|
||||
});
|
||||
});
|
||||
20
node_modules/gulp-util/node_modules/vinyl/LICENSE
generated
vendored
Normal file
20
node_modules/gulp-util/node_modules/vinyl/LICENSE
generated
vendored
Normal file
@@ -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.
|
||||
195
node_modules/gulp-util/node_modules/vinyl/README.md
generated
vendored
Normal file
195
node_modules/gulp-util/node_modules/vinyl/README.md
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
# vinyl [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [](https://david-dm.org/wearefractal/vinyl)
|
||||
## Information
|
||||
<table><br><tr><br><td>Package</td><td>vinyl</td><br></tr><br><tr><br><td>Description</td><br><td>A virtual file format</td><br></tr><br><tr><br><td>Node Version</td><br><td>>= 0.9</td><br></tr><br></table>
|
||||
|
||||
## What is this?
|
||||
Read this for more info about how this plays into the grand scheme of things [https://medium.com/@eschoff/3828e8126466](https://medium.com/@eschoff/3828e8126466)
|
||||
|
||||
## File
|
||||
|
||||
```javascript
|
||||
var File = require('vinyl');
|
||||
|
||||
var coffeeFile = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee",
|
||||
contents: new Buffer("test = 123")
|
||||
});
|
||||
```
|
||||
|
||||
### isVinyl
|
||||
When checking if an object is a vinyl file, you should not use instanceof. Use the isVinyl function instead.
|
||||
|
||||
```js
|
||||
var File = require('vinyl');
|
||||
|
||||
var dummy = new File({stuff});
|
||||
var notAFile = {};
|
||||
|
||||
File.isVinyl(dummy); // true
|
||||
File.isVinyl(notAFile); // false
|
||||
```
|
||||
|
||||
### constructor(options)
|
||||
#### options.cwd
|
||||
Type: `String`<br><br>Default: `process.cwd()`
|
||||
|
||||
#### options.base
|
||||
Used for relative pathing. Typically where a glob starts.
|
||||
|
||||
Type: `String`<br><br>Default: `options.cwd`
|
||||
|
||||
#### options.path
|
||||
Full path to the file.
|
||||
|
||||
Type: `String`<br><br>Default: `undefined`
|
||||
|
||||
#### options.history
|
||||
Path history. Has no effect if `options.path` is passed.
|
||||
|
||||
Type: `Array`<br><br>Default: `options.path ? [options.path] : []`
|
||||
|
||||
#### 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`<br><br>Default: `null`
|
||||
|
||||
#### options.contents
|
||||
File contents.
|
||||
|
||||
Type: `Buffer, Stream, or null`<br><br>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([opt])
|
||||
Returns a new File object with all attributes cloned.<br>By default custom attributes are deep-cloned.
|
||||
|
||||
If opt or opt.deep is false, custom attributes will not be deep-cloned.
|
||||
|
||||
If opt.contents is false, it will copy file.contents Buffer's reference.
|
||||
|
||||
### 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 false, 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.
|
||||
|
||||
### contents
|
||||
The [Stream](https://nodejs.org/api/stream.html#stream_stream) or [Buffer](https://nodejs.org/api/buffer.html#buffer_class_buffer) of the file as it was passed in via options, or as the result of modification.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
if (file.isBuffer()) {
|
||||
console.log(file.contents.toString()); // logs out the string of contents
|
||||
}
|
||||
```
|
||||
|
||||
### path
|
||||
Absolute pathname string or `undefined`. Setting to a different value pushes the old value to `history`.
|
||||
|
||||
### history
|
||||
Array of `path` values the file object has had, from `history[0]` (original) through `history[history.length - 1]` (current). `history` and its elements should normally be treated as read-only and only altered indirectly by setting `path`.
|
||||
|
||||
### 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
|
||||
```
|
||||
|
||||
### dirname
|
||||
Gets and sets path.dirname for the file path.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var file = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee"
|
||||
});
|
||||
|
||||
console.log(file.dirname); // /test
|
||||
|
||||
file.dirname = '/specs';
|
||||
|
||||
console.log(file.dirname); // /specs
|
||||
console.log(file.path); // /specs/file.coffee
|
||||
`
|
||||
```
|
||||
|
||||
### basename
|
||||
Gets and sets path.basename for the file path.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var file = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee"
|
||||
});
|
||||
|
||||
console.log(file.basename); // file.coffee
|
||||
|
||||
file.basename = 'file.js';
|
||||
|
||||
console.log(file.basename); // file.js
|
||||
console.log(file.path); // /test/file.js
|
||||
`
|
||||
```
|
||||
|
||||
### extname
|
||||
Gets and sets path.extname for the file path.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var file = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee"
|
||||
});
|
||||
|
||||
console.log(file.extname); // .coffee
|
||||
|
||||
file.extname = '.js';
|
||||
|
||||
console.log(file.extname); // .js
|
||||
console.log(file.path); // /test/file.js
|
||||
`
|
||||
```
|
||||
|
||||
[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
|
||||
213
node_modules/gulp-util/node_modules/vinyl/index.js
generated
vendored
Normal file
213
node_modules/gulp-util/node_modules/vinyl/index.js
generated
vendored
Normal file
@@ -0,0 +1,213 @@
|
||||
var path = require('path');
|
||||
var clone = require('clone');
|
||||
var cloneStats = require('clone-stats');
|
||||
var cloneBuffer = require('./lib/cloneBuffer');
|
||||
var isBuffer = require('./lib/isBuffer');
|
||||
var isStream = require('./lib/isStream');
|
||||
var isNull = require('./lib/isNull');
|
||||
var inspectStream = require('./lib/inspectStream');
|
||||
var Stream = require('stream');
|
||||
var replaceExt = require('replace-ext');
|
||||
|
||||
function File(file) {
|
||||
if (!file) file = {};
|
||||
|
||||
// record path change
|
||||
var history = file.path ? [file.path] : file.history;
|
||||
this.history = history || [];
|
||||
|
||||
this.cwd = file.cwd || process.cwd();
|
||||
this.base = file.base || this.cwd;
|
||||
|
||||
// stat = files stats object
|
||||
this.stat = file.stat || null;
|
||||
|
||||
// contents = stream, buffer, or null if not read
|
||||
this.contents = file.contents || null;
|
||||
|
||||
this._isVinyl = true;
|
||||
}
|
||||
|
||||
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(opt) {
|
||||
if (typeof opt === 'boolean') {
|
||||
opt = {
|
||||
deep: opt,
|
||||
contents: true
|
||||
};
|
||||
} else if (!opt) {
|
||||
opt = {
|
||||
deep: true,
|
||||
contents: true
|
||||
};
|
||||
} else {
|
||||
opt.deep = opt.deep === true;
|
||||
opt.contents = opt.contents !== false;
|
||||
}
|
||||
|
||||
// clone our file contents
|
||||
var contents;
|
||||
if (this.isStream()) {
|
||||
contents = this.contents.pipe(new Stream.PassThrough());
|
||||
this.contents = this.contents.pipe(new Stream.PassThrough());
|
||||
} else if (this.isBuffer()) {
|
||||
contents = opt.contents ? cloneBuffer(this.contents) : this.contents;
|
||||
}
|
||||
|
||||
var file = new File({
|
||||
cwd: this.cwd,
|
||||
base: this.base,
|
||||
stat: (this.stat ? cloneStats(this.stat) : null),
|
||||
history: this.history.slice(),
|
||||
contents: contents
|
||||
});
|
||||
|
||||
// clone our custom properties
|
||||
Object.keys(this).forEach(function(key) {
|
||||
// ignore built-in fields
|
||||
if (key === '_contents' || key === 'stat' ||
|
||||
key === 'history' || key === 'path' ||
|
||||
key === 'base' || key === 'cwd') {
|
||||
return;
|
||||
}
|
||||
file[key] = opt.deep ? clone(this[key], true) : this[key];
|
||||
}, this);
|
||||
return file;
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// isNull
|
||||
if (opt.end) stream.end();
|
||||
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(' ')+'>';
|
||||
};
|
||||
|
||||
File.isVinyl = function(file) {
|
||||
return file && file._isVinyl === true;
|
||||
};
|
||||
|
||||
// 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.');
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(File.prototype, 'dirname', {
|
||||
get: function() {
|
||||
if (!this.path) throw new Error('No path specified! Can not get dirname.');
|
||||
return path.dirname(this.path);
|
||||
},
|
||||
set: function(dirname) {
|
||||
if (!this.path) throw new Error('No path specified! Can not set dirname.');
|
||||
this.path = path.join(dirname, path.basename(this.path));
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(File.prototype, 'basename', {
|
||||
get: function() {
|
||||
if (!this.path) throw new Error('No path specified! Can not get basename.');
|
||||
return path.basename(this.path);
|
||||
},
|
||||
set: function(basename) {
|
||||
if (!this.path) throw new Error('No path specified! Can not set basename.');
|
||||
this.path = path.join(path.dirname(this.path), basename);
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(File.prototype, 'extname', {
|
||||
get: function() {
|
||||
if (!this.path) throw new Error('No path specified! Can not get extname.');
|
||||
return path.extname(this.path);
|
||||
},
|
||||
set: function(extname) {
|
||||
if (!this.path) throw new Error('No path specified! Can not set extname.');
|
||||
this.path = replaceExt(this.path, extname);
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(File.prototype, 'path', {
|
||||
get: function() {
|
||||
return this.history[this.history.length - 1];
|
||||
},
|
||||
set: function(path) {
|
||||
if (typeof path !== 'string') throw new Error('path should be string');
|
||||
|
||||
// record history only when path changed
|
||||
if (path && path !== this.path) {
|
||||
this.history.push(path);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = File;
|
||||
7
node_modules/gulp-util/node_modules/vinyl/lib/cloneBuffer.js
generated
vendored
Normal file
7
node_modules/gulp-util/node_modules/vinyl/lib/cloneBuffer.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
var Buffer = require('buffer').Buffer;
|
||||
|
||||
module.exports = function(buf) {
|
||||
var out = new Buffer(buf.length);
|
||||
buf.copy(out);
|
||||
return out;
|
||||
};
|
||||
11
node_modules/gulp-util/node_modules/vinyl/lib/inspectStream.js
generated
vendored
Normal file
11
node_modules/gulp-util/node_modules/vinyl/lib/inspectStream.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
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>';
|
||||
};
|
||||
1
node_modules/gulp-util/node_modules/vinyl/lib/isBuffer.js
generated
vendored
Normal file
1
node_modules/gulp-util/node_modules/vinyl/lib/isBuffer.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('buffer').Buffer.isBuffer;
|
||||
3
node_modules/gulp-util/node_modules/vinyl/lib/isNull.js
generated
vendored
Normal file
3
node_modules/gulp-util/node_modules/vinyl/lib/isNull.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = function(v) {
|
||||
return v === null;
|
||||
};
|
||||
5
node_modules/gulp-util/node_modules/vinyl/lib/isStream.js
generated
vendored
Normal file
5
node_modules/gulp-util/node_modules/vinyl/lib/isStream.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
var Stream = require('stream').Stream;
|
||||
|
||||
module.exports = function(o) {
|
||||
return !!o && o instanceof Stream;
|
||||
};
|
||||
37
node_modules/gulp-util/node_modules/vinyl/package.json
generated
vendored
Normal file
37
node_modules/gulp-util/node_modules/vinyl/package.json
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "vinyl",
|
||||
"description": "A virtual file format",
|
||||
"version": "0.5.3",
|
||||
"homepage": "http://github.com/wearefractal/vinyl",
|
||||
"repository": "git://github.com/wearefractal/vinyl.git",
|
||||
"author": "Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
|
||||
"main": "./index.js",
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"clone": "^1.0.0",
|
||||
"clone-stats": "^0.0.1",
|
||||
"replace-ext": "0.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"buffer-equal": "0.0.1",
|
||||
"event-stream": "^3.1.0",
|
||||
"istanbul": "^0.3.0",
|
||||
"istanbul-coveralls": "^1.0.1",
|
||||
"jshint": "^2.4.1",
|
||||
"lodash.templatesettings": "^3.1.0",
|
||||
"mocha": "^2.0.0",
|
||||
"rimraf": "^2.2.5",
|
||||
"should": "^7.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha && jshint lib",
|
||||
"coveralls": "istanbul cover _mocha && istanbul-coveralls"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.9"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
51
node_modules/gulp-util/package.json
generated
vendored
Normal file
51
node_modules/gulp-util/package.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "gulp-util",
|
||||
"description": "Utility functions for gulp plugins",
|
||||
"version": "3.0.8",
|
||||
"repository": "gulpjs/gulp-util",
|
||||
"author": "Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"array-differ": "^1.0.0",
|
||||
"array-uniq": "^1.0.2",
|
||||
"beeper": "^1.0.0",
|
||||
"chalk": "^1.0.0",
|
||||
"dateformat": "^2.0.0",
|
||||
"fancy-log": "^1.1.0",
|
||||
"gulplog": "^1.0.0",
|
||||
"has-gulplog": "^0.1.0",
|
||||
"lodash._reescape": "^3.0.0",
|
||||
"lodash._reevaluate": "^3.0.0",
|
||||
"lodash._reinterpolate": "^3.0.0",
|
||||
"lodash.template": "^3.0.0",
|
||||
"minimist": "^1.1.0",
|
||||
"multipipe": "^0.1.2",
|
||||
"object-assign": "^3.0.0",
|
||||
"replace-ext": "0.0.1",
|
||||
"through2": "^2.0.0",
|
||||
"vinyl": "^0.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"buffer-equal": "^0.0.1",
|
||||
"coveralls": "^2.11.2",
|
||||
"event-stream": "^3.1.7",
|
||||
"istanbul": "^0.3.5",
|
||||
"istanbul-coveralls": "^1.0.1",
|
||||
"jshint": "^2.5.11",
|
||||
"lodash.templatesettings": "^3.0.0",
|
||||
"mocha": "^2.0.1",
|
||||
"rimraf": "^2.2.8",
|
||||
"should": "^7.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jshint *.js lib/*.js test/*.js && mocha",
|
||||
"coveralls": "istanbul cover _mocha --report lcovonly && istanbul-coveralls"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
Reference in New Issue
Block a user