first commit
This commit is contained in:
21
node_modules/gulp-sort/LICENSE
generated
vendored
Normal file
21
node_modules/gulp-sort/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Gilad Peleg <giladp007@gmail.com> (http://giladpeleg.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.
|
85
node_modules/gulp-sort/README.md
generated
vendored
Normal file
85
node_modules/gulp-sort/README.md
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
# [gulp](https://github.com/wearefractal/gulp)-sort
|
||||
> Sort files in stream by path or any custom sort comparator
|
||||
|
||||
[](https://travis-ci.org/pgilad/gulp-sort)
|
||||
|
||||
## Install
|
||||
|
||||
`$ npm install gulp-sort --save-dev`
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var sort = require('gulp-sort');
|
||||
|
||||
// default sort
|
||||
gulp.src('./src/js/**/*.js')
|
||||
.pipe(sort())
|
||||
.pipe(gulp.dest('./build/js'));
|
||||
|
||||
// pass in a custom comparator function
|
||||
gulp.src('./src/js/**/*.js')
|
||||
.pipe(sort(customComparator))
|
||||
.pipe(gulp.dest('./build/js'));
|
||||
|
||||
// sort descending
|
||||
gulp.src('./src/js/**/*.js')
|
||||
.pipe(sort({
|
||||
asc: false
|
||||
}))
|
||||
.pipe(gulp.dest('./build/js'));
|
||||
|
||||
// sort with a custom comparator
|
||||
gulp.src('./src/js/**/*.js')
|
||||
.pipe(sort({
|
||||
comparator: function(file1, file2) {
|
||||
if (file1.path.indexOf('build') > -1) {
|
||||
return 1;
|
||||
}
|
||||
if (file2.path.indexOf('build') > -1) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('./build/js'));
|
||||
|
||||
// sort with a custom sort function
|
||||
var stable = require('stable');
|
||||
gulp.src('./src/js/**/*.js')
|
||||
.pipe(sort({
|
||||
customSortFn: function(files, comparator) {
|
||||
return stable(files, comparator);
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('./build/js'));
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
`gulp-sort` takes in an optional [comparator](#comparator) function, or dictionary with following params:
|
||||
|
||||
### asc
|
||||
|
||||
Sort ascending. Defaults to true. Specify false to sort descending.
|
||||
|
||||
### comparator
|
||||
|
||||
Comparator function to use. `comparator(file1, file2)`. Defaults to `localeCompare` of file paths.
|
||||
|
||||
### customSortFn
|
||||
|
||||
Use `customSortFn` in order to control the sorting yourself (useful for stable sorts).
|
||||
|
||||
`customSortFn` signature is as follows:
|
||||
|
||||
`customSortFn(<files>, <comparator>)`
|
||||
|
||||
- `files` being the vinyl file objects that were passed in
|
||||
- `comparator` is the default comparator used, or a custom one that was passed as param
|
||||
|
||||
This function is expected to return back the sorted list of files.
|
||||
|
||||
## License
|
||||
|
||||
MIT ©[Gilad Peleg](http://giladpeleg.com)
|
43
node_modules/gulp-sort/index.js
generated
vendored
Normal file
43
node_modules/gulp-sort/index.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
var through = require('through2');
|
||||
|
||||
function defaultComparator(a, b) {
|
||||
return a.path.localeCompare(b.path);
|
||||
}
|
||||
|
||||
module.exports = function gulpSort(params) {
|
||||
var asc = true;
|
||||
var comparator;
|
||||
var files = [];
|
||||
var customSortFn;
|
||||
|
||||
if (typeof params === 'function') {
|
||||
// params is the sort comparator
|
||||
comparator = params;
|
||||
params = {};
|
||||
} else {
|
||||
params = params || {};
|
||||
asc = typeof params.asc !== 'undefined' ? params.asc : asc;
|
||||
comparator = params.comparator || defaultComparator;
|
||||
customSortFn = params.customSortFn;
|
||||
}
|
||||
|
||||
return through.obj(function (file, enc, cb) {
|
||||
files.push(file);
|
||||
cb();
|
||||
}, function (cb) {
|
||||
if (customSortFn) {
|
||||
// expect customSortFn to return the files array
|
||||
files = customSortFn(files, comparator);
|
||||
} else {
|
||||
// sort in-place
|
||||
files.sort(comparator);
|
||||
}
|
||||
if (!asc) {
|
||||
files.reverse();
|
||||
}
|
||||
files.forEach(function (file) {
|
||||
this.push(file);
|
||||
}, this);
|
||||
cb();
|
||||
});
|
||||
};
|
9
node_modules/gulp-sort/node_modules/through2/LICENSE.md
generated
vendored
Normal file
9
node_modules/gulp-sort/node_modules/through2/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# The MIT License (MIT)
|
||||
|
||||
**Copyright (c) Rod Vagg (the "Original Author") and additional contributors**
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
134
node_modules/gulp-sort/node_modules/through2/README.md
generated
vendored
Normal file
134
node_modules/gulp-sort/node_modules/through2/README.md
generated
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
# through2
|
||||
|
||||
[](https://nodei.co/npm/through2/)
|
||||
|
||||
**A tiny wrapper around Node streams.Transform (Streams2/3) to avoid explicit subclassing noise**
|
||||
|
||||
Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.
|
||||
|
||||
Note: As 2.x.x this module starts using **Streams3** instead of Stream2. To continue using a Streams2 version use `npm install through2@0` to fetch the latest version of 0.x.x. More information about Streams2 vs Streams3 and recommendations see the article **[Why I don't use Node's core 'stream' module](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html)**.
|
||||
|
||||
```js
|
||||
fs.createReadStream('ex.txt')
|
||||
.pipe(through2(function (chunk, enc, callback) {
|
||||
for (var i = 0; i < chunk.length; i++)
|
||||
if (chunk[i] == 97)
|
||||
chunk[i] = 122 // swap 'a' for 'z'
|
||||
|
||||
this.push(chunk)
|
||||
|
||||
callback()
|
||||
}))
|
||||
.pipe(fs.createWriteStream('out.txt'))
|
||||
.on('finish', () => doSomethingSpecial())
|
||||
```
|
||||
|
||||
Or object streams:
|
||||
|
||||
```js
|
||||
var all = []
|
||||
|
||||
fs.createReadStream('data.csv')
|
||||
.pipe(csv2())
|
||||
.pipe(through2.obj(function (chunk, enc, callback) {
|
||||
var data = {
|
||||
name : chunk[0]
|
||||
, address : chunk[3]
|
||||
, phone : chunk[10]
|
||||
}
|
||||
this.push(data)
|
||||
|
||||
callback()
|
||||
}))
|
||||
.on('data', (data) => {
|
||||
all.push(data)
|
||||
})
|
||||
.on('end', () => {
|
||||
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 },
|
||||
(chunk, enc, cb) => {
|
||||
cb(null, 'wut?') // note we can use the second argument on the callback
|
||||
// to provide data as an alternative to this.push('wut?')
|
||||
}
|
||||
)
|
||||
.pipe(fs.createWriteStream('/tmp/wut.txt'))
|
||||
```
|
||||
|
||||
### transformFunction
|
||||
|
||||
The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.
|
||||
|
||||
To queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on.
|
||||
|
||||
Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error.
|
||||
|
||||
If you **do not provide a `transformFunction`** then you will get a simple pass-through stream.
|
||||
|
||||
### flushFunction
|
||||
|
||||
The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.
|
||||
|
||||
```js
|
||||
fs.createReadStream('/tmp/important.dat')
|
||||
.pipe(through2(
|
||||
(chunk, enc, cb) => cb(null, chunk), // transform is a noop
|
||||
function (cb) { // flush function
|
||||
this.push('tacking on an extra buffer to the end');
|
||||
cb();
|
||||
}
|
||||
))
|
||||
.pipe(fs.createWriteStream('/tmp/wut.txt'));
|
||||
```
|
||||
|
||||
<b><code>through2.ctor([ options, ] transformFunction[, flushFunction ])</code></b>
|
||||
|
||||
Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.
|
||||
|
||||
```js
|
||||
var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {
|
||||
if (record.temp != null && record.unit == "F") {
|
||||
record.temp = ( ( record.temp - 32 ) * 5 ) / 9
|
||||
record.unit = "C"
|
||||
}
|
||||
this.push(record)
|
||||
callback()
|
||||
})
|
||||
|
||||
// Create instances of FToC like so:
|
||||
var converter = new FToC()
|
||||
// Or:
|
||||
var converter = FToC()
|
||||
// Or specify/override options when you instantiate, if you prefer:
|
||||
var converter = FToC({objectMode: true})
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
- [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams.
|
||||
- [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams.
|
||||
- [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams.
|
||||
- [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies.
|
||||
- the [mississippi stream utility collection](https://github.com/maxogden/mississippi) includes `through2` as well as many more useful stream modules similar to this one
|
||||
|
||||
## License
|
||||
|
||||
**through2** is Copyright (c) Rod Vagg [@rvagg](https://twitter.com/rvagg) and additional contributors and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
|
70
node_modules/gulp-sort/node_modules/through2/package.json
generated
vendored
Normal file
70
node_modules/gulp-sort/node_modules/through2/package.json
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"through2@2.0.5",
|
||||
"D:\\Projects\\siag\\vanillajs-seed"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "through2@2.0.5",
|
||||
"_id": "through2@2.0.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==",
|
||||
"_location": "/gulp-sort/through2",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "through2@2.0.5",
|
||||
"name": "through2",
|
||||
"escapedName": "through2",
|
||||
"rawSpec": "2.0.5",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.5"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/gulp-sort"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
|
||||
"_spec": "2.0.5",
|
||||
"_where": "D:\\Projects\\siag\\vanillajs-seed",
|
||||
"author": {
|
||||
"name": "Rod Vagg",
|
||||
"email": "r@va.gg",
|
||||
"url": "https://github.com/rvagg"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/rvagg/through2/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"readable-stream": "~2.3.6",
|
||||
"xtend": "~4.0.1"
|
||||
},
|
||||
"description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise",
|
||||
"devDependencies": {
|
||||
"bl": "~2.0.1",
|
||||
"faucet": "0.0.1",
|
||||
"nyc": "~13.1.0",
|
||||
"safe-buffer": "~5.1.2",
|
||||
"stream-spigot": "~3.0.6",
|
||||
"tape": "~4.9.1"
|
||||
},
|
||||
"homepage": "https://github.com/rvagg/through2#readme",
|
||||
"keywords": [
|
||||
"stream",
|
||||
"streams2",
|
||||
"through",
|
||||
"transform"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "through2.js",
|
||||
"name": "through2",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/rvagg/through2.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test/test.js | faucet"
|
||||
},
|
||||
"version": "2.0.5"
|
||||
}
|
96
node_modules/gulp-sort/node_modules/through2/through2.js
generated
vendored
Normal file
96
node_modules/gulp-sort/node_modules/through2/through2.js
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
var Transform = require('readable-stream').Transform
|
||||
, inherits = require('util').inherits
|
||||
, xtend = require('xtend')
|
||||
|
||||
function DestroyableTransform(opts) {
|
||||
Transform.call(this, opts)
|
||||
this._destroyed = false
|
||||
}
|
||||
|
||||
inherits(DestroyableTransform, Transform)
|
||||
|
||||
DestroyableTransform.prototype.destroy = function(err) {
|
||||
if (this._destroyed) return
|
||||
this._destroyed = true
|
||||
|
||||
var self = this
|
||||
process.nextTick(function() {
|
||||
if (err)
|
||||
self.emit('error', err)
|
||||
self.emit('close')
|
||||
})
|
||||
}
|
||||
|
||||
// a noop _transform function
|
||||
function noop (chunk, enc, callback) {
|
||||
callback(null, chunk)
|
||||
}
|
||||
|
||||
|
||||
// create a new export function, used by both the main export and
|
||||
// the .ctor export, contains common logic for dealing with arguments
|
||||
function through2 (construct) {
|
||||
return function (options, transform, flush) {
|
||||
if (typeof options == 'function') {
|
||||
flush = transform
|
||||
transform = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
if (typeof transform != 'function')
|
||||
transform = noop
|
||||
|
||||
if (typeof flush != 'function')
|
||||
flush = null
|
||||
|
||||
return construct(options, transform, flush)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// main export, just make me a transform stream!
|
||||
module.exports = through2(function (options, transform, flush) {
|
||||
var t2 = new DestroyableTransform(options)
|
||||
|
||||
t2._transform = transform
|
||||
|
||||
if (flush)
|
||||
t2._flush = flush
|
||||
|
||||
return t2
|
||||
})
|
||||
|
||||
|
||||
// make me a reusable prototype that I can `new`, or implicitly `new`
|
||||
// with a constructor call
|
||||
module.exports.ctor = through2(function (options, transform, flush) {
|
||||
function Through2 (override) {
|
||||
if (!(this instanceof Through2))
|
||||
return new Through2(override)
|
||||
|
||||
this.options = xtend(options, override)
|
||||
|
||||
DestroyableTransform.call(this, this.options)
|
||||
}
|
||||
|
||||
inherits(Through2, DestroyableTransform)
|
||||
|
||||
Through2.prototype._transform = transform
|
||||
|
||||
if (flush)
|
||||
Through2.prototype._flush = flush
|
||||
|
||||
return Through2
|
||||
})
|
||||
|
||||
|
||||
module.exports.obj = through2(function (options, transform, flush) {
|
||||
var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options))
|
||||
|
||||
t2._transform = transform
|
||||
|
||||
if (flush)
|
||||
t2._flush = flush
|
||||
|
||||
return t2
|
||||
})
|
74
node_modules/gulp-sort/package.json
generated
vendored
Normal file
74
node_modules/gulp-sort/package.json
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"gulp-sort@2.0.0",
|
||||
"D:\\Projects\\siag\\vanillajs-seed"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "gulp-sort@2.0.0",
|
||||
"_id": "gulp-sort@2.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-xnYqLx8N4KP8WVohWZ0/rI26Gso=",
|
||||
"_location": "/gulp-sort",
|
||||
"_phantomChildren": {
|
||||
"readable-stream": "2.3.7",
|
||||
"xtend": "4.0.2"
|
||||
},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "gulp-sort@2.0.0",
|
||||
"name": "gulp-sort",
|
||||
"escapedName": "gulp-sort",
|
||||
"rawSpec": "2.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/i18next-scanner"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/gulp-sort/-/gulp-sort-2.0.0.tgz",
|
||||
"_spec": "2.0.0",
|
||||
"_where": "D:\\Projects\\siag\\vanillajs-seed",
|
||||
"author": {
|
||||
"name": "Gilad Peleg",
|
||||
"email": "giladp007@gmail.com",
|
||||
"url": "http://giladpeleg.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/pgilad/gulp-sort/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"through2": "^2.0.1"
|
||||
},
|
||||
"description": "Sort files in stream by path or any custom sort comparator",
|
||||
"devDependencies": {
|
||||
"gulp-util": "^3.0.4",
|
||||
"mocha": "^2.1.0",
|
||||
"stable": "^0.1.5"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/pgilad/gulp-sort#readme",
|
||||
"keywords": [
|
||||
"gulpplugin",
|
||||
"gulp",
|
||||
"sort",
|
||||
"paths",
|
||||
"order",
|
||||
"comparator"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "gulp-sort",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/pgilad/gulp-sort.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha tests/*.js"
|
||||
},
|
||||
"version": "2.0.0"
|
||||
}
|
Reference in New Issue
Block a user