mirror of
https://github.com/bvanroll/yahoo-thing.git
synced 2025-08-28 11:32:49 +00:00
euh
This commit is contained in:
47
index.js
Normal file
47
index.js
Normal file
@@ -0,0 +1,47 @@
|
||||
var exp = require('express');
|
||||
var exphbs = require('express-handlebars');
|
||||
var app = exp();
|
||||
const port = 2020;
|
||||
const bodyparser = require("body-parser")
|
||||
|
||||
|
||||
const {promisify} = require('util')
|
||||
var MongoClient = require('mongodb').MongoClient;
|
||||
var hbs = exphbs.create({
|
||||
defaultLayout: 'main'
|
||||
});
|
||||
|
||||
|
||||
|
||||
app.use(bodyparser.urlencoded({extended: true}))
|
||||
app.use(bodyparser.json())
|
||||
app.engine('handlebars', hbs.engine);
|
||||
app.use('static', exp.static(__dirname+'static'));
|
||||
|
||||
app.set('view engine', 'handlebars');
|
||||
app.listen(port, function(err) {
|
||||
if (err) console.log(err)
|
||||
console.log("server is running at port 2020")
|
||||
})
|
||||
|
||||
app.get('/',(req,res) => {
|
||||
res.render("index")
|
||||
})
|
||||
|
||||
|
||||
app.get('/about', (req, res) => {
|
||||
res.render("about")
|
||||
})
|
||||
|
||||
app.post('/search', (req, res) => {
|
||||
console.log(req.body.title)
|
||||
MongoClient.connect("mongodb://localhost:27017/yahoo",(err, client) => {
|
||||
if (err) throw err
|
||||
var query = {title: new RegExp(req.body.title, 'gmi') }
|
||||
temp = client.db().collection("questions").find(query, {projection: {_id: 0}}).toArray(function(err, data) {
|
||||
res.render('index', {data: data})
|
||||
client.close()
|
||||
})
|
||||
});
|
||||
|
||||
})
|
1
node_modules/.bin/atob
generated
vendored
Symbolic link
1
node_modules/.bin/atob
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../atob/bin/atob.js
|
1
node_modules/.bin/handlebars
generated
vendored
Symbolic link
1
node_modules/.bin/handlebars
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../handlebars/bin/handlebars
|
1
node_modules/.bin/is-ci
generated
vendored
Symbolic link
1
node_modules/.bin/is-ci
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../is-ci/bin.js
|
1
node_modules/.bin/mime
generated
vendored
Symbolic link
1
node_modules/.bin/mime
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../mime/cli.js
|
1
node_modules/.bin/nodemon
generated
vendored
Symbolic link
1
node_modules/.bin/nodemon
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../nodemon/bin/nodemon.js
|
1
node_modules/.bin/nodetouch
generated
vendored
Symbolic link
1
node_modules/.bin/nodetouch
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../touch/bin/nodetouch.js
|
1
node_modules/.bin/nopt
generated
vendored
Symbolic link
1
node_modules/.bin/nopt
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../nopt/bin/nopt.js
|
1
node_modules/.bin/rc
generated
vendored
Symbolic link
1
node_modules/.bin/rc
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../rc/cli.js
|
1
node_modules/.bin/semver
generated
vendored
Symbolic link
1
node_modules/.bin/semver
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../semver/bin/semver
|
1
node_modules/.bin/uglifyjs
generated
vendored
Symbolic link
1
node_modules/.bin/uglifyjs
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../uglify-js/bin/uglifyjs
|
1
node_modules/.bin/which
generated
vendored
Symbolic link
1
node_modules/.bin/which
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../which/bin/which
|
46
node_modules/abbrev/LICENSE
generated
vendored
Normal file
46
node_modules/abbrev/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
This software is dual-licensed under the ISC and MIT licenses.
|
||||
You may use this software under EITHER of the following licenses.
|
||||
|
||||
----------
|
||||
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
----------
|
||||
|
||||
Copyright Isaac Z. Schlueter and 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.
|
23
node_modules/abbrev/README.md
generated
vendored
Normal file
23
node_modules/abbrev/README.md
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# abbrev-js
|
||||
|
||||
Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
|
||||
|
||||
Usage:
|
||||
|
||||
var abbrev = require("abbrev");
|
||||
abbrev("foo", "fool", "folding", "flop");
|
||||
|
||||
// returns:
|
||||
{ fl: 'flop'
|
||||
, flo: 'flop'
|
||||
, flop: 'flop'
|
||||
, fol: 'folding'
|
||||
, fold: 'folding'
|
||||
, foldi: 'folding'
|
||||
, foldin: 'folding'
|
||||
, folding: 'folding'
|
||||
, foo: 'foo'
|
||||
, fool: 'fool'
|
||||
}
|
||||
|
||||
This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.
|
61
node_modules/abbrev/abbrev.js
generated
vendored
Normal file
61
node_modules/abbrev/abbrev.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
module.exports = exports = abbrev.abbrev = abbrev
|
||||
|
||||
abbrev.monkeyPatch = monkeyPatch
|
||||
|
||||
function monkeyPatch () {
|
||||
Object.defineProperty(Array.prototype, 'abbrev', {
|
||||
value: function () { return abbrev(this) },
|
||||
enumerable: false, configurable: true, writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(Object.prototype, 'abbrev', {
|
||||
value: function () { return abbrev(Object.keys(this)) },
|
||||
enumerable: false, configurable: true, writable: true
|
||||
})
|
||||
}
|
||||
|
||||
function abbrev (list) {
|
||||
if (arguments.length !== 1 || !Array.isArray(list)) {
|
||||
list = Array.prototype.slice.call(arguments, 0)
|
||||
}
|
||||
for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
|
||||
args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
|
||||
}
|
||||
|
||||
// sort them lexicographically, so that they're next to their nearest kin
|
||||
args = args.sort(lexSort)
|
||||
|
||||
// walk through each, seeing how much it has in common with the next and previous
|
||||
var abbrevs = {}
|
||||
, prev = ""
|
||||
for (var i = 0, l = args.length ; i < l ; i ++) {
|
||||
var current = args[i]
|
||||
, next = args[i + 1] || ""
|
||||
, nextMatches = true
|
||||
, prevMatches = true
|
||||
if (current === next) continue
|
||||
for (var j = 0, cl = current.length ; j < cl ; j ++) {
|
||||
var curChar = current.charAt(j)
|
||||
nextMatches = nextMatches && curChar === next.charAt(j)
|
||||
prevMatches = prevMatches && curChar === prev.charAt(j)
|
||||
if (!nextMatches && !prevMatches) {
|
||||
j ++
|
||||
break
|
||||
}
|
||||
}
|
||||
prev = current
|
||||
if (j === cl) {
|
||||
abbrevs[current] = current
|
||||
continue
|
||||
}
|
||||
for (var a = current.substr(0, j) ; j <= cl ; j ++) {
|
||||
abbrevs[a] = current
|
||||
a += current.charAt(j)
|
||||
}
|
||||
}
|
||||
return abbrevs
|
||||
}
|
||||
|
||||
function lexSort (a, b) {
|
||||
return a === b ? 0 : a > b ? 1 : -1
|
||||
}
|
89
node_modules/abbrev/package.json
generated
vendored
Normal file
89
node_modules/abbrev/package.json
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"abbrev@1",
|
||||
"/home/beppe/Github/yahooApi/node_modules/nopt"
|
||||
]
|
||||
],
|
||||
"_from": "abbrev@>=1.0.0 <2.0.0",
|
||||
"_id": "abbrev@1.1.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/abbrev",
|
||||
"_nodeVersion": "8.5.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/abbrev-1.1.1.tgz_1506566833068_0.05750026390887797"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "i@izs.me",
|
||||
"name": "isaacs"
|
||||
},
|
||||
"_npmVersion": "5.4.2",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "abbrev",
|
||||
"raw": "abbrev@1",
|
||||
"rawSpec": "1",
|
||||
"scope": null,
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/nopt"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||
"_shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "abbrev@1",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/nopt",
|
||||
"author": {
|
||||
"email": "i@izs.me",
|
||||
"name": "Isaac Z. Schlueter"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/abbrev-js/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Like ruby's abbrev module, but in js",
|
||||
"devDependencies": {
|
||||
"tap": "^10.1"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
|
||||
"shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8",
|
||||
"tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz"
|
||||
},
|
||||
"files": [
|
||||
"abbrev.js"
|
||||
],
|
||||
"gitHead": "a9ee72ebc8fe3975f1b0c7aeb3a8f2a806a432eb",
|
||||
"homepage": "https://github.com/isaacs/abbrev-js#readme",
|
||||
"license": "ISC",
|
||||
"main": "abbrev.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "gabra",
|
||||
"email": "jerry+1@npmjs.com"
|
||||
},
|
||||
{
|
||||
"name": "isaacs",
|
||||
"email": "i@izs.me"
|
||||
}
|
||||
],
|
||||
"name": "abbrev",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "git push origin --all; git push origin --tags",
|
||||
"postversion": "npm publish",
|
||||
"preversion": "npm test",
|
||||
"test": "tap test.js --100"
|
||||
},
|
||||
"version": "1.1.1"
|
||||
}
|
224
node_modules/accepts/HISTORY.md
generated
vendored
Normal file
224
node_modules/accepts/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,224 @@
|
||||
1.3.5 / 2018-02-28
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.18
|
||||
- deps: mime-db@~1.33.0
|
||||
|
||||
1.3.4 / 2017-08-22
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.16
|
||||
- deps: mime-db@~1.29.0
|
||||
|
||||
1.3.3 / 2016-05-02
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.11
|
||||
- deps: mime-db@~1.23.0
|
||||
* deps: negotiator@0.6.1
|
||||
- perf: improve `Accept` parsing speed
|
||||
- perf: improve `Accept-Charset` parsing speed
|
||||
- perf: improve `Accept-Encoding` parsing speed
|
||||
- perf: improve `Accept-Language` parsing speed
|
||||
|
||||
1.3.2 / 2016-03-08
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.10
|
||||
- Fix extension of `application/dash+xml`
|
||||
- Update primary extension for `audio/mp4`
|
||||
- deps: mime-db@~1.22.0
|
||||
|
||||
1.3.1 / 2016-01-19
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.9
|
||||
- deps: mime-db@~1.21.0
|
||||
|
||||
1.3.0 / 2015-09-29
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.7
|
||||
- deps: mime-db@~1.19.0
|
||||
* deps: negotiator@0.6.0
|
||||
- Fix including type extensions in parameters in `Accept` parsing
|
||||
- Fix parsing `Accept` parameters with quoted equals
|
||||
- Fix parsing `Accept` parameters with quoted semicolons
|
||||
- Lazy-load modules from main entry point
|
||||
- perf: delay type concatenation until needed
|
||||
- perf: enable strict mode
|
||||
- perf: hoist regular expressions
|
||||
- perf: remove closures getting spec properties
|
||||
- perf: remove a closure from media type parsing
|
||||
- perf: remove property delete from media type parsing
|
||||
|
||||
1.2.13 / 2015-09-06
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.6
|
||||
- deps: mime-db@~1.18.0
|
||||
|
||||
1.2.12 / 2015-07-30
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.4
|
||||
- deps: mime-db@~1.16.0
|
||||
|
||||
1.2.11 / 2015-07-16
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.3
|
||||
- deps: mime-db@~1.15.0
|
||||
|
||||
1.2.10 / 2015-07-01
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.2
|
||||
- deps: mime-db@~1.14.0
|
||||
|
||||
1.2.9 / 2015-06-08
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.1
|
||||
- perf: fix deopt during mapping
|
||||
|
||||
1.2.8 / 2015-06-07
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.0
|
||||
- deps: mime-db@~1.13.0
|
||||
* perf: avoid argument reassignment & argument slice
|
||||
* perf: avoid negotiator recursive construction
|
||||
* perf: enable strict mode
|
||||
* perf: remove unnecessary bitwise operator
|
||||
|
||||
1.2.7 / 2015-05-10
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.5.3
|
||||
- Fix media type parameter matching to be case-insensitive
|
||||
|
||||
1.2.6 / 2015-05-07
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.11
|
||||
- deps: mime-db@~1.9.1
|
||||
* deps: negotiator@0.5.2
|
||||
- Fix comparing media types with quoted values
|
||||
- Fix splitting media types with quoted commas
|
||||
|
||||
1.2.5 / 2015-03-13
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.10
|
||||
- deps: mime-db@~1.8.0
|
||||
|
||||
1.2.4 / 2015-02-14
|
||||
==================
|
||||
|
||||
* Support Node.js 0.6
|
||||
* deps: mime-types@~2.0.9
|
||||
- deps: mime-db@~1.7.0
|
||||
* deps: negotiator@0.5.1
|
||||
- Fix preference sorting to be stable for long acceptable lists
|
||||
|
||||
1.2.3 / 2015-01-31
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.8
|
||||
- deps: mime-db@~1.6.0
|
||||
|
||||
1.2.2 / 2014-12-30
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.7
|
||||
- deps: mime-db@~1.5.0
|
||||
|
||||
1.2.1 / 2014-12-30
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.5
|
||||
- deps: mime-db@~1.3.1
|
||||
|
||||
1.2.0 / 2014-12-19
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.5.0
|
||||
- Fix list return order when large accepted list
|
||||
- Fix missing identity encoding when q=0 exists
|
||||
- Remove dynamic building of Negotiator class
|
||||
|
||||
1.1.4 / 2014-12-10
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.4
|
||||
- deps: mime-db@~1.3.0
|
||||
|
||||
1.1.3 / 2014-11-09
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.3
|
||||
- deps: mime-db@~1.2.0
|
||||
|
||||
1.1.2 / 2014-10-14
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.4.9
|
||||
- Fix error when media type has invalid parameter
|
||||
|
||||
1.1.1 / 2014-09-28
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.2
|
||||
- deps: mime-db@~1.1.0
|
||||
* deps: negotiator@0.4.8
|
||||
- Fix all negotiations to be case-insensitive
|
||||
- Stable sort preferences of same quality according to client order
|
||||
|
||||
1.1.0 / 2014-09-02
|
||||
==================
|
||||
|
||||
* update `mime-types`
|
||||
|
||||
1.0.7 / 2014-07-04
|
||||
==================
|
||||
|
||||
* Fix wrong type returned from `type` when match after unknown extension
|
||||
|
||||
1.0.6 / 2014-06-24
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.4.7
|
||||
|
||||
1.0.5 / 2014-06-20
|
||||
==================
|
||||
|
||||
* fix crash when unknown extension given
|
||||
|
||||
1.0.4 / 2014-06-19
|
||||
==================
|
||||
|
||||
* use `mime-types`
|
||||
|
||||
1.0.3 / 2014-06-11
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.4.6
|
||||
- Order by specificity when quality is the same
|
||||
|
||||
1.0.2 / 2014-05-29
|
||||
==================
|
||||
|
||||
* Fix interpretation when header not in request
|
||||
* deps: pin negotiator@0.4.5
|
||||
|
||||
1.0.1 / 2014-01-18
|
||||
==================
|
||||
|
||||
* Identity encoding isn't always acceptable
|
||||
* deps: negotiator@~0.4.0
|
||||
|
||||
1.0.0 / 2013-12-27
|
||||
==================
|
||||
|
||||
* Genesis
|
23
node_modules/accepts/LICENSE
generated
vendored
Normal file
23
node_modules/accepts/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.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.
|
143
node_modules/accepts/README.md
generated
vendored
Normal file
143
node_modules/accepts/README.md
generated
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
# accepts
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Node.js Version][node-version-image]][node-version-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator).
|
||||
Extracted from [koa](https://www.npmjs.com/package/koa) for general use.
|
||||
|
||||
In addition to negotiator, it allows:
|
||||
|
||||
- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])`
|
||||
as well as `('text/html', 'application/json')`.
|
||||
- Allows type shorthands such as `json`.
|
||||
- Returns `false` when no types match
|
||||
- Treats non-existent headers as `*`
|
||||
|
||||
## Installation
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```sh
|
||||
$ npm install accepts
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
<!-- eslint-disable no-unused-vars -->
|
||||
|
||||
```js
|
||||
var accepts = require('accepts')
|
||||
```
|
||||
|
||||
### accepts(req)
|
||||
|
||||
Create a new `Accepts` object for the given `req`.
|
||||
|
||||
#### .charset(charsets)
|
||||
|
||||
Return the first accepted charset. If nothing in `charsets` is accepted,
|
||||
then `false` is returned.
|
||||
|
||||
#### .charsets()
|
||||
|
||||
Return the charsets that the request accepts, in the order of the client's
|
||||
preference (most preferred first).
|
||||
|
||||
#### .encoding(encodings)
|
||||
|
||||
Return the first accepted encoding. If nothing in `encodings` is accepted,
|
||||
then `false` is returned.
|
||||
|
||||
#### .encodings()
|
||||
|
||||
Return the encodings that the request accepts, in the order of the client's
|
||||
preference (most preferred first).
|
||||
|
||||
#### .language(languages)
|
||||
|
||||
Return the first accepted language. If nothing in `languages` is accepted,
|
||||
then `false` is returned.
|
||||
|
||||
#### .languages()
|
||||
|
||||
Return the languages that the request accepts, in the order of the client's
|
||||
preference (most preferred first).
|
||||
|
||||
#### .type(types)
|
||||
|
||||
Return the first accepted type (and it is returned as the same text as what
|
||||
appears in the `types` array). If nothing in `types` is accepted, then `false`
|
||||
is returned.
|
||||
|
||||
The `types` array can contain full MIME types or file extensions. Any value
|
||||
that is not a full MIME types is passed to `require('mime-types').lookup`.
|
||||
|
||||
#### .types()
|
||||
|
||||
Return the types that the request accepts, in the order of the client's
|
||||
preference (most preferred first).
|
||||
|
||||
## Examples
|
||||
|
||||
### Simple type negotiation
|
||||
|
||||
This simple example shows how to use `accepts` to return a different typed
|
||||
respond body based on what the client wants to accept. The server lists it's
|
||||
preferences in order and will get back the best match between the client and
|
||||
server.
|
||||
|
||||
```js
|
||||
var accepts = require('accepts')
|
||||
var http = require('http')
|
||||
|
||||
function app (req, res) {
|
||||
var accept = accepts(req)
|
||||
|
||||
// the order of this list is significant; should be server preferred order
|
||||
switch (accept.type(['json', 'html'])) {
|
||||
case 'json':
|
||||
res.setHeader('Content-Type', 'application/json')
|
||||
res.write('{"hello":"world!"}')
|
||||
break
|
||||
case 'html':
|
||||
res.setHeader('Content-Type', 'text/html')
|
||||
res.write('<b>hello, world!</b>')
|
||||
break
|
||||
default:
|
||||
// the fallback is text/plain, so no need to specify it above
|
||||
res.setHeader('Content-Type', 'text/plain')
|
||||
res.write('hello, world!')
|
||||
break
|
||||
}
|
||||
|
||||
res.end()
|
||||
}
|
||||
|
||||
http.createServer(app).listen(3000)
|
||||
```
|
||||
|
||||
You can test this out with the cURL program:
|
||||
```sh
|
||||
curl -I -H'Accept: text/html' http://localhost:3000/
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/accepts.svg
|
||||
[npm-url]: https://npmjs.org/package/accepts
|
||||
[node-version-image]: https://img.shields.io/node/v/accepts.svg
|
||||
[node-version-url]: https://nodejs.org/en/download/
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/accepts/master.svg
|
||||
[travis-url]: https://travis-ci.org/jshttp/accepts
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/accepts/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/accepts
|
||||
[downloads-image]: https://img.shields.io/npm/dm/accepts.svg
|
||||
[downloads-url]: https://npmjs.org/package/accepts
|
238
node_modules/accepts/index.js
generated
vendored
Normal file
238
node_modules/accepts/index.js
generated
vendored
Normal file
@@ -0,0 +1,238 @@
|
||||
/*!
|
||||
* accepts
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var Negotiator = require('negotiator')
|
||||
var mime = require('mime-types')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = Accepts
|
||||
|
||||
/**
|
||||
* Create a new Accepts object for the given req.
|
||||
*
|
||||
* @param {object} req
|
||||
* @public
|
||||
*/
|
||||
|
||||
function Accepts (req) {
|
||||
if (!(this instanceof Accepts)) {
|
||||
return new Accepts(req)
|
||||
}
|
||||
|
||||
this.headers = req.headers
|
||||
this.negotiator = new Negotiator(req)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given `type(s)` is acceptable, returning
|
||||
* the best match when true, otherwise `undefined`, in which
|
||||
* case you should respond with 406 "Not Acceptable".
|
||||
*
|
||||
* The `type` value may be a single mime type string
|
||||
* such as "application/json", the extension name
|
||||
* such as "json" or an array `["json", "html", "text/plain"]`. When a list
|
||||
* or array is given the _best_ match, if any is returned.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* // Accept: text/html
|
||||
* this.types('html');
|
||||
* // => "html"
|
||||
*
|
||||
* // Accept: text/*, application/json
|
||||
* this.types('html');
|
||||
* // => "html"
|
||||
* this.types('text/html');
|
||||
* // => "text/html"
|
||||
* this.types('json', 'text');
|
||||
* // => "json"
|
||||
* this.types('application/json');
|
||||
* // => "application/json"
|
||||
*
|
||||
* // Accept: text/*, application/json
|
||||
* this.types('image/png');
|
||||
* this.types('png');
|
||||
* // => undefined
|
||||
*
|
||||
* // Accept: text/*;q=.5, application/json
|
||||
* this.types(['html', 'json']);
|
||||
* this.types('html', 'json');
|
||||
* // => "json"
|
||||
*
|
||||
* @param {String|Array} types...
|
||||
* @return {String|Array|Boolean}
|
||||
* @public
|
||||
*/
|
||||
|
||||
Accepts.prototype.type =
|
||||
Accepts.prototype.types = function (types_) {
|
||||
var types = types_
|
||||
|
||||
// support flattened arguments
|
||||
if (types && !Array.isArray(types)) {
|
||||
types = new Array(arguments.length)
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
types[i] = arguments[i]
|
||||
}
|
||||
}
|
||||
|
||||
// no types, return all requested types
|
||||
if (!types || types.length === 0) {
|
||||
return this.negotiator.mediaTypes()
|
||||
}
|
||||
|
||||
// no accept header, return first given type
|
||||
if (!this.headers.accept) {
|
||||
return types[0]
|
||||
}
|
||||
|
||||
var mimes = types.map(extToMime)
|
||||
var accepts = this.negotiator.mediaTypes(mimes.filter(validMime))
|
||||
var first = accepts[0]
|
||||
|
||||
return first
|
||||
? types[mimes.indexOf(first)]
|
||||
: false
|
||||
}
|
||||
|
||||
/**
|
||||
* Return accepted encodings or best fit based on `encodings`.
|
||||
*
|
||||
* Given `Accept-Encoding: gzip, deflate`
|
||||
* an array sorted by quality is returned:
|
||||
*
|
||||
* ['gzip', 'deflate']
|
||||
*
|
||||
* @param {String|Array} encodings...
|
||||
* @return {String|Array}
|
||||
* @public
|
||||
*/
|
||||
|
||||
Accepts.prototype.encoding =
|
||||
Accepts.prototype.encodings = function (encodings_) {
|
||||
var encodings = encodings_
|
||||
|
||||
// support flattened arguments
|
||||
if (encodings && !Array.isArray(encodings)) {
|
||||
encodings = new Array(arguments.length)
|
||||
for (var i = 0; i < encodings.length; i++) {
|
||||
encodings[i] = arguments[i]
|
||||
}
|
||||
}
|
||||
|
||||
// no encodings, return all requested encodings
|
||||
if (!encodings || encodings.length === 0) {
|
||||
return this.negotiator.encodings()
|
||||
}
|
||||
|
||||
return this.negotiator.encodings(encodings)[0] || false
|
||||
}
|
||||
|
||||
/**
|
||||
* Return accepted charsets or best fit based on `charsets`.
|
||||
*
|
||||
* Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
|
||||
* an array sorted by quality is returned:
|
||||
*
|
||||
* ['utf-8', 'utf-7', 'iso-8859-1']
|
||||
*
|
||||
* @param {String|Array} charsets...
|
||||
* @return {String|Array}
|
||||
* @public
|
||||
*/
|
||||
|
||||
Accepts.prototype.charset =
|
||||
Accepts.prototype.charsets = function (charsets_) {
|
||||
var charsets = charsets_
|
||||
|
||||
// support flattened arguments
|
||||
if (charsets && !Array.isArray(charsets)) {
|
||||
charsets = new Array(arguments.length)
|
||||
for (var i = 0; i < charsets.length; i++) {
|
||||
charsets[i] = arguments[i]
|
||||
}
|
||||
}
|
||||
|
||||
// no charsets, return all requested charsets
|
||||
if (!charsets || charsets.length === 0) {
|
||||
return this.negotiator.charsets()
|
||||
}
|
||||
|
||||
return this.negotiator.charsets(charsets)[0] || false
|
||||
}
|
||||
|
||||
/**
|
||||
* Return accepted languages or best fit based on `langs`.
|
||||
*
|
||||
* Given `Accept-Language: en;q=0.8, es, pt`
|
||||
* an array sorted by quality is returned:
|
||||
*
|
||||
* ['es', 'pt', 'en']
|
||||
*
|
||||
* @param {String|Array} langs...
|
||||
* @return {Array|String}
|
||||
* @public
|
||||
*/
|
||||
|
||||
Accepts.prototype.lang =
|
||||
Accepts.prototype.langs =
|
||||
Accepts.prototype.language =
|
||||
Accepts.prototype.languages = function (languages_) {
|
||||
var languages = languages_
|
||||
|
||||
// support flattened arguments
|
||||
if (languages && !Array.isArray(languages)) {
|
||||
languages = new Array(arguments.length)
|
||||
for (var i = 0; i < languages.length; i++) {
|
||||
languages[i] = arguments[i]
|
||||
}
|
||||
}
|
||||
|
||||
// no languages, return all requested languages
|
||||
if (!languages || languages.length === 0) {
|
||||
return this.negotiator.languages()
|
||||
}
|
||||
|
||||
return this.negotiator.languages(languages)[0] || false
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert extnames to mime.
|
||||
*
|
||||
* @param {String} type
|
||||
* @return {String}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function extToMime (type) {
|
||||
return type.indexOf('/') === -1
|
||||
? mime.lookup(type)
|
||||
: type
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if mime is valid.
|
||||
*
|
||||
* @param {String} type
|
||||
* @return {String}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function validMime (type) {
|
||||
return typeof type === 'string'
|
||||
}
|
114
node_modules/accepts/package.json
generated
vendored
Normal file
114
node_modules/accepts/package.json
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"accepts@~1.3.5",
|
||||
"/home/beppe/Github/yahooApi/node_modules/express"
|
||||
]
|
||||
],
|
||||
"_from": "accepts@>=1.3.5 <1.4.0",
|
||||
"_id": "accepts@1.3.5",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/accepts",
|
||||
"_nodeVersion": "6.11.1",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/accepts_1.3.5_1519869527663_0.6663620712347182"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "doug@somethingdoug.com",
|
||||
"name": "dougwilson"
|
||||
},
|
||||
"_npmVersion": "3.10.10",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "accepts",
|
||||
"raw": "accepts@~1.3.5",
|
||||
"rawSpec": "~1.3.5",
|
||||
"scope": null,
|
||||
"spec": ">=1.3.5 <1.4.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/express"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
|
||||
"_shasum": "eb777df6011723a3b14e8a72c0805c8e86746bd2",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "accepts@~1.3.5",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/express",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/accepts/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Ong",
|
||||
"email": "me@jongleberry.com",
|
||||
"url": "http://jongleberry.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"mime-types": "~2.1.18",
|
||||
"negotiator": "0.6.1"
|
||||
},
|
||||
"description": "Higher-level content negotiation",
|
||||
"devDependencies": {
|
||||
"eslint": "4.18.1",
|
||||
"eslint-config-standard": "11.0.0",
|
||||
"eslint-plugin-import": "2.9.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.6",
|
||||
"eslint-plugin-node": "6.0.1",
|
||||
"eslint-plugin-promise": "3.6.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "~1.21.5"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"fileCount": 5,
|
||||
"shasum": "eb777df6011723a3b14e8a72c0805c8e86746bd2",
|
||||
"tarball": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
|
||||
"unpackedSize": 16555
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"files": [
|
||||
"HISTORY.md",
|
||||
"LICENSE",
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "c38d0e968cdc1526f7cc7a718977ee76655c84f5",
|
||||
"homepage": "https://github.com/jshttp/accepts#readme",
|
||||
"keywords": [
|
||||
"accept",
|
||||
"accepts",
|
||||
"content",
|
||||
"negotiation"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "dougwilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
}
|
||||
],
|
||||
"name": "accepts",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jshttp/accepts.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --check-leaks --bail test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
|
||||
},
|
||||
"version": "1.3.5"
|
||||
}
|
36
node_modules/ansi-align/CHANGELOG.md
generated
vendored
Normal file
36
node_modules/ansi-align/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# [2.0.0](https://github.com/nexdrew/ansi-align/compare/v1.1.0...v2.0.0) (2017-05-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ES2015ify, dropping support for Node <4 ([#30](https://github.com/nexdrew/ansi-align/issues/30)) ([7b43f48](https://github.com/nexdrew/ansi-align/commit/7b43f48))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Node 0.10 or 0.12 no longer supported, please update to Node 4+ or use ansi-align@1.1.0
|
||||
|
||||
|
||||
|
||||
<a name="1.1.0"></a>
|
||||
# [1.1.0](https://github.com/nexdrew/ansi-align/compare/v1.0.0...v1.1.0) (2016-06-06)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support left-alignment as no-op ([#3](https://github.com/nexdrew/ansi-align/issues/3)) ([e581db6](https://github.com/nexdrew/ansi-align/commit/e581db6))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# 1.0.0 (2016-04-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* initial commit ([1914d90](https://github.com/nexdrew/ansi-align/commit/1914d90))
|
13
node_modules/ansi-align/LICENSE
generated
vendored
Normal file
13
node_modules/ansi-align/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright (c) 2016, Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose
|
||||
with or without fee is hereby granted, provided that the above copyright notice
|
||||
and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
79
node_modules/ansi-align/README.md
generated
vendored
Normal file
79
node_modules/ansi-align/README.md
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
# ansi-align
|
||||
|
||||
> align-text with ANSI support for CLIs
|
||||
|
||||
[](https://travis-ci.org/nexdrew/ansi-align)
|
||||
[](https://coveralls.io/github/nexdrew/ansi-align?branch=master)
|
||||
[](https://github.com/conventional-changelog/standard-version)
|
||||
|
||||
Easily center- or right- align a block of text, carefully ignoring ANSI escape codes.
|
||||
|
||||
E.g. turn this:
|
||||
|
||||
<img width="281" alt="ansi text block no alignment :(" src="https://cloud.githubusercontent.com/assets/1929625/14937509/7c3076dc-0ed7-11e6-8c16-4f6a4ccc8346.png">
|
||||
|
||||
Into this:
|
||||
|
||||
<img width="278" alt="ansi text block center aligned!" src="https://cloud.githubusercontent.com/assets/1929625/14937510/7c3ca0b0-0ed7-11e6-8f0a-541ca39b6e0a.png">
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install --save ansi-align
|
||||
```
|
||||
|
||||
```js
|
||||
var ansiAlign = require('ansi-align')
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `ansiAlign(text, [opts])`
|
||||
|
||||
Align the given text per the line with the greatest [`string-width`](https://github.com/sindresorhus/string-width), returning a new string (or array).
|
||||
|
||||
#### Arguments
|
||||
|
||||
- `text`: required, string or array
|
||||
|
||||
The text to align. If a string is given, it will be split using either the `opts.split` value or `'\n'` by default. If an array is given, a different array of modified strings will be returned.
|
||||
|
||||
- `opts`: optional, object
|
||||
|
||||
Options to change behavior, see below.
|
||||
|
||||
#### Options
|
||||
|
||||
- `opts.align`: string, default `'center'`
|
||||
|
||||
The alignment mode. Use `'center'` for center-alignment, `'right'` for right-alignment, or `'left'` for left-alignment. Note that the given `text` is assumed to be left-aligned already, so specifying `align: 'left'` just returns the `text` as is (no-op).
|
||||
|
||||
- `opts.split`: string or RegExp, default `'\n'`
|
||||
|
||||
The separator to use when splitting the text. Only used if text is given as a string.
|
||||
|
||||
- `opts.pad`: string, default `' '`
|
||||
|
||||
The value used to left-pad (prepend to) lines of lesser width. Will be repeated as necessary to adjust alignment to the line with the greatest width.
|
||||
|
||||
### `ansiAlign.center(text)`
|
||||
|
||||
Alias for `ansiAlign(text, { align: 'center' })`.
|
||||
|
||||
### `ansiAlign.right(text)`
|
||||
|
||||
Alias for `ansiAlign(text, { align: 'right' })`.
|
||||
|
||||
### `ansiAlign.left(text)`
|
||||
|
||||
Alias for `ansiAlign(text, { align: 'left' })`, which is a no-op.
|
||||
|
||||
## Similar Packages
|
||||
|
||||
- [`center-align`](https://github.com/jonschlinkert/center-align): Very close to this package, except it doesn't support ANSI codes.
|
||||
- [`left-pad`](https://github.com/camwest/left-pad): Great for left-padding but does not support center alignment or ANSI codes.
|
||||
- Pretty much anything by the [chalk](https://github.com/chalk) team
|
||||
|
||||
## License
|
||||
|
||||
ISC © Contributors
|
61
node_modules/ansi-align/index.js
generated
vendored
Normal file
61
node_modules/ansi-align/index.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
'use strict'
|
||||
|
||||
const stringWidth = require('string-width')
|
||||
|
||||
function ansiAlign (text, opts) {
|
||||
if (!text) return text
|
||||
|
||||
opts = opts || {}
|
||||
const align = opts.align || 'center'
|
||||
|
||||
// short-circuit `align: 'left'` as no-op
|
||||
if (align === 'left') return text
|
||||
|
||||
const split = opts.split || '\n'
|
||||
const pad = opts.pad || ' '
|
||||
const widthDiffFn = align !== 'right' ? halfDiff : fullDiff
|
||||
|
||||
let returnString = false
|
||||
if (!Array.isArray(text)) {
|
||||
returnString = true
|
||||
text = String(text).split(split)
|
||||
}
|
||||
|
||||
let width
|
||||
let maxWidth = 0
|
||||
text = text.map(function (str) {
|
||||
str = String(str)
|
||||
width = stringWidth(str)
|
||||
maxWidth = Math.max(width, maxWidth)
|
||||
return {
|
||||
str,
|
||||
width
|
||||
}
|
||||
}).map(function (obj) {
|
||||
return new Array(widthDiffFn(maxWidth, obj.width) + 1).join(pad) + obj.str
|
||||
})
|
||||
|
||||
return returnString ? text.join(split) : text
|
||||
}
|
||||
|
||||
ansiAlign.left = function left (text) {
|
||||
return ansiAlign(text, { align: 'left' })
|
||||
}
|
||||
|
||||
ansiAlign.center = function center (text) {
|
||||
return ansiAlign(text, { align: 'center' })
|
||||
}
|
||||
|
||||
ansiAlign.right = function right (text) {
|
||||
return ansiAlign(text, { align: 'right' })
|
||||
}
|
||||
|
||||
module.exports = ansiAlign
|
||||
|
||||
function halfDiff (maxWidth, curWidth) {
|
||||
return Math.floor((maxWidth - curWidth) / 2)
|
||||
}
|
||||
|
||||
function fullDiff (maxWidth, curWidth) {
|
||||
return maxWidth - curWidth
|
||||
}
|
97
node_modules/ansi-align/package.json
generated
vendored
Normal file
97
node_modules/ansi-align/package.json
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"ansi-align@^2.0.0",
|
||||
"/home/beppe/Github/yahooApi/node_modules/boxen"
|
||||
]
|
||||
],
|
||||
"_from": "ansi-align@>=2.0.0 <3.0.0",
|
||||
"_id": "ansi-align@2.0.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/ansi-align",
|
||||
"_nodeVersion": "7.9.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-18-east.internal.npmjs.com",
|
||||
"tmp": "tmp/ansi-align-2.0.0.tgz_1493673296356_0.4257998722605407"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "andrew@npmjs.com",
|
||||
"name": "nexdrew"
|
||||
},
|
||||
"_npmVersion": "4.2.0",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "ansi-align",
|
||||
"raw": "ansi-align@^2.0.0",
|
||||
"rawSpec": "^2.0.0",
|
||||
"scope": null,
|
||||
"spec": ">=2.0.0 <3.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/boxen"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz",
|
||||
"_shasum": "c36aeccba563b89ceb556f3690f0b1d9e3547f7f",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "ansi-align@^2.0.0",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/boxen",
|
||||
"author": {
|
||||
"name": "nexdrew"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/nexdrew/ansi-align/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"string-width": "^2.0.0"
|
||||
},
|
||||
"description": "align-text with ANSI support for CLIs",
|
||||
"devDependencies": {
|
||||
"ava": "^0.19.1",
|
||||
"chalk": "^1.1.3",
|
||||
"coveralls": "^2.13.1",
|
||||
"nyc": "^10.3.0",
|
||||
"standard": "^10.0.2",
|
||||
"standard-version": "^4.0.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "c36aeccba563b89ceb556f3690f0b1d9e3547f7f",
|
||||
"tarball": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "b27d6251ee7b22c7350e4c39219283e3e0fa735e",
|
||||
"homepage": "https://github.com/nexdrew/ansi-align#readme",
|
||||
"keywords": [
|
||||
"align",
|
||||
"ansi",
|
||||
"center",
|
||||
"cli",
|
||||
"pad"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "nexdrew",
|
||||
"email": "andrew@npmjs.com"
|
||||
}
|
||||
],
|
||||
"name": "ansi-align",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/nexdrew/ansi-align.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||
"pretest": "standard",
|
||||
"release": "standard-version",
|
||||
"test": "nyc ava"
|
||||
},
|
||||
"version": "2.0.0"
|
||||
}
|
10
node_modules/ansi-regex/index.js
generated
vendored
Normal file
10
node_modules/ansi-regex/index.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = () => {
|
||||
const pattern = [
|
||||
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
|
||||
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
|
||||
].join('|');
|
||||
|
||||
return new RegExp(pattern, 'g');
|
||||
};
|
9
node_modules/ansi-regex/license
generated
vendored
Normal file
9
node_modules/ansi-regex/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
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.
|
121
node_modules/ansi-regex/package.json
generated
vendored
Normal file
121
node_modules/ansi-regex/package.json
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"ansi-regex@^3.0.0",
|
||||
"/home/beppe/Github/yahooApi/node_modules/strip-ansi"
|
||||
]
|
||||
],
|
||||
"_from": "ansi-regex@>=3.0.0 <4.0.0",
|
||||
"_id": "ansi-regex@3.0.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/ansi-regex",
|
||||
"_nodeVersion": "4.8.3",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/ansi-regex-3.0.0.tgz_1497985412590_0.5700640194118023"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "sindresorhus"
|
||||
},
|
||||
"_npmVersion": "2.15.11",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "ansi-regex",
|
||||
"raw": "ansi-regex@^3.0.0",
|
||||
"rawSpec": "^3.0.0",
|
||||
"scope": null,
|
||||
"spec": ">=3.0.0 <4.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/strip-ansi"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
||||
"_shasum": "ed0317c322064f79466c02966bddb605ab37d998",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "ansi-regex@^3.0.0",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/strip-ansi",
|
||||
"author": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "Sindre Sorhus",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/chalk/ansi-regex/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Regular expression for matching ANSI escape codes",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "ed0317c322064f79466c02966bddb605ab37d998",
|
||||
"tarball": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "0a8cc19946c03c38520fe8c086b8adb66f9cce0b",
|
||||
"homepage": "https://github.com/chalk/ansi-regex#readme",
|
||||
"keywords": [
|
||||
"256",
|
||||
"ansi",
|
||||
"cli",
|
||||
"color",
|
||||
"colors",
|
||||
"colour",
|
||||
"command-line",
|
||||
"console",
|
||||
"escape",
|
||||
"find",
|
||||
"formatting",
|
||||
"match",
|
||||
"pattern",
|
||||
"re",
|
||||
"regex",
|
||||
"regexp",
|
||||
"rgb",
|
||||
"shell",
|
||||
"string",
|
||||
"styles",
|
||||
"terminal",
|
||||
"test",
|
||||
"text",
|
||||
"tty",
|
||||
"xterm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "dthree",
|
||||
"email": "threedeecee@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "qix",
|
||||
"email": "i.am.qix@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "sindresorhus",
|
||||
"email": "sindresorhus@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "ansi-regex",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/chalk/ansi-regex.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava",
|
||||
"view-supported": "node fixtures/view-codes.js"
|
||||
},
|
||||
"version": "3.0.0"
|
||||
}
|
46
node_modules/ansi-regex/readme.md
generated
vendored
Normal file
46
node_modules/ansi-regex/readme.md
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# ansi-regex [](https://travis-ci.org/chalk/ansi-regex)
|
||||
|
||||
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-regex
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const 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']
|
||||
```
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why do you test for codes not in the ECMA 48 standard?
|
||||
|
||||
Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
|
||||
|
||||
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
165
node_modules/ansi-styles/index.js
generated
vendored
Normal file
165
node_modules/ansi-styles/index.js
generated
vendored
Normal file
@@ -0,0 +1,165 @@
|
||||
'use strict';
|
||||
const colorConvert = require('color-convert');
|
||||
|
||||
const wrapAnsi16 = (fn, offset) => function () {
|
||||
const code = fn.apply(colorConvert, arguments);
|
||||
return `\u001B[${code + offset}m`;
|
||||
};
|
||||
|
||||
const wrapAnsi256 = (fn, offset) => function () {
|
||||
const code = fn.apply(colorConvert, arguments);
|
||||
return `\u001B[${38 + offset};5;${code}m`;
|
||||
};
|
||||
|
||||
const wrapAnsi16m = (fn, offset) => function () {
|
||||
const rgb = fn.apply(colorConvert, arguments);
|
||||
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
||||
};
|
||||
|
||||
function assembleStyles() {
|
||||
const codes = new Map();
|
||||
const styles = {
|
||||
modifier: {
|
||||
reset: [0, 0],
|
||||
// 21 isn't widely supported and 22 does the same thing
|
||||
bold: [1, 22],
|
||||
dim: [2, 22],
|
||||
italic: [3, 23],
|
||||
underline: [4, 24],
|
||||
inverse: [7, 27],
|
||||
hidden: [8, 28],
|
||||
strikethrough: [9, 29]
|
||||
},
|
||||
color: {
|
||||
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],
|
||||
|
||||
// Bright color
|
||||
redBright: [91, 39],
|
||||
greenBright: [92, 39],
|
||||
yellowBright: [93, 39],
|
||||
blueBright: [94, 39],
|
||||
magentaBright: [95, 39],
|
||||
cyanBright: [96, 39],
|
||||
whiteBright: [97, 39]
|
||||
},
|
||||
bgColor: {
|
||||
bgBlack: [40, 49],
|
||||
bgRed: [41, 49],
|
||||
bgGreen: [42, 49],
|
||||
bgYellow: [43, 49],
|
||||
bgBlue: [44, 49],
|
||||
bgMagenta: [45, 49],
|
||||
bgCyan: [46, 49],
|
||||
bgWhite: [47, 49],
|
||||
|
||||
// Bright color
|
||||
bgBlackBright: [100, 49],
|
||||
bgRedBright: [101, 49],
|
||||
bgGreenBright: [102, 49],
|
||||
bgYellowBright: [103, 49],
|
||||
bgBlueBright: [104, 49],
|
||||
bgMagentaBright: [105, 49],
|
||||
bgCyanBright: [106, 49],
|
||||
bgWhiteBright: [107, 49]
|
||||
}
|
||||
};
|
||||
|
||||
// Fix humans
|
||||
styles.color.grey = styles.color.gray;
|
||||
|
||||
for (const groupName of Object.keys(styles)) {
|
||||
const group = styles[groupName];
|
||||
|
||||
for (const styleName of Object.keys(group)) {
|
||||
const style = group[styleName];
|
||||
|
||||
styles[styleName] = {
|
||||
open: `\u001B[${style[0]}m`,
|
||||
close: `\u001B[${style[1]}m`
|
||||
};
|
||||
|
||||
group[styleName] = styles[styleName];
|
||||
|
||||
codes.set(style[0], style[1]);
|
||||
}
|
||||
|
||||
Object.defineProperty(styles, groupName, {
|
||||
value: group,
|
||||
enumerable: false
|
||||
});
|
||||
|
||||
Object.defineProperty(styles, 'codes', {
|
||||
value: codes,
|
||||
enumerable: false
|
||||
});
|
||||
}
|
||||
|
||||
const ansi2ansi = n => n;
|
||||
const rgb2rgb = (r, g, b) => [r, g, b];
|
||||
|
||||
styles.color.close = '\u001B[39m';
|
||||
styles.bgColor.close = '\u001B[49m';
|
||||
|
||||
styles.color.ansi = {
|
||||
ansi: wrapAnsi16(ansi2ansi, 0)
|
||||
};
|
||||
styles.color.ansi256 = {
|
||||
ansi256: wrapAnsi256(ansi2ansi, 0)
|
||||
};
|
||||
styles.color.ansi16m = {
|
||||
rgb: wrapAnsi16m(rgb2rgb, 0)
|
||||
};
|
||||
|
||||
styles.bgColor.ansi = {
|
||||
ansi: wrapAnsi16(ansi2ansi, 10)
|
||||
};
|
||||
styles.bgColor.ansi256 = {
|
||||
ansi256: wrapAnsi256(ansi2ansi, 10)
|
||||
};
|
||||
styles.bgColor.ansi16m = {
|
||||
rgb: wrapAnsi16m(rgb2rgb, 10)
|
||||
};
|
||||
|
||||
for (let key of Object.keys(colorConvert)) {
|
||||
if (typeof colorConvert[key] !== 'object') {
|
||||
continue;
|
||||
}
|
||||
|
||||
const suite = colorConvert[key];
|
||||
|
||||
if (key === 'ansi16') {
|
||||
key = 'ansi';
|
||||
}
|
||||
|
||||
if ('ansi16' in suite) {
|
||||
styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
|
||||
styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
|
||||
}
|
||||
|
||||
if ('ansi256' in suite) {
|
||||
styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
|
||||
styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
|
||||
}
|
||||
|
||||
if ('rgb' in suite) {
|
||||
styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
|
||||
styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
|
||||
}
|
||||
}
|
||||
|
||||
return styles;
|
||||
}
|
||||
|
||||
// Make the export immutable
|
||||
Object.defineProperty(module, 'exports', {
|
||||
enumerable: true,
|
||||
get: assembleStyles
|
||||
});
|
9
node_modules/ansi-styles/license
generated
vendored
Normal file
9
node_modules/ansi-styles/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
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.
|
122
node_modules/ansi-styles/package.json
generated
vendored
Normal file
122
node_modules/ansi-styles/package.json
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"ansi-styles@^3.2.1",
|
||||
"/home/beppe/Github/yahooApi/node_modules/chalk"
|
||||
]
|
||||
],
|
||||
"_from": "ansi-styles@>=3.2.1 <4.0.0",
|
||||
"_id": "ansi-styles@3.2.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/ansi-styles",
|
||||
"_nodeVersion": "8.9.4",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/ansi-styles_3.2.1_1519983600652_0.7656433427334486"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "sindresorhus"
|
||||
},
|
||||
"_npmVersion": "5.6.0",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "ansi-styles",
|
||||
"raw": "ansi-styles@^3.2.1",
|
||||
"rawSpec": "^3.2.1",
|
||||
"scope": null,
|
||||
"spec": ">=3.2.1 <4.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/chalk"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"_shasum": "41fbb20243e50b12be0f04b8dedbf07520ce841d",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "ansi-styles@^3.2.1",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/chalk",
|
||||
"author": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "Sindre Sorhus",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"ava": {
|
||||
"require": "babel-polyfill"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/chalk/ansi-styles/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"color-convert": "^1.9.0"
|
||||
},
|
||||
"description": "ANSI escape codes for styling strings in the terminal",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"babel-polyfill": "^6.23.0",
|
||||
"svg-term-cli": "^2.1.1",
|
||||
"xo": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"fileCount": 4,
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"shasum": "41fbb20243e50b12be0f04b8dedbf07520ce841d",
|
||||
"tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"unpackedSize": 9371
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "de7527a86c1cf49906b0eb32a0de1402d849ccc2",
|
||||
"homepage": "https://github.com/chalk/ansi-styles#readme",
|
||||
"keywords": [
|
||||
"256",
|
||||
"ansi",
|
||||
"cli",
|
||||
"color",
|
||||
"colors",
|
||||
"colour",
|
||||
"command-line",
|
||||
"console",
|
||||
"escape",
|
||||
"formatting",
|
||||
"log",
|
||||
"logging",
|
||||
"rgb",
|
||||
"shell",
|
||||
"string",
|
||||
"styles",
|
||||
"terminal",
|
||||
"text",
|
||||
"tty",
|
||||
"xterm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "qix",
|
||||
"email": "i.am.qix@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "sindresorhus",
|
||||
"email": "sindresorhus@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "ansi-styles",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/chalk/ansi-styles.git"
|
||||
},
|
||||
"scripts": {
|
||||
"screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor",
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "3.2.1"
|
||||
}
|
147
node_modules/ansi-styles/readme.md
generated
vendored
Normal file
147
node_modules/ansi-styles/readme.md
generated
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
# ansi-styles [](https://travis-ci.org/chalk/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/chalk/chalk) module for styling your strings.
|
||||
|
||||
<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-styles
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const style = require('ansi-styles');
|
||||
|
||||
console.log(`${style.green.open}Hello world!${style.green.close}`);
|
||||
|
||||
|
||||
// Color conversion between 16/256/truecolor
|
||||
// NOTE: If conversion goes to 16 colors or 256 colors, the original color
|
||||
// may be degraded to fit that color palette. This means terminals
|
||||
// that do not support 16 million colors will best-match the
|
||||
// original color.
|
||||
console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close);
|
||||
console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close);
|
||||
console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close);
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
Each style has an `open` and `close` property.
|
||||
|
||||
|
||||
## Styles
|
||||
|
||||
### Modifiers
|
||||
|
||||
- `reset`
|
||||
- `bold`
|
||||
- `dim`
|
||||
- `italic` *(Not widely supported)*
|
||||
- `underline`
|
||||
- `inverse`
|
||||
- `hidden`
|
||||
- `strikethrough` *(Not widely supported)*
|
||||
|
||||
### Colors
|
||||
|
||||
- `black`
|
||||
- `red`
|
||||
- `green`
|
||||
- `yellow`
|
||||
- `blue`
|
||||
- `magenta`
|
||||
- `cyan`
|
||||
- `white`
|
||||
- `gray` ("bright black")
|
||||
- `redBright`
|
||||
- `greenBright`
|
||||
- `yellowBright`
|
||||
- `blueBright`
|
||||
- `magentaBright`
|
||||
- `cyanBright`
|
||||
- `whiteBright`
|
||||
|
||||
### Background colors
|
||||
|
||||
- `bgBlack`
|
||||
- `bgRed`
|
||||
- `bgGreen`
|
||||
- `bgYellow`
|
||||
- `bgBlue`
|
||||
- `bgMagenta`
|
||||
- `bgCyan`
|
||||
- `bgWhite`
|
||||
- `bgBlackBright`
|
||||
- `bgRedBright`
|
||||
- `bgGreenBright`
|
||||
- `bgYellowBright`
|
||||
- `bgBlueBright`
|
||||
- `bgMagentaBright`
|
||||
- `bgCyanBright`
|
||||
- `bgWhiteBright`
|
||||
|
||||
|
||||
## Advanced usage
|
||||
|
||||
By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
|
||||
|
||||
- `style.modifier`
|
||||
- `style.color`
|
||||
- `style.bgColor`
|
||||
|
||||
###### Example
|
||||
|
||||
```js
|
||||
console.log(style.color.green.open);
|
||||
```
|
||||
|
||||
Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values.
|
||||
|
||||
###### Example
|
||||
|
||||
```js
|
||||
console.log(style.codes.get(36));
|
||||
//=> 39
|
||||
```
|
||||
|
||||
|
||||
## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728)
|
||||
|
||||
`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors.
|
||||
|
||||
To use these, call the associated conversion function with the intended output, for example:
|
||||
|
||||
```js
|
||||
style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code
|
||||
style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code
|
||||
|
||||
style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
|
||||
style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
|
||||
|
||||
style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code
|
||||
style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
15
node_modules/anymatch/LICENSE
generated
vendored
Normal file
15
node_modules/anymatch/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) 2014 Elan Shanker
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
99
node_modules/anymatch/README.md
generated
vendored
Normal file
99
node_modules/anymatch/README.md
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
anymatch [](https://travis-ci.org/micromatch/anymatch) [](https://coveralls.io/r/micromatch/anymatch?branch=master)
|
||||
======
|
||||
Javascript module to match a string against a regular expression, glob, string,
|
||||
or function that takes the string as an argument and returns a truthy or falsy
|
||||
value. The matcher can also be an array of any or all of these. Useful for
|
||||
allowing a very flexible user-defined config to define things like file paths.
|
||||
|
||||
__Note: This module has Bash-parity, please be aware that Windows-style backslashes are not supported as separators. See https://github.com/micromatch/micromatch#backslashes for more information.__
|
||||
|
||||
[](https://nodei.co/npm/anymatch/)
|
||||
[](https://nodei.co/npm-dl/anymatch/)
|
||||
|
||||
Usage
|
||||
-----
|
||||
```sh
|
||||
npm install anymatch --save
|
||||
```
|
||||
|
||||
#### anymatch (matchers, testString, [returnIndex], [startIndex], [endIndex])
|
||||
* __matchers__: (_Array|String|RegExp|Function_)
|
||||
String to be directly matched, string with glob patterns, regular expression
|
||||
test, function that takes the testString as an argument and returns a truthy
|
||||
value if it should be matched, or an array of any number and mix of these types.
|
||||
* __testString__: (_String|Array_) The string to test against the matchers. If
|
||||
passed as an array, the first element of the array will be used as the
|
||||
`testString` for non-function matchers, while the entire array will be applied
|
||||
as the arguments for function matchers.
|
||||
* __returnIndex__: (_Boolean [optional]_) If true, return the array index of
|
||||
the first matcher that that testString matched, or -1 if no match, instead of a
|
||||
boolean result.
|
||||
* __startIndex, endIndex__: (_Integer [optional]_) Can be used to define a
|
||||
subset out of the array of provided matchers to test against. Can be useful
|
||||
with bound matcher functions (see below). When used with `returnIndex = true`
|
||||
preserves original indexing. Behaves the same as `Array.prototype.slice` (i.e.
|
||||
includes array members up to, but not including endIndex).
|
||||
|
||||
```js
|
||||
var anymatch = require('anymatch');
|
||||
|
||||
var matchers = [
|
||||
'path/to/file.js',
|
||||
'path/anyjs/**/*.js',
|
||||
/foo\.js$/,
|
||||
function (string) {
|
||||
return string.indexOf('bar') !== -1 && string.length > 10
|
||||
}
|
||||
];
|
||||
|
||||
anymatch(matchers, 'path/to/file.js'); // true
|
||||
anymatch(matchers, 'path/anyjs/baz.js'); // true
|
||||
anymatch(matchers, 'path/to/foo.js'); // true
|
||||
anymatch(matchers, 'path/to/bar.js'); // true
|
||||
anymatch(matchers, 'bar.js'); // false
|
||||
|
||||
// returnIndex = true
|
||||
anymatch(matchers, 'foo.js', true); // 2
|
||||
anymatch(matchers, 'path/anyjs/foo.js', true); // 1
|
||||
|
||||
// skip matchers
|
||||
anymatch(matchers, 'path/to/file.js', false, 1); // false
|
||||
anymatch(matchers, 'path/anyjs/foo.js', true, 2, 3); // 2
|
||||
anymatch(matchers, 'path/to/bar.js', true, 0, 3); // -1
|
||||
|
||||
// using globs to match directories and their children
|
||||
anymatch('node_modules', 'node_modules'); // true
|
||||
anymatch('node_modules', 'node_modules/somelib/index.js'); // false
|
||||
anymatch('node_modules/**', 'node_modules/somelib/index.js'); // true
|
||||
anymatch('node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // false
|
||||
anymatch('**/node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // true
|
||||
```
|
||||
|
||||
#### anymatch (matchers)
|
||||
You can also pass in only your matcher(s) to get a curried function that has
|
||||
already been bound to the provided matching criteria. This can be used as an
|
||||
`Array.prototype.filter` callback.
|
||||
|
||||
```js
|
||||
var matcher = anymatch(matchers);
|
||||
|
||||
matcher('path/to/file.js'); // true
|
||||
matcher('path/anyjs/baz.js', true); // 1
|
||||
matcher('path/anyjs/baz.js', true, 2); // -1
|
||||
|
||||
['foo.js', 'bar.js'].filter(matcher); // ['foo.js']
|
||||
```
|
||||
|
||||
Change Log
|
||||
----------
|
||||
[See release notes page on GitHub](https://github.com/micromatch/anymatch/releases)
|
||||
|
||||
NOTE: As of v2.0.0, [micromatch](https://github.com/jonschlinkert/micromatch) moves away from minimatch-parity and inline with Bash. This includes handling backslashes differently (see https://github.com/micromatch/micromatch#backslashes for more information).
|
||||
|
||||
NOTE: As of v1.2.0, anymatch uses [micromatch](https://github.com/jonschlinkert/micromatch)
|
||||
for glob pattern matching. Issues with glob pattern matching should be
|
||||
reported directly to the [micromatch issue tracker](https://github.com/jonschlinkert/micromatch/issues).
|
||||
|
||||
License
|
||||
-------
|
||||
[ISC](https://raw.github.com/micromatch/anymatch/master/LICENSE)
|
67
node_modules/anymatch/index.js
generated
vendored
Normal file
67
node_modules/anymatch/index.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
'use strict';
|
||||
|
||||
var micromatch = require('micromatch');
|
||||
var normalize = require('normalize-path');
|
||||
var path = require('path'); // required for tests.
|
||||
var arrify = function(a) { return a == null ? [] : (Array.isArray(a) ? a : [a]); };
|
||||
|
||||
var anymatch = function(criteria, value, returnIndex, startIndex, endIndex) {
|
||||
criteria = arrify(criteria);
|
||||
value = arrify(value);
|
||||
if (arguments.length === 1) {
|
||||
return anymatch.bind(null, criteria.map(function(criterion) {
|
||||
return typeof criterion === 'string' && criterion[0] !== '!' ?
|
||||
micromatch.matcher(criterion) : criterion;
|
||||
}));
|
||||
}
|
||||
startIndex = startIndex || 0;
|
||||
var string = value[0];
|
||||
var altString, altValue;
|
||||
var matched = false;
|
||||
var matchIndex = -1;
|
||||
function testCriteria(criterion, index) {
|
||||
var result;
|
||||
switch (Object.prototype.toString.call(criterion)) {
|
||||
case '[object String]':
|
||||
result = string === criterion || altString && altString === criterion;
|
||||
result = result || micromatch.isMatch(string, criterion);
|
||||
break;
|
||||
case '[object RegExp]':
|
||||
result = criterion.test(string) || altString && criterion.test(altString);
|
||||
break;
|
||||
case '[object Function]':
|
||||
result = criterion.apply(null, value);
|
||||
result = result || altValue && criterion.apply(null, altValue);
|
||||
break;
|
||||
default:
|
||||
result = false;
|
||||
}
|
||||
if (result) {
|
||||
matchIndex = index + startIndex;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
var crit = criteria;
|
||||
var negGlobs = crit.reduce(function(arr, criterion, index) {
|
||||
if (typeof criterion === 'string' && criterion[0] === '!') {
|
||||
if (crit === criteria) {
|
||||
// make a copy before modifying
|
||||
crit = crit.slice();
|
||||
}
|
||||
crit[index] = null;
|
||||
arr.push(criterion.substr(1));
|
||||
}
|
||||
return arr;
|
||||
}, []);
|
||||
if (!negGlobs.length || !micromatch.any(string, negGlobs)) {
|
||||
if (path.sep === '\\' && typeof string === 'string') {
|
||||
altString = normalize(string);
|
||||
altString = altString === string ? null : altString;
|
||||
if (altString) altValue = [altString].concat(value.slice(1));
|
||||
}
|
||||
matched = crit.slice(startIndex, endIndex).some(testCriteria);
|
||||
}
|
||||
return returnIndex === true ? matchIndex : matched;
|
||||
};
|
||||
|
||||
module.exports = anymatch;
|
116
node_modules/anymatch/package.json
generated
vendored
Normal file
116
node_modules/anymatch/package.json
generated
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"anymatch@^2.0.0",
|
||||
"/home/beppe/Github/yahooApi/node_modules/chokidar"
|
||||
]
|
||||
],
|
||||
"_from": "anymatch@>=2.0.0 <3.0.0",
|
||||
"_id": "anymatch@2.0.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/anymatch",
|
||||
"_nodeVersion": "6.10.2",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/anymatch-2.0.0.tgz_1513905286165_0.27702793199568987"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "elan.shanker+npm@gmail.com",
|
||||
"name": "es128"
|
||||
},
|
||||
"_npmVersion": "5.0.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "anymatch",
|
||||
"raw": "anymatch@^2.0.0",
|
||||
"rawSpec": "^2.0.0",
|
||||
"scope": null,
|
||||
"spec": ">=2.0.0 <3.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/chokidar"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz",
|
||||
"_shasum": "bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "anymatch@^2.0.0",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/chokidar",
|
||||
"author": {
|
||||
"name": "Elan Shanker",
|
||||
"url": "http://github.com/es128"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/micromatch/anymatch/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"micromatch": "^3.1.4",
|
||||
"normalize-path": "^2.1.1"
|
||||
},
|
||||
"description": "Matches strings against configurable strings, globs, regular expressions, and/or functions",
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.7.0",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "^3.0.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==",
|
||||
"shasum": "bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb",
|
||||
"tarball": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "c906c0234c5fb676426da90e429c909566106028",
|
||||
"homepage": "https://github.com/micromatch/anymatch",
|
||||
"keywords": [
|
||||
"any",
|
||||
"expression",
|
||||
"file",
|
||||
"fs",
|
||||
"function",
|
||||
"glob",
|
||||
"list",
|
||||
"match",
|
||||
"regex",
|
||||
"regexp",
|
||||
"regular",
|
||||
"string"
|
||||
],
|
||||
"license": "ISC",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "doowb",
|
||||
"email": "brian.woodward@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "jonschlinkert",
|
||||
"email": "github@sellside.com"
|
||||
},
|
||||
{
|
||||
"name": "phated",
|
||||
"email": "blaine.bublitz@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "paulmillr",
|
||||
"email": "paul@paulmillr.com"
|
||||
},
|
||||
{
|
||||
"name": "es128",
|
||||
"email": "elan.shanker+npm@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "anymatch",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/micromatch/anymatch.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls"
|
||||
},
|
||||
"version": "2.0.0"
|
||||
}
|
21
node_modules/arr-diff/LICENSE
generated
vendored
Executable file
21
node_modules/arr-diff/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2017, Jon Schlinkert
|
||||
|
||||
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.
|
130
node_modules/arr-diff/README.md
generated
vendored
Normal file
130
node_modules/arr-diff/README.md
generated
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
# arr-diff [](https://www.npmjs.com/package/arr-diff) [](https://npmjs.org/package/arr-diff) [](https://travis-ci.org/jonschlinkert/arr-diff)
|
||||
|
||||
> Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save arr-diff
|
||||
```
|
||||
|
||||
Install with [yarn](https://yarnpkg.com):
|
||||
|
||||
```sh
|
||||
$ yarn add arr-diff
|
||||
```
|
||||
|
||||
Install with [bower](https://bower.io/)
|
||||
|
||||
```sh
|
||||
$ bower install arr-diff --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Returns the difference between the first array and additional arrays.
|
||||
|
||||
```js
|
||||
var diff = require('arr-diff');
|
||||
|
||||
var a = ['a', 'b', 'c', 'd'];
|
||||
var b = ['b', 'c'];
|
||||
|
||||
console.log(diff(a, b))
|
||||
//=> ['a', 'd']
|
||||
```
|
||||
|
||||
## Benchmarks
|
||||
|
||||
This library versus [array-differ](https://github.com/sindresorhus/array-differ), on April 14, 2017:
|
||||
|
||||
```
|
||||
Benchmarking: (4 of 4)
|
||||
· long-dupes
|
||||
· long
|
||||
· med
|
||||
· short
|
||||
|
||||
# benchmark/fixtures/long-dupes.js (100804 bytes)
|
||||
arr-diff-3.0.0 x 822 ops/sec ±0.67% (86 runs sampled)
|
||||
arr-diff-4.0.0 x 2,141 ops/sec ±0.42% (89 runs sampled)
|
||||
array-differ x 708 ops/sec ±0.70% (89 runs sampled)
|
||||
|
||||
fastest is arr-diff-4.0.0
|
||||
|
||||
# benchmark/fixtures/long.js (94529 bytes)
|
||||
arr-diff-3.0.0 x 882 ops/sec ±0.60% (87 runs sampled)
|
||||
arr-diff-4.0.0 x 2,329 ops/sec ±0.97% (83 runs sampled)
|
||||
array-differ x 769 ops/sec ±0.61% (90 runs sampled)
|
||||
|
||||
fastest is arr-diff-4.0.0
|
||||
|
||||
# benchmark/fixtures/med.js (708 bytes)
|
||||
arr-diff-3.0.0 x 856,150 ops/sec ±0.42% (89 runs sampled)
|
||||
arr-diff-4.0.0 x 4,665,249 ops/sec ±1.06% (89 runs sampled)
|
||||
array-differ x 653,888 ops/sec ±1.02% (86 runs sampled)
|
||||
|
||||
fastest is arr-diff-4.0.0
|
||||
|
||||
# benchmark/fixtures/short.js (60 bytes)
|
||||
arr-diff-3.0.0 x 3,078,467 ops/sec ±0.77% (93 runs sampled)
|
||||
arr-diff-4.0.0 x 9,213,296 ops/sec ±0.65% (89 runs sampled)
|
||||
array-differ x 1,337,051 ops/sec ±0.91% (92 runs sampled)
|
||||
|
||||
fastest is arr-diff-4.0.0
|
||||
```
|
||||
|
||||
## About
|
||||
|
||||
### Related projects
|
||||
|
||||
* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.")
|
||||
* [array-filter](https://www.npmjs.com/package/array-filter): Array#filter for older browsers. | [homepage](https://github.com/juliangruber/array-filter "Array#filter for older browsers.")
|
||||
* [array-intersection](https://www.npmjs.com/package/array-intersection): Return an array with the unique values present in _all_ given arrays using strict equality… [more](https://github.com/jonschlinkert/array-intersection) | [homepage](https://github.com/jonschlinkert/array-intersection "Return an array with the unique values present in _all_ given arrays using strict equality for comparisons.")
|
||||
|
||||
### Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 33 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 2 | [paulmillr](https://github.com/paulmillr) |
|
||||
|
||||
### Building docs
|
||||
|
||||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||
|
||||
To generate the readme, run the following command:
|
||||
|
||||
```sh
|
||||
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||
```
|
||||
|
||||
### Running tests
|
||||
|
||||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||
|
||||
```sh
|
||||
$ npm install && npm test
|
||||
```
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 14, 2017._
|
47
node_modules/arr-diff/index.js
generated
vendored
Normal file
47
node_modules/arr-diff/index.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
/*!
|
||||
* arr-diff <https://github.com/jonschlinkert/arr-diff>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function diff(arr/*, arrays*/) {
|
||||
var len = arguments.length;
|
||||
var idx = 0;
|
||||
while (++idx < len) {
|
||||
arr = diffArray(arr, arguments[idx]);
|
||||
}
|
||||
return arr;
|
||||
};
|
||||
|
||||
function diffArray(one, two) {
|
||||
if (!Array.isArray(two)) {
|
||||
return one.slice();
|
||||
}
|
||||
|
||||
var tlen = two.length
|
||||
var olen = one.length;
|
||||
var idx = -1;
|
||||
var arr = [];
|
||||
|
||||
while (++idx < olen) {
|
||||
var ele = one[idx];
|
||||
|
||||
var hasEle = false;
|
||||
for (var i = 0; i < tlen; i++) {
|
||||
var val = two[i];
|
||||
|
||||
if (ele === val) {
|
||||
hasEle = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasEle === false) {
|
||||
arr.push(ele);
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
144
node_modules/arr-diff/package.json
generated
vendored
Normal file
144
node_modules/arr-diff/package.json
generated
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"arr-diff@^4.0.0",
|
||||
"/home/beppe/Github/yahooApi/node_modules/micromatch"
|
||||
]
|
||||
],
|
||||
"_from": "arr-diff@>=4.0.0 <5.0.0",
|
||||
"_id": "arr-diff@4.0.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/arr-diff",
|
||||
"_nodeVersion": "7.7.3",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-18-east.internal.npmjs.com",
|
||||
"tmp": "tmp/arr-diff-4.0.0.tgz_1492143089001_0.8728802201803774"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "github@sellside.com",
|
||||
"name": "jonschlinkert"
|
||||
},
|
||||
"_npmVersion": "4.2.0",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "arr-diff",
|
||||
"raw": "arr-diff@^4.0.0",
|
||||
"rawSpec": "^4.0.0",
|
||||
"scope": null,
|
||||
"spec": ">=4.0.0 <5.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/micromatch",
|
||||
"/nanomatch"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
|
||||
"_shasum": "d6461074febfec71e7e15235761a329a5dc7c520",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "arr-diff@^4.0.0",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/micromatch",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/arr-diff/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jon Schlinkert",
|
||||
"email": "jon.schlinkert@sellside.com",
|
||||
"url": "http://twitter.com/jonschlinkert"
|
||||
},
|
||||
{
|
||||
"name": "Paul Miller",
|
||||
"email": "paul+gh@paulmillr.com",
|
||||
"url": "paulmillr.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.",
|
||||
"devDependencies": {
|
||||
"ansi-bold": "^0.1.1",
|
||||
"arr-flatten": "^1.0.1",
|
||||
"array-differ": "^1.0.0",
|
||||
"benchmarked": "^0.2.4",
|
||||
"gulp-format-md": "^0.1.9",
|
||||
"minimist": "^1.2.0",
|
||||
"mocha": "^2.4.5"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "d6461074febfec71e7e15235761a329a5dc7c520",
|
||||
"tarball": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "0a04556fb004b3db57f57de2777b1037090f6023",
|
||||
"homepage": "https://github.com/jonschlinkert/arr-diff",
|
||||
"keywords": [
|
||||
"arr",
|
||||
"array",
|
||||
"array differ",
|
||||
"array-differ",
|
||||
"diff",
|
||||
"differ",
|
||||
"difference"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "doowb",
|
||||
"email": "brian.woodward@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "jonschlinkert",
|
||||
"email": "github@sellside.com"
|
||||
},
|
||||
{
|
||||
"name": "paulmillr",
|
||||
"email": "paul@paulmillr.com"
|
||||
}
|
||||
],
|
||||
"name": "arr-diff",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jonschlinkert/arr-diff.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"verb": {
|
||||
"layout": "default",
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
},
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"reflinks": [
|
||||
"array-differ",
|
||||
"verb"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"arr-flatten",
|
||||
"array-filter",
|
||||
"array-intersection"
|
||||
]
|
||||
},
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"toc": false
|
||||
},
|
||||
"version": "4.0.0"
|
||||
}
|
21
node_modules/arr-flatten/LICENSE
generated
vendored
Executable file
21
node_modules/arr-flatten/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
|
||||
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.
|
86
node_modules/arr-flatten/README.md
generated
vendored
Executable file
86
node_modules/arr-flatten/README.md
generated
vendored
Executable file
@@ -0,0 +1,86 @@
|
||||
# arr-flatten [](https://www.npmjs.com/package/arr-flatten) [](https://npmjs.org/package/arr-flatten) [](https://npmjs.org/package/arr-flatten) [](https://travis-ci.org/jonschlinkert/arr-flatten) [](https://ci.appveyor.com/project/jonschlinkert/arr-flatten)
|
||||
|
||||
> Recursively flatten an array or arrays.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save arr-flatten
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
Install with [bower](https://bower.io/)
|
||||
|
||||
```sh
|
||||
$ bower install arr-flatten --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var flatten = require('arr-flatten');
|
||||
|
||||
flatten(['a', ['b', ['c']], 'd', ['e']]);
|
||||
//=> ['a', 'b', 'c', 'd', 'e']
|
||||
```
|
||||
|
||||
## Why another flatten utility?
|
||||
|
||||
I wanted the fastest implementation I could find, with implementation choices that should work for 95% of use cases, but no cruft to cover the other 5%.
|
||||
|
||||
## About
|
||||
|
||||
### Related projects
|
||||
|
||||
* [arr-filter](https://www.npmjs.com/package/arr-filter): Faster alternative to javascript's native filter method. | [homepage](https://github.com/jonschlinkert/arr-filter "Faster alternative to javascript's native filter method.")
|
||||
* [arr-union](https://www.npmjs.com/package/arr-union): Combines a list of arrays, returning a single array with unique values, using strict equality… [more](https://github.com/jonschlinkert/arr-union) | [homepage](https://github.com/jonschlinkert/arr-union "Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.")
|
||||
* [array-each](https://www.npmjs.com/package/array-each): Loop over each item in an array and call the given function on every element. | [homepage](https://github.com/jonschlinkert/array-each "Loop over each item in an array and call the given function on every element.")
|
||||
* [array-unique](https://www.npmjs.com/package/array-unique): Remove duplicate values from an array. Fastest ES5 implementation. | [homepage](https://github.com/jonschlinkert/array-unique "Remove duplicate values from an array. Fastest ES5 implementation.")
|
||||
|
||||
### Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 20 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 1 | [lukeed](https://github.com/lukeed) |
|
||||
|
||||
### Building docs
|
||||
|
||||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||
|
||||
To generate the readme, run the following command:
|
||||
|
||||
```sh
|
||||
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||
```
|
||||
|
||||
### Running tests
|
||||
|
||||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||
|
||||
```sh
|
||||
$ npm install && npm test
|
||||
```
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 05, 2017._
|
22
node_modules/arr-flatten/index.js
generated
vendored
Normal file
22
node_modules/arr-flatten/index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/*!
|
||||
* arr-flatten <https://github.com/jonschlinkert/arr-flatten>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function (arr) {
|
||||
return flat(arr, []);
|
||||
};
|
||||
|
||||
function flat(arr, res) {
|
||||
var i = 0, cur;
|
||||
var len = arr.length;
|
||||
for (; i < len; i++) {
|
||||
cur = arr[i];
|
||||
Array.isArray(cur) ? flat(cur, res) : res.push(cur);
|
||||
}
|
||||
return res;
|
||||
}
|
142
node_modules/arr-flatten/package.json
generated
vendored
Normal file
142
node_modules/arr-flatten/package.json
generated
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"arr-flatten@^1.1.0",
|
||||
"/home/beppe/Github/yahooApi/node_modules/braces"
|
||||
]
|
||||
],
|
||||
"_from": "arr-flatten@>=1.1.0 <2.0.0",
|
||||
"_id": "arr-flatten@1.1.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/arr-flatten",
|
||||
"_nodeVersion": "7.7.3",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/arr-flatten-1.1.0.tgz_1499280630530_0.4138362631201744"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "github@sellside.com",
|
||||
"name": "jonschlinkert"
|
||||
},
|
||||
"_npmVersion": "5.0.4",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "arr-flatten",
|
||||
"raw": "arr-flatten@^1.1.0",
|
||||
"rawSpec": "^1.1.0",
|
||||
"scope": null,
|
||||
"spec": ">=1.1.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/braces"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
|
||||
"_shasum": "36048bbff4e7b47e136644316c99669ea5ae91f1",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "arr-flatten@^1.1.0",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/braces",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/arr-flatten/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "http://twitter.com/jonschlinkert"
|
||||
},
|
||||
{
|
||||
"name": "Luke Edwards",
|
||||
"url": "https://lukeed.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "Recursively flatten an array or arrays.",
|
||||
"devDependencies": {
|
||||
"ansi-bold": "^0.1.1",
|
||||
"array-flatten": "^2.1.1",
|
||||
"array-slice": "^1.0.0",
|
||||
"benchmarked": "^1.0.0",
|
||||
"compute-flatten": "^1.0.0",
|
||||
"flatit": "^1.1.1",
|
||||
"flatten": "^1.0.2",
|
||||
"flatten-array": "^1.0.0",
|
||||
"glob": "^7.1.1",
|
||||
"gulp-format-md": "^0.1.12",
|
||||
"just-flatten-it": "^1.1.23",
|
||||
"lodash.flattendeep": "^4.4.0",
|
||||
"m_flattened": "^1.0.1",
|
||||
"mocha": "^3.2.0",
|
||||
"utils-flatten": "^1.0.0",
|
||||
"write": "^0.3.3"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
|
||||
"shasum": "36048bbff4e7b47e136644316c99669ea5ae91f1",
|
||||
"tarball": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "76a1ae28b03fdb1cbe5d49fa521bc4807b9f94d3",
|
||||
"homepage": "https://github.com/jonschlinkert/arr-flatten",
|
||||
"keywords": [
|
||||
"arr",
|
||||
"array",
|
||||
"elements",
|
||||
"flat",
|
||||
"flatten",
|
||||
"nested",
|
||||
"recurse",
|
||||
"recursive",
|
||||
"recursively"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "jonschlinkert",
|
||||
"email": "github@sellside.com"
|
||||
}
|
||||
],
|
||||
"name": "arr-flatten",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jonschlinkert/arr-flatten.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"verb": {
|
||||
"layout": "default",
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
},
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"arr-filter",
|
||||
"arr-union",
|
||||
"array-each",
|
||||
"array-unique"
|
||||
]
|
||||
},
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"toc": false
|
||||
},
|
||||
"version": "1.1.0"
|
||||
}
|
21
node_modules/arr-union/LICENSE
generated
vendored
Normal file
21
node_modules/arr-union/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2016, Jon Schlinkert.
|
||||
|
||||
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.
|
99
node_modules/arr-union/README.md
generated
vendored
Normal file
99
node_modules/arr-union/README.md
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
# arr-union [](https://www.npmjs.com/package/arr-union) [](https://travis-ci.org/jonschlinkert/arr-union)
|
||||
|
||||
> Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm i arr-union --save
|
||||
```
|
||||
|
||||
## Benchmarks
|
||||
|
||||
This library is **10-20 times faster** and more performant than [array-union](https://github.com/sindresorhus/array-union).
|
||||
|
||||
See the [benchmarks](./benchmark).
|
||||
|
||||
```sh
|
||||
#1: five-arrays
|
||||
array-union x 511,121 ops/sec ±0.80% (96 runs sampled)
|
||||
arr-union x 5,716,039 ops/sec ±0.86% (93 runs sampled)
|
||||
|
||||
#2: ten-arrays
|
||||
array-union x 245,196 ops/sec ±0.69% (94 runs sampled)
|
||||
arr-union x 1,850,786 ops/sec ±0.84% (97 runs sampled)
|
||||
|
||||
#3: two-arrays
|
||||
array-union x 563,869 ops/sec ±0.97% (94 runs sampled)
|
||||
arr-union x 9,602,852 ops/sec ±0.87% (92 runs sampled)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var union = require('arr-union');
|
||||
|
||||
union(['a'], ['b', 'c'], ['d', 'e', 'f']);
|
||||
//=> ['a', 'b', 'c', 'd', 'e', 'f']
|
||||
```
|
||||
|
||||
Returns only unique elements:
|
||||
|
||||
```js
|
||||
union(['a', 'a'], ['b', 'c']);
|
||||
//=> ['a', 'b', 'c']
|
||||
```
|
||||
|
||||
## Related projects
|
||||
|
||||
* [arr-diff](https://www.npmjs.com/package/arr-diff): Returns an array with only the unique values from the first array, by excluding all… [more](https://www.npmjs.com/package/arr-diff) | [homepage](https://github.com/jonschlinkert/arr-diff)
|
||||
* [arr-filter](https://www.npmjs.com/package/arr-filter): Faster alternative to javascript's native filter method. | [homepage](https://github.com/jonschlinkert/arr-filter)
|
||||
* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten)
|
||||
* [arr-map](https://www.npmjs.com/package/arr-map): Faster, node.js focused alternative to JavaScript's native array map. | [homepage](https://github.com/jonschlinkert/arr-map)
|
||||
* [arr-pluck](https://www.npmjs.com/package/arr-pluck): Retrieves the value of a specified property from all elements in the collection. | [homepage](https://github.com/jonschlinkert/arr-pluck)
|
||||
* [arr-reduce](https://www.npmjs.com/package/arr-reduce): Fast array reduce that also loops over sparse elements. | [homepage](https://github.com/jonschlinkert/arr-reduce)
|
||||
* [array-unique](https://www.npmjs.com/package/array-unique): Return an array free of duplicate values. Fastest ES5 implementation. | [homepage](https://github.com/jonschlinkert/array-unique)
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/arr-union/issues/new).
|
||||
|
||||
## Building docs
|
||||
|
||||
Generate readme and API documentation with [verb](https://github.com/verbose/verb):
|
||||
|
||||
```sh
|
||||
$ npm i verb && npm run docs
|
||||
```
|
||||
|
||||
Or, if [verb](https://github.com/verbose/verb) is installed globally:
|
||||
|
||||
```sh
|
||||
$ verb
|
||||
```
|
||||
|
||||
## Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm i -d && npm test
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2016 [Jon Schlinkert](https://github.com/jonschlinkert)
|
||||
Released under the [MIT license](https://github.com/jonschlinkert/arr-union/blob/master/LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on February 23, 2016._
|
29
node_modules/arr-union/index.js
generated
vendored
Normal file
29
node_modules/arr-union/index.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function union(init) {
|
||||
if (!Array.isArray(init)) {
|
||||
throw new TypeError('arr-union expects the first argument to be an array.');
|
||||
}
|
||||
|
||||
var len = arguments.length;
|
||||
var i = 0;
|
||||
|
||||
while (++i < len) {
|
||||
var arg = arguments[i];
|
||||
if (!arg) continue;
|
||||
|
||||
if (!Array.isArray(arg)) {
|
||||
arg = [arg];
|
||||
}
|
||||
|
||||
for (var j = 0; j < arg.length; j++) {
|
||||
var ele = arg[j];
|
||||
|
||||
if (init.indexOf(ele) >= 0) {
|
||||
continue;
|
||||
}
|
||||
init.push(ele);
|
||||
}
|
||||
}
|
||||
return init;
|
||||
};
|
136
node_modules/arr-union/package.json
generated
vendored
Normal file
136
node_modules/arr-union/package.json
generated
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"arr-union@^3.1.0",
|
||||
"/home/beppe/Github/yahooApi/node_modules/union-value"
|
||||
]
|
||||
],
|
||||
"_from": "arr-union@>=3.1.0 <4.0.0",
|
||||
"_id": "arr-union@3.1.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/arr-union",
|
||||
"_nodeVersion": "5.5.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-9-west.internal.npmjs.com",
|
||||
"tmp": "tmp/arr-union-3.1.0.tgz_1456232075611_0.8481670441105962"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "github@sellside.com",
|
||||
"name": "jonschlinkert"
|
||||
},
|
||||
"_npmVersion": "3.6.0",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "arr-union",
|
||||
"raw": "arr-union@^3.1.0",
|
||||
"rawSpec": "^3.1.0",
|
||||
"scope": null,
|
||||
"spec": ">=3.1.0 <4.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/class-utils",
|
||||
"/union-value"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
|
||||
"_shasum": "e39b09aea9def866a8f206e288af63919bae39c4",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "arr-union@^3.1.0",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/union-value",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/arr-union/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.",
|
||||
"devDependencies": {
|
||||
"ansi-bold": "^0.1.1",
|
||||
"array-union": "^1.0.1",
|
||||
"array-unique": "^0.2.1",
|
||||
"benchmarked": "^0.1.4",
|
||||
"gulp-format-md": "^0.1.7",
|
||||
"minimist": "^1.1.1",
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "e39b09aea9def866a8f206e288af63919bae39c4",
|
||||
"tarball": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "ede857f5d5082467534e372fd3da45ce5e782e93",
|
||||
"homepage": "https://github.com/jonschlinkert/arr-union",
|
||||
"keywords": [
|
||||
"add",
|
||||
"append",
|
||||
"array",
|
||||
"arrays",
|
||||
"combine",
|
||||
"concat",
|
||||
"extend",
|
||||
"union",
|
||||
"uniq",
|
||||
"unique",
|
||||
"util",
|
||||
"utility",
|
||||
"utils"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "jonschlinkert",
|
||||
"email": "github@sellside.com"
|
||||
}
|
||||
],
|
||||
"name": "arr-union",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jonschlinkert/arr-union.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"verb": {
|
||||
"layout": "default",
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
},
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"reflinks": [
|
||||
"array-union",
|
||||
"verb"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"arr-diff",
|
||||
"arr-filter",
|
||||
"arr-flatten",
|
||||
"arr-map",
|
||||
"arr-pluck",
|
||||
"arr-reduce",
|
||||
"array-unique"
|
||||
]
|
||||
},
|
||||
"run": true,
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"toc": false
|
||||
},
|
||||
"version": "3.1.0"
|
||||
}
|
21
node_modules/array-flatten/LICENSE
generated
vendored
Normal file
21
node_modules/array-flatten/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.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.
|
43
node_modules/array-flatten/README.md
generated
vendored
Normal file
43
node_modules/array-flatten/README.md
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# Array Flatten
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![NPM downloads][downloads-image]][downloads-url]
|
||||
[![Build status][travis-image]][travis-url]
|
||||
[![Test coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
> Flatten an array of nested arrays into a single flat array. Accepts an optional depth.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
npm install array-flatten --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var flatten = require('array-flatten')
|
||||
|
||||
flatten([1, [2, [3, [4, [5], 6], 7], 8], 9])
|
||||
//=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||
|
||||
flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2)
|
||||
//=> [1, 2, 3, [4, [5], 6], 7, 8, 9]
|
||||
|
||||
(function () {
|
||||
flatten(arguments) //=> [1, 2, 3]
|
||||
})(1, [2, 3])
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat
|
||||
[npm-url]: https://npmjs.org/package/array-flatten
|
||||
[downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat
|
||||
[downloads-url]: https://npmjs.org/package/array-flatten
|
||||
[travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat
|
||||
[travis-url]: https://travis-ci.org/blakeembrey/array-flatten
|
||||
[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat
|
||||
[coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master
|
64
node_modules/array-flatten/array-flatten.js
generated
vendored
Normal file
64
node_modules/array-flatten/array-flatten.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Expose `arrayFlatten`.
|
||||
*/
|
||||
module.exports = arrayFlatten
|
||||
|
||||
/**
|
||||
* Recursive flatten function with depth.
|
||||
*
|
||||
* @param {Array} array
|
||||
* @param {Array} result
|
||||
* @param {Number} depth
|
||||
* @return {Array}
|
||||
*/
|
||||
function flattenWithDepth (array, result, depth) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
var value = array[i]
|
||||
|
||||
if (depth > 0 && Array.isArray(value)) {
|
||||
flattenWithDepth(value, result, depth - 1)
|
||||
} else {
|
||||
result.push(value)
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive flatten function. Omitting depth is slightly faster.
|
||||
*
|
||||
* @param {Array} array
|
||||
* @param {Array} result
|
||||
* @return {Array}
|
||||
*/
|
||||
function flattenForever (array, result) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
var value = array[i]
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
flattenForever(value, result)
|
||||
} else {
|
||||
result.push(value)
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Flatten an array, with the ability to define a depth.
|
||||
*
|
||||
* @param {Array} array
|
||||
* @param {Number} depth
|
||||
* @return {Array}
|
||||
*/
|
||||
function arrayFlatten (array, depth) {
|
||||
if (depth == null) {
|
||||
return flattenForever(array, [])
|
||||
}
|
||||
|
||||
return flattenWithDepth(array, [], depth)
|
||||
}
|
88
node_modules/array-flatten/package.json
generated
vendored
Normal file
88
node_modules/array-flatten/package.json
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"array-flatten@1.1.1",
|
||||
"/home/beppe/Github/yahooApi/node_modules/express"
|
||||
]
|
||||
],
|
||||
"_from": "array-flatten@1.1.1",
|
||||
"_id": "array-flatten@1.1.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/array-flatten",
|
||||
"_nodeVersion": "2.3.3",
|
||||
"_npmUser": {
|
||||
"email": "hello@blakeembrey.com",
|
||||
"name": "blakeembrey"
|
||||
},
|
||||
"_npmVersion": "2.11.3",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "array-flatten",
|
||||
"raw": "array-flatten@1.1.1",
|
||||
"rawSpec": "1.1.1",
|
||||
"scope": null,
|
||||
"spec": "1.1.1",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/express"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
||||
"_shasum": "9a5f699051b1e7073328f2a008968b64ea2955d2",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "array-flatten@1.1.1",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/express",
|
||||
"author": {
|
||||
"email": "hello@blakeembrey.com",
|
||||
"name": "Blake Embrey",
|
||||
"url": "http://blakeembrey.me"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/blakeembrey/array-flatten/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Flatten an array of nested arrays into a single flat array",
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.3.13",
|
||||
"mocha": "^2.2.4",
|
||||
"pre-commit": "^1.0.7",
|
||||
"standard": "^3.7.3"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "9a5f699051b1e7073328f2a008968b64ea2955d2",
|
||||
"tarball": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"array-flatten.js"
|
||||
],
|
||||
"gitHead": "1963a9189229d408e1e8f585a00c8be9edbd1803",
|
||||
"homepage": "https://github.com/blakeembrey/array-flatten",
|
||||
"keywords": [
|
||||
"arguments",
|
||||
"array",
|
||||
"depth",
|
||||
"flatten"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "array-flatten.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "blakeembrey",
|
||||
"email": "hello@blakeembrey.com"
|
||||
}
|
||||
],
|
||||
"name": "array-flatten",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/blakeembrey/array-flatten.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "istanbul cover _mocha -- -R spec"
|
||||
},
|
||||
"version": "1.1.1"
|
||||
}
|
21
node_modules/array-unique/LICENSE
generated
vendored
Executable file
21
node_modules/array-unique/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2016, Jon Schlinkert
|
||||
|
||||
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.
|
77
node_modules/array-unique/README.md
generated
vendored
Executable file
77
node_modules/array-unique/README.md
generated
vendored
Executable file
@@ -0,0 +1,77 @@
|
||||
# array-unique [](https://www.npmjs.com/package/array-unique) [](https://npmjs.org/package/array-unique) [](https://travis-ci.org/jonschlinkert/array-unique)
|
||||
|
||||
Remove duplicate values from an array. Fastest ES5 implementation.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save array-unique
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var unique = require('array-unique');
|
||||
|
||||
var arr = ['a', 'b', 'c', 'c'];
|
||||
console.log(unique(arr)) //=> ['a', 'b', 'c']
|
||||
console.log(arr) //=> ['a', 'b', 'c']
|
||||
|
||||
/* The above modifies the input array. To prevent that at a slight performance cost: */
|
||||
var unique = require("array-unique").immutable;
|
||||
|
||||
var arr = ['a', 'b', 'c', 'c'];
|
||||
console.log(unique(arr)) //=> ['a', 'b', 'c']
|
||||
console.log(arr) //=> ['a', 'b', 'c', 'c']
|
||||
```
|
||||
|
||||
## About
|
||||
|
||||
### Related projects
|
||||
|
||||
* [arr-diff](https://www.npmjs.com/package/arr-diff): Returns an array with only the unique values from the first array, by excluding all… [more](https://github.com/jonschlinkert/arr-diff) | [homepage](https://github.com/jonschlinkert/arr-diff "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.")
|
||||
* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.")
|
||||
* [arr-map](https://www.npmjs.com/package/arr-map): Faster, node.js focused alternative to JavaScript's native array map. | [homepage](https://github.com/jonschlinkert/arr-map "Faster, node.js focused alternative to JavaScript's native array map.")
|
||||
* [arr-pluck](https://www.npmjs.com/package/arr-pluck): Retrieves the value of a specified property from all elements in the collection. | [homepage](https://github.com/jonschlinkert/arr-pluck "Retrieves the value of a specified property from all elements in the collection.")
|
||||
* [arr-reduce](https://www.npmjs.com/package/arr-reduce): Fast array reduce that also loops over sparse elements. | [homepage](https://github.com/jonschlinkert/arr-reduce "Fast array reduce that also loops over sparse elements.")
|
||||
* [arr-union](https://www.npmjs.com/package/arr-union): Combines a list of arrays, returning a single array with unique values, using strict equality… [more](https://github.com/jonschlinkert/arr-union) | [homepage](https://github.com/jonschlinkert/arr-union "Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.")
|
||||
|
||||
### Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
### Building docs
|
||||
|
||||
_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
|
||||
|
||||
To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
|
||||
|
||||
```sh
|
||||
$ npm install -g verb verb-generate-readme && verb
|
||||
```
|
||||
|
||||
### Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm install -d && npm test
|
||||
```
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT license](https://github.com/jonschlinkert/array-unique/blob/master/LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.28, on July 31, 2016._
|
43
node_modules/array-unique/index.js
generated
vendored
Normal file
43
node_modules/array-unique/index.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/*!
|
||||
* array-unique <https://github.com/jonschlinkert/array-unique>
|
||||
*
|
||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function unique(arr) {
|
||||
if (!Array.isArray(arr)) {
|
||||
throw new TypeError('array-unique expects an array.');
|
||||
}
|
||||
|
||||
var len = arr.length;
|
||||
var i = -1;
|
||||
|
||||
while (i++ < len) {
|
||||
var j = i + 1;
|
||||
|
||||
for (; j < arr.length; ++j) {
|
||||
if (arr[i] === arr[j]) {
|
||||
arr.splice(j--, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
};
|
||||
|
||||
module.exports.immutable = function uniqueImmutable(arr) {
|
||||
if (!Array.isArray(arr)) {
|
||||
throw new TypeError('array-unique expects an array.');
|
||||
}
|
||||
|
||||
var arrLen = arr.length;
|
||||
var newArr = new Array(arrLen);
|
||||
|
||||
for (var i = 0; i < arrLen; i++) {
|
||||
newArr[i] = arr[i];
|
||||
}
|
||||
|
||||
return module.exports(newArr);
|
||||
};
|
128
node_modules/array-unique/package.json
generated
vendored
Normal file
128
node_modules/array-unique/package.json
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"array-unique@^0.3.2",
|
||||
"/home/beppe/Github/yahooApi/node_modules/micromatch"
|
||||
]
|
||||
],
|
||||
"_from": "array-unique@>=0.3.2 <0.4.0",
|
||||
"_id": "array-unique@0.3.2",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/array-unique",
|
||||
"_nodeVersion": "6.3.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-16-east.internal.npmjs.com",
|
||||
"tmp": "tmp/array-unique-0.3.2.tgz_1470012889222_0.35436262167058885"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "github@sellside.com",
|
||||
"name": "jonschlinkert"
|
||||
},
|
||||
"_npmVersion": "3.10.3",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "array-unique",
|
||||
"raw": "array-unique@^0.3.2",
|
||||
"rawSpec": "^0.3.2",
|
||||
"scope": null,
|
||||
"spec": ">=0.3.2 <0.4.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/braces",
|
||||
"/extglob",
|
||||
"/micromatch",
|
||||
"/nanomatch"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
|
||||
"_shasum": "a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "array-unique@^0.3.2",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/micromatch",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/array-unique/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Remove duplicate values from an array. Fastest ES5 implementation.",
|
||||
"devDependencies": {
|
||||
"array-uniq": "^1.0.2",
|
||||
"benchmarked": "^0.1.3",
|
||||
"gulp-format-md": "^0.1.9",
|
||||
"mocha": "^2.5.3",
|
||||
"should": "^10.0.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428",
|
||||
"tarball": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "d95d18b0d3188fb95d3c6c2bf349b2ed926b563b",
|
||||
"homepage": "https://github.com/jonschlinkert/array-unique",
|
||||
"keywords": [
|
||||
"array",
|
||||
"unique"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "jonschlinkert",
|
||||
"email": "github@sellside.com"
|
||||
},
|
||||
{
|
||||
"name": "doowb",
|
||||
"email": "brian.woodward@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "array-unique",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jonschlinkert/array-unique.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"verb": {
|
||||
"layout": "default",
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
},
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"reflinks": [
|
||||
"verb",
|
||||
"verb-generate-readme"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"arr-diff",
|
||||
"arr-flatten",
|
||||
"arr-map",
|
||||
"arr-pluck",
|
||||
"arr-reduce",
|
||||
"arr-union"
|
||||
]
|
||||
},
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"toc": false
|
||||
},
|
||||
"version": "0.3.2"
|
||||
}
|
70
node_modules/asap/CHANGES.md
generated
vendored
Normal file
70
node_modules/asap/CHANGES.md
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
|
||||
## 2.0.6
|
||||
|
||||
Version 2.0.4 adds support for React Native by clarifying in package.json that
|
||||
the browser environment does not support Node.js domains.
|
||||
Why this is necessary, we leave as an exercise for the user.
|
||||
|
||||
## 2.0.3
|
||||
|
||||
Version 2.0.3 fixes a bug when adjusting the capacity of the task queue.
|
||||
|
||||
## 2.0.1-2.02
|
||||
|
||||
Version 2.0.1 fixes a bug in the way redirects were expressed that affected the
|
||||
function of Browserify, but which Mr would tolerate.
|
||||
|
||||
## 2.0.0
|
||||
|
||||
Version 2 of ASAP is a full rewrite with a few salient changes.
|
||||
First, the ASAP source is CommonJS only and designed with [Browserify][] and
|
||||
[Browserify-compatible][Mr] module loaders in mind.
|
||||
|
||||
[Browserify]: https://github.com/substack/node-browserify
|
||||
[Mr]: https://github.com/montagejs/mr
|
||||
|
||||
The new version has been refactored in two dimensions.
|
||||
Support for Node.js and browsers have been separated, using Browserify
|
||||
redirects and ASAP has been divided into two modules.
|
||||
The "raw" layer depends on the tasks to catch thrown exceptions and unravel
|
||||
Node.js domains.
|
||||
|
||||
The full implementation of ASAP is loadable as `require("asap")` in both Node.js
|
||||
and browsers.
|
||||
|
||||
The raw layer that lacks exception handling overhead is loadable as
|
||||
`require("asap/raw")`.
|
||||
The interface is the same for both layers.
|
||||
|
||||
Tasks are no longer required to be functions, but can rather be any object that
|
||||
implements `task.call()`.
|
||||
With this feature you can recycle task objects to avoid garbage collector churn
|
||||
and avoid closures in general.
|
||||
|
||||
The implementation has been rigorously documented so that our successors can
|
||||
understand the scope of the problem that this module solves and all of its
|
||||
nuances, ensuring that the next generation of implementations know what details
|
||||
are essential.
|
||||
|
||||
- [asap.js](https://github.com/kriskowal/asap/blob/master/asap.js)
|
||||
- [raw.js](https://github.com/kriskowal/asap/blob/master/raw.js)
|
||||
- [browser-asap.js](https://github.com/kriskowal/asap/blob/master/browser-asap.js)
|
||||
- [browser-raw.js](https://github.com/kriskowal/asap/blob/master/browser-raw.js)
|
||||
|
||||
The new version has also been rigorously tested across a broad spectrum of
|
||||
browsers, in both the window and worker context.
|
||||
The following charts capture the browser test results for the most recent
|
||||
release.
|
||||
The first chart shows test results for ASAP running in the main window context.
|
||||
The second chart shows test results for ASAP running in a web worker context.
|
||||
Test results are inconclusive (grey) on browsers that do not support web
|
||||
workers.
|
||||
These data are captured automatically by [Continuous
|
||||
Integration][].
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md
|
||||
|
21
node_modules/asap/LICENSE.md
generated
vendored
Normal file
21
node_modules/asap/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
Copyright 2009–2014 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.
|
||||
|
237
node_modules/asap/README.md
generated
vendored
Normal file
237
node_modules/asap/README.md
generated
vendored
Normal file
@@ -0,0 +1,237 @@
|
||||
# ASAP
|
||||
|
||||
[](https://travis-ci.org/kriskowal/asap)
|
||||
|
||||
Promise and asynchronous observer libraries, as well as hand-rolled callback
|
||||
programs and libraries, often need a mechanism to postpone the execution of a
|
||||
callback until the next available event.
|
||||
(See [Designing API’s for Asynchrony][Zalgo].)
|
||||
The `asap` function executes a task **as soon as possible** but not before it
|
||||
returns, waiting only for the completion of the current event and previously
|
||||
scheduled tasks.
|
||||
|
||||
```javascript
|
||||
asap(function () {
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
[Zalgo]: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony
|
||||
|
||||
This CommonJS package provides an `asap` module that exports a function that
|
||||
executes a task function *as soon as possible*.
|
||||
|
||||
ASAP strives to schedule events to occur before yielding for IO, reflow,
|
||||
or redrawing.
|
||||
Each event receives an independent stack, with only platform code in parent
|
||||
frames and the events run in the order they are scheduled.
|
||||
|
||||
ASAP provides a fast event queue that will execute tasks until it is
|
||||
empty before yielding to the JavaScript engine's underlying event-loop.
|
||||
When a task gets added to a previously empty event queue, ASAP schedules a flush
|
||||
event, preferring for that event to occur before the JavaScript engine has an
|
||||
opportunity to perform IO tasks or rendering, thus making the first task and
|
||||
subsequent tasks semantically indistinguishable.
|
||||
ASAP uses a variety of techniques to preserve this invariant on different
|
||||
versions of browsers and Node.js.
|
||||
|
||||
By design, ASAP prevents input events from being handled until the task
|
||||
queue is empty.
|
||||
If the process is busy enough, this may cause incoming connection requests to be
|
||||
dropped, and may cause existing connections to inform the sender to reduce the
|
||||
transmission rate or stall.
|
||||
ASAP allows this on the theory that, if there is enough work to do, there is no
|
||||
sense in looking for trouble.
|
||||
As a consequence, ASAP can interfere with smooth animation.
|
||||
If your task should be tied to the rendering loop, consider using
|
||||
`requestAnimationFrame` instead.
|
||||
A long sequence of tasks can also effect the long running script dialog.
|
||||
If this is a problem, you may be able to use ASAP’s cousin `setImmediate` to
|
||||
break long processes into shorter intervals and periodically allow the browser
|
||||
to breathe.
|
||||
`setImmediate` will yield for IO, reflow, and repaint events.
|
||||
It also returns a handler and can be canceled.
|
||||
For a `setImmediate` shim, consider [YuzuJS setImmediate][setImmediate].
|
||||
|
||||
[setImmediate]: https://github.com/YuzuJS/setImmediate
|
||||
|
||||
Take care.
|
||||
ASAP can sustain infinite recursive calls without warning.
|
||||
It will not halt from a stack overflow, and it will not consume unbounded
|
||||
memory.
|
||||
This is behaviorally equivalent to an infinite loop.
|
||||
Just as with infinite loops, you can monitor a Node.js process for this behavior
|
||||
with a heart-beat signal.
|
||||
As with infinite loops, a very small amount of caution goes a long way to
|
||||
avoiding problems.
|
||||
|
||||
```javascript
|
||||
function loop() {
|
||||
asap(loop);
|
||||
}
|
||||
loop();
|
||||
```
|
||||
|
||||
In browsers, if a task throws an exception, it will not interrupt the flushing
|
||||
of high-priority tasks.
|
||||
The exception will be postponed to a later, low-priority event to avoid
|
||||
slow-downs.
|
||||
In Node.js, if a task throws an exception, ASAP will resume flushing only if—and
|
||||
only after—the error is handled by `domain.on("error")` or
|
||||
`process.on("uncaughtException")`.
|
||||
|
||||
## Raw ASAP
|
||||
|
||||
Checking for exceptions comes at a cost.
|
||||
The package also provides an `asap/raw` module that exports the underlying
|
||||
implementation which is faster but stalls if a task throws an exception.
|
||||
This internal version of the ASAP function does not check for errors.
|
||||
If a task does throw an error, it will stall the event queue unless you manually
|
||||
call `rawAsap.requestFlush()` before throwing the error, or any time after.
|
||||
|
||||
In Node.js, `asap/raw` also runs all tasks outside any domain.
|
||||
If you need a task to be bound to your domain, you will have to do it manually.
|
||||
|
||||
```js
|
||||
if (process.domain) {
|
||||
task = process.domain.bind(task);
|
||||
}
|
||||
rawAsap(task);
|
||||
```
|
||||
|
||||
## Tasks
|
||||
|
||||
A task may be any object that implements `call()`.
|
||||
A function will suffice, but closures tend not to be reusable and can cause
|
||||
garbage collector churn.
|
||||
Both `asap` and `rawAsap` accept task objects to give you the option of
|
||||
recycling task objects or using higher callable object abstractions.
|
||||
See the `asap` source for an illustration.
|
||||
|
||||
|
||||
## Compatibility
|
||||
|
||||
ASAP is tested on Node.js v0.10 and in a broad spectrum of web browsers.
|
||||
The following charts capture the browser test results for the most recent
|
||||
release.
|
||||
The first chart shows test results for ASAP running in the main window context.
|
||||
The second chart shows test results for ASAP running in a web worker context.
|
||||
Test results are inconclusive (grey) on browsers that do not support web
|
||||
workers.
|
||||
These data are captured automatically by [Continuous
|
||||
Integration][].
|
||||
|
||||
[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## Caveats
|
||||
|
||||
When a task is added to an empty event queue, it is not always possible to
|
||||
guarantee that the task queue will begin flushing immediately after the current
|
||||
event.
|
||||
However, once the task queue begins flushing, it will not yield until the queue
|
||||
is empty, even if the queue grows while executing tasks.
|
||||
|
||||
The following browsers allow the use of [DOM mutation observers][] to access
|
||||
the HTML [microtask queue][], and thus begin flushing ASAP's task queue
|
||||
immediately at the end of the current event loop turn, before any rendering or
|
||||
IO:
|
||||
|
||||
[microtask queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#microtask-queue
|
||||
[DOM mutation observers]: http://dom.spec.whatwg.org/#mutation-observers
|
||||
|
||||
- Android 4–4.3
|
||||
- Chrome 26–34
|
||||
- Firefox 14–29
|
||||
- Internet Explorer 11
|
||||
- iPad Safari 6–7.1
|
||||
- iPhone Safari 7–7.1
|
||||
- Safari 6–7
|
||||
|
||||
In the absense of mutation observers, there are a few browsers, and situations
|
||||
like web workers in some of the above browsers, where [message channels][]
|
||||
would be a useful way to avoid falling back to timers.
|
||||
Message channels give direct access to the HTML [task queue][], so the ASAP
|
||||
task queue would flush after any already queued rendering and IO tasks, but
|
||||
without having the minimum delay imposed by timers.
|
||||
However, among these browsers, Internet Explorer 10 and Safari do not reliably
|
||||
dispatch messages, so they are not worth the trouble to implement.
|
||||
|
||||
[message channels]: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#message-channels
|
||||
[task queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task
|
||||
|
||||
- Internet Explorer 10
|
||||
- Safair 5.0-1
|
||||
- Opera 11-12
|
||||
|
||||
In the absense of mutation observers, these browsers and the following browsers
|
||||
all fall back to using `setTimeout` and `setInterval` to ensure that a `flush`
|
||||
occurs.
|
||||
The implementation uses both and cancels whatever handler loses the race, since
|
||||
`setTimeout` tends to occasionally skip tasks in unisolated circumstances.
|
||||
Timers generally delay the flushing of ASAP's task queue for four milliseconds.
|
||||
|
||||
- Firefox 3–13
|
||||
- Internet Explorer 6–10
|
||||
- iPad Safari 4.3
|
||||
- Lynx 2.8.7
|
||||
|
||||
|
||||
## Heritage
|
||||
|
||||
ASAP has been factored out of the [Q][] asynchronous promise library.
|
||||
It originally had a naïve implementation in terms of `setTimeout`, but
|
||||
[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be
|
||||
useful for creating a high-priority, no-delay event dispatch hack.
|
||||
Since then, Internet Explorer proposed and implemented `setImmediate`.
|
||||
Robert Katić began contributing to Q by measuring the performance of
|
||||
the internal implementation of `asap`, paying particular attention to
|
||||
error recovery.
|
||||
Domenic, Robert, and Kris Kowal collectively settled on the current strategy of
|
||||
unrolling the high-priority event queue internally regardless of what strategy
|
||||
we used to dispatch the potentially lower-priority flush event.
|
||||
Domenic went on to make ASAP cooperate with Node.js domains.
|
||||
|
||||
[Q]: https://github.com/kriskowal/q
|
||||
[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html
|
||||
|
||||
For further reading, Nicholas Zakas provided a thorough article on [The
|
||||
Case for setImmediate][NCZ].
|
||||
|
||||
[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/
|
||||
|
||||
Ember’s RSVP promise implementation later [adopted][RSVP ASAP] the name ASAP but
|
||||
further developed the implentation.
|
||||
Particularly, The `MessagePort` implementation was abandoned due to interaction
|
||||
[problems with Mobile Internet Explorer][IE Problems] in favor of an
|
||||
implementation backed on the newer and more reliable DOM `MutationObserver`
|
||||
interface.
|
||||
These changes were back-ported into this library.
|
||||
|
||||
[IE Problems]: https://github.com/cujojs/when/issues/197
|
||||
[RSVP ASAP]: https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
|
||||
|
||||
In addition, ASAP factored into `asap` and `asap/raw`, such that `asap` remained
|
||||
exception-safe, but `asap/raw` provided a tight kernel that could be used for
|
||||
tasks that guaranteed that they would not throw exceptions.
|
||||
This core is useful for promise implementations that capture thrown errors in
|
||||
rejected promises and do not need a second safety net.
|
||||
At the same time, the exception handling in `asap` was factored into separate
|
||||
implementations for Node.js and browsers, using the the [Browserify][Browser
|
||||
Config] `browser` property in `package.json` to instruct browser module loaders
|
||||
and bundlers, including [Browserify][], [Mr][], and [Mop][], to use the
|
||||
browser-only implementation.
|
||||
|
||||
[Browser Config]: https://gist.github.com/defunctzombie/4339901
|
||||
[Browserify]: https://github.com/substack/node-browserify
|
||||
[Mr]: https://github.com/montagejs/mr
|
||||
[Mop]: https://github.com/montagejs/mop
|
||||
|
||||
## License
|
||||
|
||||
Copyright 2009-2014 by Contributors
|
||||
MIT License (enclosed)
|
||||
|
65
node_modules/asap/asap.js
generated
vendored
Normal file
65
node_modules/asap/asap.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
|
||||
var rawAsap = require("./raw");
|
||||
var freeTasks = [];
|
||||
|
||||
/**
|
||||
* Calls a task as soon as possible after returning, in its own event, with
|
||||
* priority over IO events. An exception thrown in a task can be handled by
|
||||
* `process.on("uncaughtException") or `domain.on("error")`, but will otherwise
|
||||
* crash the process. If the error is handled, all subsequent tasks will
|
||||
* resume.
|
||||
*
|
||||
* @param {{call}} task A callable object, typically a function that takes no
|
||||
* arguments.
|
||||
*/
|
||||
module.exports = asap;
|
||||
function asap(task) {
|
||||
var rawTask;
|
||||
if (freeTasks.length) {
|
||||
rawTask = freeTasks.pop();
|
||||
} else {
|
||||
rawTask = new RawTask();
|
||||
}
|
||||
rawTask.task = task;
|
||||
rawTask.domain = process.domain;
|
||||
rawAsap(rawTask);
|
||||
}
|
||||
|
||||
function RawTask() {
|
||||
this.task = null;
|
||||
this.domain = null;
|
||||
}
|
||||
|
||||
RawTask.prototype.call = function () {
|
||||
if (this.domain) {
|
||||
this.domain.enter();
|
||||
}
|
||||
var threw = true;
|
||||
try {
|
||||
this.task.call();
|
||||
threw = false;
|
||||
// If the task throws an exception (presumably) Node.js restores the
|
||||
// domain stack for the next event.
|
||||
if (this.domain) {
|
||||
this.domain.exit();
|
||||
}
|
||||
} finally {
|
||||
// We use try/finally and a threw flag to avoid messing up stack traces
|
||||
// when we catch and release errors.
|
||||
if (threw) {
|
||||
// In Node.js, uncaught exceptions are considered fatal errors.
|
||||
// Re-throw them to interrupt flushing!
|
||||
// Ensure that flushing continues if an uncaught exception is
|
||||
// suppressed listening process.on("uncaughtException") or
|
||||
// domain.on("error").
|
||||
rawAsap.requestFlush();
|
||||
}
|
||||
// If the task threw an error, we do not want to exit the domain here.
|
||||
// Exiting the domain would prevent the domain from catching the error.
|
||||
this.task = null;
|
||||
this.domain = null;
|
||||
freeTasks.push(this);
|
||||
}
|
||||
};
|
||||
|
66
node_modules/asap/browser-asap.js
generated
vendored
Normal file
66
node_modules/asap/browser-asap.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
"use strict";
|
||||
|
||||
// rawAsap provides everything we need except exception management.
|
||||
var rawAsap = require("./raw");
|
||||
// RawTasks are recycled to reduce GC churn.
|
||||
var freeTasks = [];
|
||||
// We queue errors to ensure they are thrown in right order (FIFO).
|
||||
// Array-as-queue is good enough here, since we are just dealing with exceptions.
|
||||
var pendingErrors = [];
|
||||
var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);
|
||||
|
||||
function throwFirstError() {
|
||||
if (pendingErrors.length) {
|
||||
throw pendingErrors.shift();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls a task as soon as possible after returning, in its own event, with priority
|
||||
* over other events like animation, reflow, and repaint. An error thrown from an
|
||||
* event will not interrupt, nor even substantially slow down the processing of
|
||||
* other events, but will be rather postponed to a lower priority event.
|
||||
* @param {{call}} task A callable object, typically a function that takes no
|
||||
* arguments.
|
||||
*/
|
||||
module.exports = asap;
|
||||
function asap(task) {
|
||||
var rawTask;
|
||||
if (freeTasks.length) {
|
||||
rawTask = freeTasks.pop();
|
||||
} else {
|
||||
rawTask = new RawTask();
|
||||
}
|
||||
rawTask.task = task;
|
||||
rawAsap(rawTask);
|
||||
}
|
||||
|
||||
// We wrap tasks with recyclable task objects. A task object implements
|
||||
// `call`, just like a function.
|
||||
function RawTask() {
|
||||
this.task = null;
|
||||
}
|
||||
|
||||
// The sole purpose of wrapping the task is to catch the exception and recycle
|
||||
// the task object after its single use.
|
||||
RawTask.prototype.call = function () {
|
||||
try {
|
||||
this.task.call();
|
||||
} catch (error) {
|
||||
if (asap.onerror) {
|
||||
// This hook exists purely for testing purposes.
|
||||
// Its name will be periodically randomized to break any code that
|
||||
// depends on its existence.
|
||||
asap.onerror(error);
|
||||
} else {
|
||||
// In a web browser, exceptions are not fatal. However, to avoid
|
||||
// slowing down the queue of pending tasks, we rethrow the error in a
|
||||
// lower priority turn.
|
||||
pendingErrors.push(error);
|
||||
requestErrorThrow();
|
||||
}
|
||||
} finally {
|
||||
this.task = null;
|
||||
freeTasks[freeTasks.length] = this;
|
||||
}
|
||||
};
|
223
node_modules/asap/browser-raw.js
generated
vendored
Normal file
223
node_modules/asap/browser-raw.js
generated
vendored
Normal file
@@ -0,0 +1,223 @@
|
||||
"use strict";
|
||||
|
||||
// Use the fastest means possible to execute a task in its own turn, with
|
||||
// priority over other events including IO, animation, reflow, and redraw
|
||||
// events in browsers.
|
||||
//
|
||||
// An exception thrown by a task will permanently interrupt the processing of
|
||||
// subsequent tasks. The higher level `asap` function ensures that if an
|
||||
// exception is thrown by a task, that the task queue will continue flushing as
|
||||
// soon as possible, but if you use `rawAsap` directly, you are responsible to
|
||||
// either ensure that no exceptions are thrown from your task, or to manually
|
||||
// call `rawAsap.requestFlush` if an exception is thrown.
|
||||
module.exports = rawAsap;
|
||||
function rawAsap(task) {
|
||||
if (!queue.length) {
|
||||
requestFlush();
|
||||
flushing = true;
|
||||
}
|
||||
// Equivalent to push, but avoids a function call.
|
||||
queue[queue.length] = task;
|
||||
}
|
||||
|
||||
var queue = [];
|
||||
// Once a flush has been requested, no further calls to `requestFlush` are
|
||||
// necessary until the next `flush` completes.
|
||||
var flushing = false;
|
||||
// `requestFlush` is an implementation-specific method that attempts to kick
|
||||
// off a `flush` event as quickly as possible. `flush` will attempt to exhaust
|
||||
// the event queue before yielding to the browser's own event loop.
|
||||
var requestFlush;
|
||||
// The position of the next task to execute in the task queue. This is
|
||||
// preserved between calls to `flush` so that it can be resumed if
|
||||
// a task throws an exception.
|
||||
var index = 0;
|
||||
// If a task schedules additional tasks recursively, the task queue can grow
|
||||
// unbounded. To prevent memory exhaustion, the task queue will periodically
|
||||
// truncate already-completed tasks.
|
||||
var capacity = 1024;
|
||||
|
||||
// The flush function processes all tasks that have been scheduled with
|
||||
// `rawAsap` unless and until one of those tasks throws an exception.
|
||||
// If a task throws an exception, `flush` ensures that its state will remain
|
||||
// consistent and will resume where it left off when called again.
|
||||
// However, `flush` does not make any arrangements to be called again if an
|
||||
// exception is thrown.
|
||||
function flush() {
|
||||
while (index < queue.length) {
|
||||
var currentIndex = index;
|
||||
// Advance the index before calling the task. This ensures that we will
|
||||
// begin flushing on the next task the task throws an error.
|
||||
index = index + 1;
|
||||
queue[currentIndex].call();
|
||||
// Prevent leaking memory for long chains of recursive calls to `asap`.
|
||||
// If we call `asap` within tasks scheduled by `asap`, the queue will
|
||||
// grow, but to avoid an O(n) walk for every task we execute, we don't
|
||||
// shift tasks off the queue after they have been executed.
|
||||
// Instead, we periodically shift 1024 tasks off the queue.
|
||||
if (index > capacity) {
|
||||
// Manually shift all values starting at the index back to the
|
||||
// beginning of the queue.
|
||||
for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
|
||||
queue[scan] = queue[scan + index];
|
||||
}
|
||||
queue.length -= index;
|
||||
index = 0;
|
||||
}
|
||||
}
|
||||
queue.length = 0;
|
||||
index = 0;
|
||||
flushing = false;
|
||||
}
|
||||
|
||||
// `requestFlush` is implemented using a strategy based on data collected from
|
||||
// every available SauceLabs Selenium web driver worker at time of writing.
|
||||
// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593
|
||||
|
||||
// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that
|
||||
// have WebKitMutationObserver but not un-prefixed MutationObserver.
|
||||
// Must use `global` or `self` instead of `window` to work in both frames and web
|
||||
// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.
|
||||
|
||||
/* globals self */
|
||||
var scope = typeof global !== "undefined" ? global : self;
|
||||
var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;
|
||||
|
||||
// MutationObservers are desirable because they have high priority and work
|
||||
// reliably everywhere they are implemented.
|
||||
// They are implemented in all modern browsers.
|
||||
//
|
||||
// - Android 4-4.3
|
||||
// - Chrome 26-34
|
||||
// - Firefox 14-29
|
||||
// - Internet Explorer 11
|
||||
// - iPad Safari 6-7.1
|
||||
// - iPhone Safari 7-7.1
|
||||
// - Safari 6-7
|
||||
if (typeof BrowserMutationObserver === "function") {
|
||||
requestFlush = makeRequestCallFromMutationObserver(flush);
|
||||
|
||||
// MessageChannels are desirable because they give direct access to the HTML
|
||||
// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera
|
||||
// 11-12, and in web workers in many engines.
|
||||
// Although message channels yield to any queued rendering and IO tasks, they
|
||||
// would be better than imposing the 4ms delay of timers.
|
||||
// However, they do not work reliably in Internet Explorer or Safari.
|
||||
|
||||
// Internet Explorer 10 is the only browser that has setImmediate but does
|
||||
// not have MutationObservers.
|
||||
// Although setImmediate yields to the browser's renderer, it would be
|
||||
// preferrable to falling back to setTimeout since it does not have
|
||||
// the minimum 4ms penalty.
|
||||
// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and
|
||||
// Desktop to a lesser extent) that renders both setImmediate and
|
||||
// MessageChannel useless for the purposes of ASAP.
|
||||
// https://github.com/kriskowal/q/issues/396
|
||||
|
||||
// Timers are implemented universally.
|
||||
// We fall back to timers in workers in most engines, and in foreground
|
||||
// contexts in the following browsers.
|
||||
// However, note that even this simple case requires nuances to operate in a
|
||||
// broad spectrum of browsers.
|
||||
//
|
||||
// - Firefox 3-13
|
||||
// - Internet Explorer 6-9
|
||||
// - iPad Safari 4.3
|
||||
// - Lynx 2.8.7
|
||||
} else {
|
||||
requestFlush = makeRequestCallFromTimer(flush);
|
||||
}
|
||||
|
||||
// `requestFlush` requests that the high priority event queue be flushed as
|
||||
// soon as possible.
|
||||
// This is useful to prevent an error thrown in a task from stalling the event
|
||||
// queue if the exception handled by Node.js’s
|
||||
// `process.on("uncaughtException")` or by a domain.
|
||||
rawAsap.requestFlush = requestFlush;
|
||||
|
||||
// To request a high priority event, we induce a mutation observer by toggling
|
||||
// the text of a text node between "1" and "-1".
|
||||
function makeRequestCallFromMutationObserver(callback) {
|
||||
var toggle = 1;
|
||||
var observer = new BrowserMutationObserver(callback);
|
||||
var node = document.createTextNode("");
|
||||
observer.observe(node, {characterData: true});
|
||||
return function requestCall() {
|
||||
toggle = -toggle;
|
||||
node.data = toggle;
|
||||
};
|
||||
}
|
||||
|
||||
// The message channel technique was discovered by Malte Ubl and was the
|
||||
// original foundation for this library.
|
||||
// http://www.nonblocking.io/2011/06/windownexttick.html
|
||||
|
||||
// Safari 6.0.5 (at least) intermittently fails to create message ports on a
|
||||
// page's first load. Thankfully, this version of Safari supports
|
||||
// MutationObservers, so we don't need to fall back in that case.
|
||||
|
||||
// function makeRequestCallFromMessageChannel(callback) {
|
||||
// var channel = new MessageChannel();
|
||||
// channel.port1.onmessage = callback;
|
||||
// return function requestCall() {
|
||||
// channel.port2.postMessage(0);
|
||||
// };
|
||||
// }
|
||||
|
||||
// For reasons explained above, we are also unable to use `setImmediate`
|
||||
// under any circumstances.
|
||||
// Even if we were, there is another bug in Internet Explorer 10.
|
||||
// It is not sufficient to assign `setImmediate` to `requestFlush` because
|
||||
// `setImmediate` must be called *by name* and therefore must be wrapped in a
|
||||
// closure.
|
||||
// Never forget.
|
||||
|
||||
// function makeRequestCallFromSetImmediate(callback) {
|
||||
// return function requestCall() {
|
||||
// setImmediate(callback);
|
||||
// };
|
||||
// }
|
||||
|
||||
// Safari 6.0 has a problem where timers will get lost while the user is
|
||||
// scrolling. This problem does not impact ASAP because Safari 6.0 supports
|
||||
// mutation observers, so that implementation is used instead.
|
||||
// However, if we ever elect to use timers in Safari, the prevalent work-around
|
||||
// is to add a scroll event listener that calls for a flush.
|
||||
|
||||
// `setTimeout` does not call the passed callback if the delay is less than
|
||||
// approximately 7 in web workers in Firefox 8 through 18, and sometimes not
|
||||
// even then.
|
||||
|
||||
function makeRequestCallFromTimer(callback) {
|
||||
return function requestCall() {
|
||||
// We dispatch a timeout with a specified delay of 0 for engines that
|
||||
// can reliably accommodate that request. This will usually be snapped
|
||||
// to a 4 milisecond delay, but once we're flushing, there's no delay
|
||||
// between events.
|
||||
var timeoutHandle = setTimeout(handleTimer, 0);
|
||||
// However, since this timer gets frequently dropped in Firefox
|
||||
// workers, we enlist an interval handle that will try to fire
|
||||
// an event 20 times per second until it succeeds.
|
||||
var intervalHandle = setInterval(handleTimer, 50);
|
||||
|
||||
function handleTimer() {
|
||||
// Whichever timer succeeds will cancel both timers and
|
||||
// execute the callback.
|
||||
clearTimeout(timeoutHandle);
|
||||
clearInterval(intervalHandle);
|
||||
callback();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// This is for `asap.js` only.
|
||||
// Its name will be periodically randomized to break any code that depends on
|
||||
// its existence.
|
||||
rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;
|
||||
|
||||
// ASAP was originally a nextTick shim included in Q. This was factored out
|
||||
// into this ASAP package. It was later adapted to RSVP which made further
|
||||
// amendments. These decisions, particularly to marginalize MessageChannel and
|
||||
// to capture the MutationObserver implementation in a closure, were integrated
|
||||
// back into ASAP proper.
|
||||
// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
|
119
node_modules/asap/package.json
generated
vendored
Normal file
119
node_modules/asap/package.json
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"asap@~2.0.3",
|
||||
"/home/beppe/Github/yahooApi/node_modules/promise"
|
||||
]
|
||||
],
|
||||
"_from": "asap@>=2.0.3 <2.1.0",
|
||||
"_id": "asap@2.0.6",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/asap",
|
||||
"_nodeVersion": "6.9.5",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/asap-2.0.6.tgz_1499700096673_0.1125483822543174"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "kris.kowal@cixar.com",
|
||||
"name": "kriskowal"
|
||||
},
|
||||
"_npmVersion": "3.10.10",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "asap",
|
||||
"raw": "asap@~2.0.3",
|
||||
"rawSpec": "~2.0.3",
|
||||
"scope": null,
|
||||
"spec": ">=2.0.3 <2.1.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/promise"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
|
||||
"_shasum": "e50347611d7e690943208bbdafebcbc2fb866d46",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "asap@~2.0.3",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/promise",
|
||||
"browser": {
|
||||
"./asap": "./browser-asap.js",
|
||||
"./asap.js": "./browser-asap.js",
|
||||
"./raw": "./browser-raw.js",
|
||||
"./raw.js": "./browser-raw.js",
|
||||
"./test/domain.js": "./test/browser-domain.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kriskowal/asap/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "High-priority task queue for Node.js and browsers",
|
||||
"devDependencies": {
|
||||
"benchmark": "^1.0.0",
|
||||
"events": "^1.0.1",
|
||||
"jshint": "^2.5.1",
|
||||
"knox": "^0.8.10",
|
||||
"mr": "^2.0.5",
|
||||
"opener": "^1.3.0",
|
||||
"q": "^2.0.3",
|
||||
"q-io": "^2.0.3",
|
||||
"saucelabs": "^0.1.1",
|
||||
"wd": "^0.2.21",
|
||||
"weak-map": "^1.0.5"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "e50347611d7e690943208bbdafebcbc2fb866d46",
|
||||
"tarball": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz"
|
||||
},
|
||||
"files": [
|
||||
"asap.js",
|
||||
"browser-asap.js",
|
||||
"browser-raw.js",
|
||||
"raw.js"
|
||||
],
|
||||
"gitHead": "3e3d99381444379bb0483cb9216caa39ac67bebb",
|
||||
"homepage": "https://github.com/kriskowal/asap#readme",
|
||||
"keywords": [
|
||||
"event",
|
||||
"queue",
|
||||
"task"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./asap.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "kriskowal",
|
||||
"email": "kris.kowal@cixar.com"
|
||||
},
|
||||
{
|
||||
"name": "forbeslindesay",
|
||||
"email": "forbes@lindesay.co.uk"
|
||||
}
|
||||
],
|
||||
"name": "asap",
|
||||
"optionalDependencies": {},
|
||||
"react-native": {
|
||||
"domain": false
|
||||
},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kriskowal/asap.git"
|
||||
},
|
||||
"scripts": {
|
||||
"benchmarks": "node benchmarks",
|
||||
"lint": "jshint raw.js asap.js browser-raw.js browser-asap.js $(find scripts -name '*.js' | grep -v gauntlet)",
|
||||
"test": "npm run lint && npm run test-node",
|
||||
"test-browser": "node scripts/publish-bundle.js test/asap-test.js | xargs opener",
|
||||
"test-node": "node test/asap-test.js",
|
||||
"test-publish": "node scripts/publish-bundle.js test/asap-test.js | pbcopy",
|
||||
"test-saucelabs": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-spot-configurations.json",
|
||||
"test-saucelabs-all": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-all-configurations.json",
|
||||
"test-saucelabs-worker": "node scripts/saucelabs-worker-test.js scripts/saucelabs-spot-configurations.json",
|
||||
"test-saucelabs-worker-all": "node scripts/saucelabs-worker-test.js scripts/saucelabs-all-configurations.json",
|
||||
"test-travis": "npm run lint && npm run test-node && npm run test-saucelabs && npm run test-saucelabs-worker"
|
||||
},
|
||||
"version": "2.0.6"
|
||||
}
|
101
node_modules/asap/raw.js
generated
vendored
Normal file
101
node_modules/asap/raw.js
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
"use strict";
|
||||
|
||||
var domain; // The domain module is executed on demand
|
||||
var hasSetImmediate = typeof setImmediate === "function";
|
||||
|
||||
// Use the fastest means possible to execute a task in its own turn, with
|
||||
// priority over other events including network IO events in Node.js.
|
||||
//
|
||||
// An exception thrown by a task will permanently interrupt the processing of
|
||||
// subsequent tasks. The higher level `asap` function ensures that if an
|
||||
// exception is thrown by a task, that the task queue will continue flushing as
|
||||
// soon as possible, but if you use `rawAsap` directly, you are responsible to
|
||||
// either ensure that no exceptions are thrown from your task, or to manually
|
||||
// call `rawAsap.requestFlush` if an exception is thrown.
|
||||
module.exports = rawAsap;
|
||||
function rawAsap(task) {
|
||||
if (!queue.length) {
|
||||
requestFlush();
|
||||
flushing = true;
|
||||
}
|
||||
// Avoids a function call
|
||||
queue[queue.length] = task;
|
||||
}
|
||||
|
||||
var queue = [];
|
||||
// Once a flush has been requested, no further calls to `requestFlush` are
|
||||
// necessary until the next `flush` completes.
|
||||
var flushing = false;
|
||||
// The position of the next task to execute in the task queue. This is
|
||||
// preserved between calls to `flush` so that it can be resumed if
|
||||
// a task throws an exception.
|
||||
var index = 0;
|
||||
// If a task schedules additional tasks recursively, the task queue can grow
|
||||
// unbounded. To prevent memory excaustion, the task queue will periodically
|
||||
// truncate already-completed tasks.
|
||||
var capacity = 1024;
|
||||
|
||||
// The flush function processes all tasks that have been scheduled with
|
||||
// `rawAsap` unless and until one of those tasks throws an exception.
|
||||
// If a task throws an exception, `flush` ensures that its state will remain
|
||||
// consistent and will resume where it left off when called again.
|
||||
// However, `flush` does not make any arrangements to be called again if an
|
||||
// exception is thrown.
|
||||
function flush() {
|
||||
while (index < queue.length) {
|
||||
var currentIndex = index;
|
||||
// Advance the index before calling the task. This ensures that we will
|
||||
// begin flushing on the next task the task throws an error.
|
||||
index = index + 1;
|
||||
queue[currentIndex].call();
|
||||
// Prevent leaking memory for long chains of recursive calls to `asap`.
|
||||
// If we call `asap` within tasks scheduled by `asap`, the queue will
|
||||
// grow, but to avoid an O(n) walk for every task we execute, we don't
|
||||
// shift tasks off the queue after they have been executed.
|
||||
// Instead, we periodically shift 1024 tasks off the queue.
|
||||
if (index > capacity) {
|
||||
// Manually shift all values starting at the index back to the
|
||||
// beginning of the queue.
|
||||
for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
|
||||
queue[scan] = queue[scan + index];
|
||||
}
|
||||
queue.length -= index;
|
||||
index = 0;
|
||||
}
|
||||
}
|
||||
queue.length = 0;
|
||||
index = 0;
|
||||
flushing = false;
|
||||
}
|
||||
|
||||
rawAsap.requestFlush = requestFlush;
|
||||
function requestFlush() {
|
||||
// Ensure flushing is not bound to any domain.
|
||||
// It is not sufficient to exit the domain, because domains exist on a stack.
|
||||
// To execute code outside of any domain, the following dance is necessary.
|
||||
var parentDomain = process.domain;
|
||||
if (parentDomain) {
|
||||
if (!domain) {
|
||||
// Lazy execute the domain module.
|
||||
// Only employed if the user elects to use domains.
|
||||
domain = require("domain");
|
||||
}
|
||||
domain.active = process.domain = null;
|
||||
}
|
||||
|
||||
// `setImmediate` is slower that `process.nextTick`, but `process.nextTick`
|
||||
// cannot handle recursion.
|
||||
// `requestFlush` will only be called recursively from `asap.js`, to resume
|
||||
// flushing after an error is thrown into a domain.
|
||||
// Conveniently, `setImmediate` was introduced in the same version
|
||||
// `process.nextTick` started throwing recursion errors.
|
||||
if (flushing && hasSetImmediate) {
|
||||
setImmediate(flush);
|
||||
} else {
|
||||
process.nextTick(flush);
|
||||
}
|
||||
|
||||
if (parentDomain) {
|
||||
domain.active = process.domain = parentDomain;
|
||||
}
|
||||
}
|
21
node_modules/assign-symbols/LICENSE
generated
vendored
Normal file
21
node_modules/assign-symbols/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015, Jon Schlinkert.
|
||||
|
||||
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.
|
73
node_modules/assign-symbols/README.md
generated
vendored
Normal file
73
node_modules/assign-symbols/README.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# assign-symbols [](http://badge.fury.io/js/assign-symbols)
|
||||
|
||||
> Assign the enumerable es6 Symbol properties from an object (or objects) to the first object passed on the arguments. Can be used as a supplement to other extend, assign or merge methods as a polyfill for the Symbols part of the es6 Object.assign method.
|
||||
|
||||
From the [Mozilla Developer docs for Symbol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol):
|
||||
|
||||
> A symbol is a unique and immutable data type and may be used as an identifier for object properties. The symbol object is an implicit object wrapper for the symbol primitive data type.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/)
|
||||
|
||||
```sh
|
||||
$ npm i assign-symbols --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var assignSymbols = require('assign-symbols');
|
||||
var obj = {};
|
||||
|
||||
var one = {};
|
||||
var symbolOne = Symbol('aaa');
|
||||
one[symbolOne] = 'bbb';
|
||||
|
||||
var two = {};
|
||||
var symbolTwo = Symbol('ccc');
|
||||
two[symbolTwo] = 'ddd';
|
||||
|
||||
assignSymbols(obj, one, two);
|
||||
|
||||
console.log(obj[symbolOne]);
|
||||
//=> 'bbb'
|
||||
console.log(obj[symbolTwo]);
|
||||
//=> 'ddd'
|
||||
```
|
||||
|
||||
## Similar projects
|
||||
|
||||
* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties of source objects to a destination object. | [homepage](https://github.com/jonschlinkert/assign-deep)
|
||||
* [clone-deep](https://www.npmjs.com/package/clone-deep): Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives. | [homepage](https://github.com/jonschlinkert/clone-deep)
|
||||
* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow)
|
||||
* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep)
|
||||
* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep)
|
||||
|
||||
## Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm i -d && npm test
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/assign-symbols/issues/new).
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2015 Jon Schlinkert
|
||||
Released under the MIT license.
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 06, 2015._
|
40
node_modules/assign-symbols/index.js
generated
vendored
Normal file
40
node_modules/assign-symbols/index.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/*!
|
||||
* assign-symbols <https://github.com/jonschlinkert/assign-symbols>
|
||||
*
|
||||
* Copyright (c) 2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function(receiver, objects) {
|
||||
if (receiver === null || typeof receiver === 'undefined') {
|
||||
throw new TypeError('expected first argument to be an object.');
|
||||
}
|
||||
|
||||
if (typeof objects === 'undefined' || typeof Symbol === 'undefined') {
|
||||
return receiver;
|
||||
}
|
||||
|
||||
if (typeof Object.getOwnPropertySymbols !== 'function') {
|
||||
return receiver;
|
||||
}
|
||||
|
||||
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
var target = Object(receiver);
|
||||
var len = arguments.length, i = 0;
|
||||
|
||||
while (++i < len) {
|
||||
var provider = Object(arguments[i]);
|
||||
var names = Object.getOwnPropertySymbols(provider);
|
||||
|
||||
for (var j = 0; j < names.length; j++) {
|
||||
var key = names[j];
|
||||
|
||||
if (isEnumerable.call(provider, key)) {
|
||||
target[key] = provider[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
};
|
103
node_modules/assign-symbols/package.json
generated
vendored
Normal file
103
node_modules/assign-symbols/package.json
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"assign-symbols@^1.0.0",
|
||||
"/home/beppe/Github/yahooApi/node_modules/extend-shallow"
|
||||
]
|
||||
],
|
||||
"_from": "assign-symbols@>=1.0.0 <2.0.0",
|
||||
"_id": "assign-symbols@1.0.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/assign-symbols",
|
||||
"_nodeVersion": "0.12.18",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/assign-symbols-1.0.0.tgz_1513723533378_0.7385613690130413"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "blaine.bublitz@gmail.com",
|
||||
"name": "phated"
|
||||
},
|
||||
"_npmVersion": "2.15.11",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "assign-symbols",
|
||||
"raw": "assign-symbols@^1.0.0",
|
||||
"rawSpec": "^1.0.0",
|
||||
"scope": null,
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/extend-shallow"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
|
||||
"_shasum": "59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "assign-symbols@^1.0.0",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/extend-shallow",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/assign-symbols/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Assign the enumerable es6 Symbol properties from an object (or objects) to the first object passed on the arguments. Can be used as a supplement to other extend, assign or merge methods as a polyfill for the Symbols part of the es6 Object.assign method.",
|
||||
"devDependencies": {
|
||||
"mocha": "^3.0.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367",
|
||||
"tarball": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "2df01f26fce8359fa75688eb89e2a1c65de6f237",
|
||||
"homepage": "https://github.com/jonschlinkert/assign-symbols",
|
||||
"keywords": [
|
||||
"assign",
|
||||
"symbols"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "phated",
|
||||
"email": "blaine.bublitz@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "jonschlinkert",
|
||||
"email": "github@sellside.com"
|
||||
}
|
||||
],
|
||||
"name": "assign-symbols",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jonschlinkert/assign-symbols.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"verb": {
|
||||
"related": {
|
||||
"list": [
|
||||
"assign-deep",
|
||||
"clone-deep",
|
||||
"extend-shallow",
|
||||
"merge-deep",
|
||||
"mixin-deep"
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
3
node_modules/async-each/.npmignore
generated
vendored
Normal file
3
node_modules/async-each/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
bower.json
|
||||
component.json
|
||||
CHANGELOG.md
|
23
node_modules/async-each/CHANGELOG.md
generated
vendored
Normal file
23
node_modules/async-each/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# async-each 1.0.0 (26 November 2015)
|
||||
* Bumped version to 1.0.0 (no functional changes)
|
||||
|
||||
# async-each 0.1.6 (5 November 2014)
|
||||
* Add license to package.json
|
||||
|
||||
# async-each 0.1.5 (22 October 2014)
|
||||
* Clean up package.json to fix npm warning about `repo`
|
||||
|
||||
# async-each 0.1.4 (12 November 2013)
|
||||
* Fixed AMD definition.
|
||||
|
||||
# async-each 0.1.3 (25 July 2013)
|
||||
* Fixed double wrapping of errors.
|
||||
|
||||
# async-each 0.1.2 (7 July 2013)
|
||||
* Fixed behaviour on empty arrays.
|
||||
|
||||
# async-each 0.1.1 (14 June 2013)
|
||||
* Wrapped function in closure, enabled strict mode.
|
||||
|
||||
# async-each 0.1.0 (14 June 2013)
|
||||
* Initial release.
|
38
node_modules/async-each/README.md
generated
vendored
Normal file
38
node_modules/async-each/README.md
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# async-each
|
||||
|
||||
No-bullshit, ultra-simple, 35-lines-of-code async parallel forEach function for JavaScript.
|
||||
|
||||
We don't need junky 30K async libs. Really.
|
||||
|
||||
For browsers and node.js.
|
||||
|
||||
## Installation
|
||||
* Just include async-each before your scripts.
|
||||
* `npm install async-each` if you’re using node.js.
|
||||
* `bower install async-each` if you’re using [Bower](http://bower.io).
|
||||
|
||||
## Usage
|
||||
|
||||
* `each(array, iterator, callback);` — `Array`, `Function`, `(optional) Function`
|
||||
* `iterator(item, next)` receives current item and a callback that will mark the item as done. `next` callback receives optional `error, transformedItem` arguments.
|
||||
* `callback(error, transformedArray)` optionally receives first error and transformed result `Array`.
|
||||
|
||||
Node.js:
|
||||
|
||||
```javascript
|
||||
var each = require('async-each');
|
||||
each(['a.js', 'b.js', 'c.js'], fs.readFile, function(error, contents) {
|
||||
if (error) console.error(error);
|
||||
console.log('Contents for a, b and c:', contents);
|
||||
});
|
||||
```
|
||||
|
||||
Browser:
|
||||
|
||||
```javascript
|
||||
window.asyncEach(list, fn, callback);
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[The MIT License](https://raw.githubusercontent.com/paulmillr/mit/master/README.md)
|
38
node_modules/async-each/index.js
generated
vendored
Normal file
38
node_modules/async-each/index.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// async-each MIT license (by Paul Miller from http://paulmillr.com).
|
||||
(function(globals) {
|
||||
'use strict';
|
||||
var each = function(items, next, callback) {
|
||||
if (!Array.isArray(items)) throw new TypeError('each() expects array as first argument');
|
||||
if (typeof next !== 'function') throw new TypeError('each() expects function as second argument');
|
||||
if (typeof callback !== 'function') callback = Function.prototype; // no-op
|
||||
|
||||
if (items.length === 0) return callback(undefined, items);
|
||||
|
||||
var transformed = new Array(items.length);
|
||||
var count = 0;
|
||||
var returned = false;
|
||||
|
||||
items.forEach(function(item, index) {
|
||||
next(item, function(error, transformedItem) {
|
||||
if (returned) return;
|
||||
if (error) {
|
||||
returned = true;
|
||||
return callback(error);
|
||||
}
|
||||
transformed[index] = transformedItem;
|
||||
count += 1;
|
||||
if (count === items.length) return callback(undefined, transformed);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
if (typeof define !== 'undefined' && define.amd) {
|
||||
define([], function() {
|
||||
return each;
|
||||
}); // RequireJS
|
||||
} else if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = each; // CommonJS
|
||||
} else {
|
||||
globals.asyncEach = each; // <script>
|
||||
}
|
||||
})(this);
|
93
node_modules/async-each/package.json
generated
vendored
Normal file
93
node_modules/async-each/package.json
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"async-each@^1.0.0",
|
||||
"/home/beppe/Github/yahooApi/node_modules/chokidar"
|
||||
]
|
||||
],
|
||||
"_from": "async-each@>=1.0.0 <2.0.0",
|
||||
"_id": "async-each@1.0.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/async-each",
|
||||
"_nodeVersion": "6.3.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/async-each-1.0.1.tgz_1472080935649_0.032988218357786536"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "paul@paulmillr.com",
|
||||
"name": "paulmillr"
|
||||
},
|
||||
"_npmVersion": "3.10.3",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "async-each",
|
||||
"raw": "async-each@^1.0.0",
|
||||
"rawSpec": "^1.0.0",
|
||||
"scope": null,
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/chokidar"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz",
|
||||
"_shasum": "19d386a1d9edc6e7c1c85d388aedbcc56d33602d",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "async-each@^1.0.0",
|
||||
"_where": "/home/beppe/Github/yahooApi/node_modules/chokidar",
|
||||
"author": {
|
||||
"name": "Paul Miller",
|
||||
"url": "http://paulmillr.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/paulmillr/async-each/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "No-bullshit, ultra-simple, 35-lines-of-code async parallel forEach / map function for JavaScript.",
|
||||
"devDependencies": {},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "19d386a1d9edc6e7c1c85d388aedbcc56d33602d",
|
||||
"tarball": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz"
|
||||
},
|
||||
"gitHead": "f2342d85633d0dc1034a49387ca01c08c1189823",
|
||||
"homepage": "https://github.com/paulmillr/async-each/",
|
||||
"keywords": [
|
||||
"array",
|
||||
"async",
|
||||
"asynchronous",
|
||||
"concurrent",
|
||||
"control flow",
|
||||
"each",
|
||||
"flow",
|
||||
"forEach",
|
||||
"iterate",
|
||||
"iteration",
|
||||
"loop",
|
||||
"map",
|
||||
"parallel"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "paulmillr",
|
||||
"email": "paul@paulmillr.com"
|
||||
},
|
||||
{
|
||||
"name": "es128",
|
||||
"email": "elan.shanker+npm@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "async-each",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/paulmillr/async-each.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"version": "1.0.1"
|
||||
}
|
269
node_modules/async/CHANGELOG.md
generated
vendored
Normal file
269
node_modules/async/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,269 @@
|
||||
# v2.6.1
|
||||
- Updated lodash to prevent `npm audit` warnings. (#1532, #1533)
|
||||
- Made `async-es` more optimized for webpack users (#1517)
|
||||
- Fixed a stack overflow with large collections and a synchronous iterator (#1514)
|
||||
- Various small fixes/chores (#1505, #1511, #1527, #1530)
|
||||
|
||||
# v2.6.0
|
||||
- Added missing aliases for many methods. Previously, you could not (e.g.) `require('async/find')` or use `async.anyLimit`. (#1483)
|
||||
- Improved `queue` performance. (#1448, #1454)
|
||||
- Add missing sourcemap (#1452, #1453)
|
||||
- Various doc updates (#1448, #1471, #1483)
|
||||
|
||||
# v2.5.0
|
||||
- Added `concatLimit`, the `Limit` equivalent of [`concat`](https://caolan.github.io/async/docs.html#concat) ([#1426](https://github.com/caolan/async/issues/1426), [#1430](https://github.com/caolan/async/pull/1430))
|
||||
- `concat` improvements: it now preserves order, handles falsy values and the `iteratee` callback takes a variable number of arguments ([#1437](https://github.com/caolan/async/issues/1437), [#1436](https://github.com/caolan/async/pull/1436))
|
||||
- Fixed an issue in `queue` where there was a size discrepancy between `workersList().length` and `running()` ([#1428](https://github.com/caolan/async/issues/1428), [#1429](https://github.com/caolan/async/pull/1429))
|
||||
- Various doc fixes ([#1422](https://github.com/caolan/async/issues/1422), [#1424](https://github.com/caolan/async/pull/1424))
|
||||
|
||||
# v2.4.1
|
||||
- Fixed a bug preventing functions wrapped with `timeout()` from being re-used. ([#1418](https://github.com/caolan/async/issues/1418), [#1419](https://github.com/caolan/async/issues/1419))
|
||||
|
||||
# v2.4.0
|
||||
- Added `tryEach`, for running async functions in parallel, where you only expect one to succeed. ([#1365](https://github.com/caolan/async/issues/1365), [#687](https://github.com/caolan/async/issues/687))
|
||||
- Improved performance, most notably in `parallel` and `waterfall` ([#1395](https://github.com/caolan/async/issues/1395))
|
||||
- Added `queue.remove()`, for removing items in a `queue` ([#1397](https://github.com/caolan/async/issues/1397), [#1391](https://github.com/caolan/async/issues/1391))
|
||||
- Fixed using `eval`, preventing Async from running in pages with Content Security Policy ([#1404](https://github.com/caolan/async/issues/1404), [#1403](https://github.com/caolan/async/issues/1403))
|
||||
- Fixed errors thrown in an `asyncify`ed function's callback being caught by the underlying Promise ([#1408](https://github.com/caolan/async/issues/1408))
|
||||
- Fixed timing of `queue.empty()` ([#1367](https://github.com/caolan/async/issues/1367))
|
||||
- Various doc fixes ([#1314](https://github.com/caolan/async/issues/1314), [#1394](https://github.com/caolan/async/issues/1394), [#1412](https://github.com/caolan/async/issues/1412))
|
||||
|
||||
# v2.3.0
|
||||
- Added support for ES2017 `async` functions. Wherever you can pass a Node-style/CPS function that uses a callback, you can also pass an `async` function. Previously, you had to wrap `async` functions with `asyncify`. The caveat is that it will only work if `async` functions are supported natively in your environment, transpiled implementations can't be detected. ([#1386](https://github.com/caolan/async/issues/1386), [#1390](https://github.com/caolan/async/issues/1390))
|
||||
- Small doc fix ([#1392](https://github.com/caolan/async/issues/1392))
|
||||
|
||||
# v2.2.0
|
||||
- Added `groupBy`, and the `Series`/`Limit` equivalents, analogous to [`_.groupBy`](http://lodash.com/docs#groupBy) ([#1364](https://github.com/caolan/async/issues/1364))
|
||||
- Fixed `transform` bug when `callback` was not passed ([#1381](https://github.com/caolan/async/issues/1381))
|
||||
- Added note about `reflect` to `parallel` docs ([#1385](https://github.com/caolan/async/issues/1385))
|
||||
|
||||
# v2.1.5
|
||||
- Fix `auto` bug when function names collided with Array.prototype ([#1358](https://github.com/caolan/async/issues/1358))
|
||||
- Improve some error messages ([#1349](https://github.com/caolan/async/issues/1349))
|
||||
- Avoid stack overflow case in queue
|
||||
- Fixed an issue in `some`, `every` and `find` where processing would continue after the result was determined.
|
||||
- Cleanup implementations of `some`, `every` and `find`
|
||||
|
||||
# v2.1.3
|
||||
- Make bundle size smaller
|
||||
- Create optimized hotpath for `filter` in array case.
|
||||
|
||||
# v2.1.2
|
||||
- Fixed a stackoverflow bug with `detect`, `some`, `every` on large inputs ([#1293](https://github.com/caolan/async/issues/1293)).
|
||||
|
||||
# v2.1.0
|
||||
|
||||
- `retry` and `retryable` now support an optional `errorFilter` function that determines if the `task` should retry on the error ([#1256](https://github.com/caolan/async/issues/1256), [#1261](https://github.com/caolan/async/issues/1261))
|
||||
- Optimized array iteration in `race`, `cargo`, `queue`, and `priorityQueue` ([#1253](https://github.com/caolan/async/issues/1253))
|
||||
- Added alias documentation to doc site ([#1251](https://github.com/caolan/async/issues/1251), [#1254](https://github.com/caolan/async/issues/1254))
|
||||
- Added [BootStrap scrollspy](http://getbootstrap.com/javascript/#scrollspy) to docs to highlight in the sidebar the current method being viewed ([#1289](https://github.com/caolan/async/issues/1289), [#1300](https://github.com/caolan/async/issues/1300))
|
||||
- Various minor doc fixes ([#1263](https://github.com/caolan/async/issues/1263), [#1264](https://github.com/caolan/async/issues/1264), [#1271](https://github.com/caolan/async/issues/1271), [#1278](https://github.com/caolan/async/issues/1278), [#1280](https://github.com/caolan/async/issues/1280), [#1282](https://github.com/caolan/async/issues/1282), [#1302](https://github.com/caolan/async/issues/1302))
|
||||
|
||||
# v2.0.1
|
||||
|
||||
- Significantly optimized all iteration based collection methods such as `each`, `map`, `filter`, etc ([#1245](https://github.com/caolan/async/issues/1245), [#1246](https://github.com/caolan/async/issues/1246), [#1247](https://github.com/caolan/async/issues/1247)).
|
||||
|
||||
# v2.0.0
|
||||
|
||||
Lots of changes here!
|
||||
|
||||
First and foremost, we have a slick new [site for docs](https://caolan.github.io/async/). Special thanks to [**@hargasinski**](https://github.com/hargasinski) for his work converting our old docs to `jsdoc` format and implementing the new website. Also huge ups to [**@ivanseidel**](https://github.com/ivanseidel) for designing our new logo. It was a long process for both of these tasks, but I think these changes turned out extraordinary well.
|
||||
|
||||
The biggest feature is modularization. You can now `require("async/series")` to only require the `series` function. Every Async library function is available this way. You still can `require("async")` to require the entire library, like you could do before.
|
||||
|
||||
We also provide Async as a collection of ES2015 modules. You can now `import {each} from 'async-es'` or `import waterfall from 'async-es/waterfall'`. If you are using only a few Async functions, and are using a ES bundler such as Rollup, this can significantly lower your build size.
|
||||
|
||||
Major thanks to [**@Kikobeats**](github.com/Kikobeats), [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for doing the majority of the modularization work, as well as [**@jdalton**](github.com/jdalton) and [**@Rich-Harris**](github.com/Rich-Harris) for advisory work on the general modularization strategy.
|
||||
|
||||
Another one of the general themes of the 2.0 release is standardization of what an "async" function is. We are now more strictly following the node-style continuation passing style. That is, an async function is a function that:
|
||||
|
||||
1. Takes a variable number of arguments
|
||||
2. The last argument is always a callback
|
||||
3. The callback can accept any number of arguments
|
||||
4. The first argument passed to the callback will be treated as an error result, if the argument is truthy
|
||||
5. Any number of result arguments can be passed after the "error" argument
|
||||
6. The callback is called once and exactly once, either on the same tick or later tick of the JavaScript event loop.
|
||||
|
||||
There were several cases where Async accepted some functions that did not strictly have these properties, most notably `auto`, `every`, `some`, `filter`, `reject` and `detect`.
|
||||
|
||||
Another theme is performance. We have eliminated internal deferrals in all cases where they make sense. For example, in `waterfall` and `auto`, there was a `setImmediate` between each task -- these deferrals have been removed. A `setImmediate` call can add up to 1ms of delay. This might not seem like a lot, but it can add up if you are using many Async functions in the course of processing a HTTP request, for example. Nearly all asynchronous functions that do I/O already have some sort of deferral built in, so the extra deferral is unnecessary. The trade-off of this change is removing our built-in stack-overflow defense. Many synchronous callback calls in series can quickly overflow the JS call stack. If you do have a function that is sometimes synchronous (calling its callback on the same tick), and are running into stack overflows, wrap it with `async.ensureAsync()`.
|
||||
|
||||
Another big performance win has been re-implementing `queue`, `cargo`, and `priorityQueue` with [doubly linked lists](https://en.wikipedia.org/wiki/Doubly_linked_list) instead of arrays. This has lead to queues being an order of [magnitude faster on large sets of tasks](https://github.com/caolan/async/pull/1205).
|
||||
|
||||
## New Features
|
||||
|
||||
- Async is now modularized. Individual functions can be `require()`d from the main package. (`require('async/auto')`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996))
|
||||
- Async is also available as a collection of ES2015 modules in the new `async-es` package. (`import {forEachSeries} from 'async-es'`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996))
|
||||
- Added `race`, analogous to `Promise.race()`. It will run an array of async tasks in parallel and will call its callback with the result of the first task to respond. ([#568](https://github.com/caolan/async/issues/568), [#1038](https://github.com/caolan/async/issues/1038))
|
||||
- Collection methods now accept ES2015 iterators. Maps, Sets, and anything that implements the iterator spec can now be passed directly to `each`, `map`, `parallel`, etc.. ([#579](https://github.com/caolan/async/issues/579), [#839](https://github.com/caolan/async/issues/839), [#1074](https://github.com/caolan/async/issues/1074))
|
||||
- Added `mapValues`, for mapping over the properties of an object and returning an object with the same keys. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177))
|
||||
- Added `timeout`, a wrapper for an async function that will make the task time-out after the specified time. ([#1007](https://github.com/caolan/async/issues/1007), [#1027](https://github.com/caolan/async/issues/1027))
|
||||
- Added `reflect` and `reflectAll`, analagous to [`Promise.reflect()`](http://bluebirdjs.com/docs/api/reflect.html), a wrapper for async tasks that always succeeds, by gathering results and errors into an object. ([#942](https://github.com/caolan/async/issues/942), [#1012](https://github.com/caolan/async/issues/1012), [#1095](https://github.com/caolan/async/issues/1095))
|
||||
- `constant` supports dynamic arguments -- it will now always use its last argument as the callback. ([#1016](https://github.com/caolan/async/issues/1016), [#1052](https://github.com/caolan/async/issues/1052))
|
||||
- `setImmediate` and `nextTick` now support arguments to partially apply to the deferred function, like the node-native versions do. ([#940](https://github.com/caolan/async/issues/940), [#1053](https://github.com/caolan/async/issues/1053))
|
||||
- `auto` now supports resolving cyclic dependencies using [Kahn's algorithm](https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm) ([#1140](https://github.com/caolan/async/issues/1140)).
|
||||
- Added `autoInject`, a relative of `auto` that automatically spreads a task's dependencies as arguments to the task function. ([#608](https://github.com/caolan/async/issues/608), [#1055](https://github.com/caolan/async/issues/1055), [#1099](https://github.com/caolan/async/issues/1099), [#1100](https://github.com/caolan/async/issues/1100))
|
||||
- You can now limit the concurrency of `auto` tasks. ([#635](https://github.com/caolan/async/issues/635), [#637](https://github.com/caolan/async/issues/637))
|
||||
- Added `retryable`, a relative of `retry` that wraps an async function, making it retry when called. ([#1058](https://github.com/caolan/async/issues/1058))
|
||||
- `retry` now supports specifying a function that determines the next time interval, useful for exponential backoff, logging and other retry strategies. ([#1161](https://github.com/caolan/async/issues/1161))
|
||||
- `retry` will now pass all of the arguments the task function was resolved with to the callback ([#1231](https://github.com/caolan/async/issues/1231)).
|
||||
- Added `q.unsaturated` -- callback called when a `queue`'s number of running workers falls below a threshold. ([#868](https://github.com/caolan/async/issues/868), [#1030](https://github.com/caolan/async/issues/1030), [#1033](https://github.com/caolan/async/issues/1033), [#1034](https://github.com/caolan/async/issues/1034))
|
||||
- Added `q.error` -- a callback called whenever a `queue` task calls its callback with an error. ([#1170](https://github.com/caolan/async/issues/1170))
|
||||
- `applyEach` and `applyEachSeries` now pass results to the final callback. ([#1088](https://github.com/caolan/async/issues/1088))
|
||||
|
||||
## Breaking changes
|
||||
|
||||
- Calling a callback more than once is considered an error, and an error will be thrown. This had an explicit breaking change in `waterfall`. If you were relying on this behavior, you should more accurately represent your control flow as an event emitter or stream. ([#814](https://github.com/caolan/async/issues/814), [#815](https://github.com/caolan/async/issues/815), [#1048](https://github.com/caolan/async/issues/1048), [#1050](https://github.com/caolan/async/issues/1050))
|
||||
- `auto` task functions now always take the callback as the last argument. If a task has dependencies, the `results` object will be passed as the first argument. To migrate old task functions, wrap them with [`_.flip`](https://lodash.com/docs#flip) ([#1036](https://github.com/caolan/async/issues/1036), [#1042](https://github.com/caolan/async/issues/1042))
|
||||
- Internal `setImmediate` calls have been refactored away. This may make existing flows vulnerable to stack overflows if you use many synchronous functions in series. Use `ensureAsync` to work around this. ([#696](https://github.com/caolan/async/issues/696), [#704](https://github.com/caolan/async/issues/704), [#1049](https://github.com/caolan/async/issues/1049), [#1050](https://github.com/caolan/async/issues/1050))
|
||||
- `map` used to return an object when iterating over an object. `map` now always returns an array, like in other libraries. The previous object behavior has been split out into `mapValues`. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177))
|
||||
- `filter`, `reject`, `some`, `every`, `detect` and their families like `{METHOD}Series` and `{METHOD}Limit` now expect an error as the first callback argument, rather than just a simple boolean. Pass `null` as the first argument, or use `fs.access` instead of `fs.exists`. ([#118](https://github.com/caolan/async/issues/118), [#774](https://github.com/caolan/async/issues/774), [#1028](https://github.com/caolan/async/issues/1028), [#1041](https://github.com/caolan/async/issues/1041))
|
||||
- `{METHOD}` and `{METHOD}Series` are now implemented in terms of `{METHOD}Limit`. This is a major internal simplification, and is not expected to cause many problems, but it does subtly affect how functions execute internally. ([#778](https://github.com/caolan/async/issues/778), [#847](https://github.com/caolan/async/issues/847))
|
||||
- `retry`'s callback is now optional. Previously, omitting the callback would partially apply the function, meaning it could be passed directly as a task to `series` or `auto`. The partially applied "control-flow" behavior has been separated out into `retryable`. ([#1054](https://github.com/caolan/async/issues/1054), [#1058](https://github.com/caolan/async/issues/1058))
|
||||
- The test function for `whilst`, `until`, and `during` used to be passed non-error args from the iteratee function's callback, but this led to weirdness where the first call of the test function would be passed no args. We have made it so the test function is never passed extra arguments, and only the `doWhilst`, `doUntil`, and `doDuring` functions pass iteratee callback arguments to the test function ([#1217](https://github.com/caolan/async/issues/1217), [#1224](https://github.com/caolan/async/issues/1224))
|
||||
- The `q.tasks` array has been renamed `q._tasks` and is now implemented as a doubly linked list (DLL). Any code that used to interact with this array will need to be updated to either use the provided helpers or support DLLs ([#1205](https://github.com/caolan/async/issues/1205)).
|
||||
- The timing of the `q.saturated()` callback in a `queue` has been modified to better reflect when tasks pushed to the queue will start queueing. ([#724](https://github.com/caolan/async/issues/724), [#1078](https://github.com/caolan/async/issues/1078))
|
||||
- Removed `iterator` method in favour of [ES2015 iterator protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators ) which natively supports arrays ([#1237](https://github.com/caolan/async/issues/1237))
|
||||
- Dropped support for Component, Jam, SPM, and Volo ([#1175](https://github.com/caolan/async/issues/1175), #[#176](https://github.com/caolan/async/issues/176))
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
- Improved handling of no dependency cases in `auto` & `autoInject` ([#1147](https://github.com/caolan/async/issues/1147)).
|
||||
- Fixed a bug where the callback generated by `asyncify` with `Promises` could resolve twice ([#1197](https://github.com/caolan/async/issues/1197)).
|
||||
- Fixed several documented optional callbacks not actually being optional ([#1223](https://github.com/caolan/async/issues/1223)).
|
||||
|
||||
## Other
|
||||
|
||||
- Added `someSeries` and `everySeries` for symmetry, as well as a complete set of `any`/`anyLimit`/`anySeries` and `all`/`/allLmit`/`allSeries` aliases.
|
||||
- Added `find` as an alias for `detect. (as well as `findLimit` and `findSeries`).
|
||||
- Various doc fixes ([#1005](https://github.com/caolan/async/issues/1005), [#1008](https://github.com/caolan/async/issues/1008), [#1010](https://github.com/caolan/async/issues/1010), [#1015](https://github.com/caolan/async/issues/1015), [#1021](https://github.com/caolan/async/issues/1021), [#1037](https://github.com/caolan/async/issues/1037), [#1039](https://github.com/caolan/async/issues/1039), [#1051](https://github.com/caolan/async/issues/1051), [#1102](https://github.com/caolan/async/issues/1102), [#1107](https://github.com/caolan/async/issues/1107), [#1121](https://github.com/caolan/async/issues/1121), [#1123](https://github.com/caolan/async/issues/1123), [#1129](https://github.com/caolan/async/issues/1129), [#1135](https://github.com/caolan/async/issues/1135), [#1138](https://github.com/caolan/async/issues/1138), [#1141](https://github.com/caolan/async/issues/1141), [#1153](https://github.com/caolan/async/issues/1153), [#1216](https://github.com/caolan/async/issues/1216), [#1217](https://github.com/caolan/async/issues/1217), [#1232](https://github.com/caolan/async/issues/1232), [#1233](https://github.com/caolan/async/issues/1233), [#1236](https://github.com/caolan/async/issues/1236), [#1238](https://github.com/caolan/async/issues/1238))
|
||||
|
||||
Thank you [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for taking the lead on version 2 of async.
|
||||
|
||||
------------------------------------------
|
||||
|
||||
# v1.5.2
|
||||
- Allow using `"constructor"` as an argument in `memoize` ([#998](https://github.com/caolan/async/issues/998))
|
||||
- Give a better error messsage when `auto` dependency checking fails ([#994](https://github.com/caolan/async/issues/994))
|
||||
- Various doc updates ([#936](https://github.com/caolan/async/issues/936), [#956](https://github.com/caolan/async/issues/956), [#979](https://github.com/caolan/async/issues/979), [#1002](https://github.com/caolan/async/issues/1002))
|
||||
|
||||
# v1.5.1
|
||||
- Fix issue with `pause` in `queue` with concurrency enabled ([#946](https://github.com/caolan/async/issues/946))
|
||||
- `while` and `until` now pass the final result to callback ([#963](https://github.com/caolan/async/issues/963))
|
||||
- `auto` will properly handle concurrency when there is no callback ([#966](https://github.com/caolan/async/issues/966))
|
||||
- `auto` will no. properly stop execution when an error occurs ([#988](https://github.com/caolan/async/issues/988), [#993](https://github.com/caolan/async/issues/993))
|
||||
- Various doc fixes ([#971](https://github.com/caolan/async/issues/971), [#980](https://github.com/caolan/async/issues/980))
|
||||
|
||||
# v1.5.0
|
||||
|
||||
- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) ([#892](https://github.com/caolan/async/issues/892))
|
||||
- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. ([#873](https://github.com/caolan/async/issues/873))
|
||||
- `auto` now accepts an optional `concurrency` argument to limit the number o. running tasks ([#637](https://github.com/caolan/async/issues/637))
|
||||
- Added `queue#workersList()`, to retrieve the lis. of currently running tasks. ([#891](https://github.com/caolan/async/issues/891))
|
||||
- Various code simplifications ([#896](https://github.com/caolan/async/issues/896), [#904](https://github.com/caolan/async/issues/904))
|
||||
- Various doc fixes :scroll: ([#890](https://github.com/caolan/async/issues/890), [#894](https://github.com/caolan/async/issues/894), [#903](https://github.com/caolan/async/issues/903), [#905](https://github.com/caolan/async/issues/905), [#912](https://github.com/caolan/async/issues/912))
|
||||
|
||||
# v1.4.2
|
||||
|
||||
- Ensure coverage files don't get published on npm ([#879](https://github.com/caolan/async/issues/879))
|
||||
|
||||
# v1.4.1
|
||||
|
||||
- Add in overlooked `detectLimit` method ([#866](https://github.com/caolan/async/issues/866))
|
||||
- Removed unnecessary files from npm releases ([#861](https://github.com/caolan/async/issues/861))
|
||||
- Removed usage of a reserved word to prevent :boom: in older environments ([#870](https://github.com/caolan/async/issues/870))
|
||||
|
||||
# v1.4.0
|
||||
|
||||
- `asyncify` now supports promises ([#840](https://github.com/caolan/async/issues/840))
|
||||
- Added `Limit` versions of `filter` and `reject` ([#836](https://github.com/caolan/async/issues/836))
|
||||
- Add `Limit` versions of `detect`, `some` and `every` ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829))
|
||||
- `some`, `every` and `detect` now short circuit early ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829))
|
||||
- Improve detection of the global object ([#804](https://github.com/caolan/async/issues/804)), enabling use in WebWorkers
|
||||
- `whilst` now called with arguments from iterator ([#823](https://github.com/caolan/async/issues/823))
|
||||
- `during` now gets called with arguments from iterator ([#824](https://github.com/caolan/async/issues/824))
|
||||
- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0))
|
||||
|
||||
|
||||
# v1.3.0
|
||||
|
||||
New Features:
|
||||
- Added `constant`
|
||||
- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. ([#671](https://github.com/caolan/async/issues/671), [#806](https://github.com/caolan/async/issues/806))
|
||||
- Added `during` and `doDuring`, which are like `whilst` with an async truth test. ([#800](https://github.com/caolan/async/issues/800))
|
||||
- `retry` now accepts an `interval` parameter to specify a delay between retries. ([#793](https://github.com/caolan/async/issues/793))
|
||||
- `async` should work better in Web Workers due to better `root` detection ([#804](https://github.com/caolan/async/issues/804))
|
||||
- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` ([#642](https://github.com/caolan/async/issues/642))
|
||||
- Various internal updates ([#786](https://github.com/caolan/async/issues/786), [#801](https://github.com/caolan/async/issues/801), [#802](https://github.com/caolan/async/issues/802), [#803](https://github.com/caolan/async/issues/803))
|
||||
- Various doc fixes ([#790](https://github.com/caolan/async/issues/790), [#794](https://github.com/caolan/async/issues/794))
|
||||
|
||||
Bug Fixes:
|
||||
- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. ([#740](https://github.com/caolan/async/issues/740), [#744](https://github.com/caolan/async/issues/744), [#783](https://github.com/caolan/async/issues/783))
|
||||
|
||||
|
||||
# v1.2.1
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782))
|
||||
|
||||
|
||||
# v1.2.0
|
||||
|
||||
New Features:
|
||||
|
||||
- Added `timesLimit` ([#743](https://github.com/caolan/async/issues/743))
|
||||
- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. ([#747](https://github.com/caolan/async/issues/747), [#772](https://github.com/caolan/async/issues/772))
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
- Fixed a regression in `each` and family with empty arrays that have additional properties. ([#775](https://github.com/caolan/async/issues/775), [#777](https://github.com/caolan/async/issues/777))
|
||||
|
||||
|
||||
# v1.1.1
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782))
|
||||
|
||||
|
||||
# v1.1.0
|
||||
|
||||
New Features:
|
||||
|
||||
- `cargo` now supports all of the same methods and event callbacks as `queue`.
|
||||
- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. ([#769](https://github.com/caolan/async/issues/769))
|
||||
- Optimized `map`, `eachOf`, and `waterfall` families of functions
|
||||
- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array ([#667](https://github.com/caolan/async/issues/667)).
|
||||
- The callback is now optional for the composed results of `compose` and `seq`. ([#618](https://github.com/caolan/async/issues/618))
|
||||
- Reduced file size by 4kb, (minified version by 1kb)
|
||||
- Added code coverage through `nyc` and `coveralls` ([#768](https://github.com/caolan/async/issues/768))
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
- `forever` will no longer stack overflow with a synchronous iterator ([#622](https://github.com/caolan/async/issues/622))
|
||||
- `eachLimit` and other limit functions will stop iterating once an error occurs ([#754](https://github.com/caolan/async/issues/754))
|
||||
- Always pass `null` in callbacks when there is no error ([#439](https://github.com/caolan/async/issues/439))
|
||||
- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue ([#668](https://github.com/caolan/async/issues/668))
|
||||
- `each` and family will properly handle an empty array ([#578](https://github.com/caolan/async/issues/578))
|
||||
- `eachSeries` and family will finish if the underlying array is modified during execution ([#557](https://github.com/caolan/async/issues/557))
|
||||
- `queue` will throw if a non-function is passed to `q.push()` ([#593](https://github.com/caolan/async/issues/593))
|
||||
- Doc fixes ([#629](https://github.com/caolan/async/issues/629), [#766](https://github.com/caolan/async/issues/766))
|
||||
|
||||
|
||||
# v1.0.0
|
||||
|
||||
No known breaking changes, we are simply complying with semver from here on out.
|
||||
|
||||
Changes:
|
||||
|
||||
- Start using a changelog!
|
||||
- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) ([#168](https://github.com/caolan/async/issues/168) [#704](https://github.com/caolan/async/issues/704) [#321](https://github.com/caolan/async/issues/321))
|
||||
- Detect deadlocks in `auto` ([#663](https://github.com/caolan/async/issues/663))
|
||||
- Better support for require.js ([#527](https://github.com/caolan/async/issues/527))
|
||||
- Throw if queue created with concurrency `0` ([#714](https://github.com/caolan/async/issues/714))
|
||||
- Fix unneeded iteration in `queue.resume()` ([#758](https://github.com/caolan/async/issues/758))
|
||||
- Guard against timer mocking overriding `setImmediate` ([#609](https://github.com/caolan/async/issues/609) [#611](https://github.com/caolan/async/issues/611))
|
||||
- Miscellaneous doc fixes ([#542](https://github.com/caolan/async/issues/542) [#596](https://github.com/caolan/async/issues/596) [#615](https://github.com/caolan/async/issues/615) [#628](https://github.com/caolan/async/issues/628) [#631](https://github.com/caolan/async/issues/631) [#690](https://github.com/caolan/async/issues/690) [#729](https://github.com/caolan/async/issues/729))
|
||||
- Use single noop function internally ([#546](https://github.com/caolan/async/issues/546))
|
||||
- Optimize internal `_each`, `_map` and `_keys` functions.
|
19
node_modules/async/LICENSE
generated
vendored
Normal file
19
node_modules/async/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2010-2018 Caolan McMahon
|
||||
|
||||
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.
|
56
node_modules/async/README.md
generated
vendored
Normal file
56
node_modules/async/README.md
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||

|
||||
|
||||
[](https://travis-ci.org/caolan/async)
|
||||
[](https://www.npmjs.com/package/async)
|
||||
[](https://coveralls.io/r/caolan/async?branch=master)
|
||||
[](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://www.libhive.com/providers/npm/packages/async)
|
||||
[](https://www.jsdelivr.com/package/npm/async)
|
||||
|
||||
|
||||
Async is a utility module which provides straight-forward, powerful functions for working with [asynchronous JavaScript](http://caolan.github.io/async/global.html). Although originally designed for use with [Node.js](https://nodejs.org/) and installable via `npm install --save async`, it can also be used directly in the browser.
|
||||
|
||||
This version of the package is optimized for the Node.js environment. If you use Async with webpack, install [`async-es`](https://www.npmjs.com/package/async-es) instead.
|
||||
|
||||
For Documentation, visit <https://caolan.github.io/async/>
|
||||
|
||||
*For Async v1.5.x documentation, go [HERE](https://github.com/caolan/async/blob/v1.5.2/README.md)*
|
||||
|
||||
|
||||
```javascript
|
||||
// for use with Node-style callbacks...
|
||||
var async = require("async");
|
||||
|
||||
var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
|
||||
var configs = {};
|
||||
|
||||
async.forEachOf(obj, (value, key, callback) => {
|
||||
fs.readFile(__dirname + value, "utf8", (err, data) => {
|
||||
if (err) return callback(err);
|
||||
try {
|
||||
configs[key] = JSON.parse(data);
|
||||
} catch (e) {
|
||||
return callback(e);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
}, err => {
|
||||
if (err) console.error(err.message);
|
||||
// configs is now a map of JSON data
|
||||
doSomethingWith(configs);
|
||||
});
|
||||
```
|
||||
|
||||
```javascript
|
||||
var async = require("async");
|
||||
|
||||
// ...or ES2017 async functions
|
||||
async.mapLimit(urls, 5, async function(url) {
|
||||
const response = await fetch(url)
|
||||
return response.body
|
||||
}, (err, results) => {
|
||||
if (err) throw err
|
||||
// results is now an array of the response bodies
|
||||
console.log(results)
|
||||
})
|
||||
```
|
50
node_modules/async/all.js
generated
vendored
Normal file
50
node_modules/async/all.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createTester = require('./internal/createTester');
|
||||
|
||||
var _createTester2 = _interopRequireDefault(_createTester);
|
||||
|
||||
var _doParallel = require('./internal/doParallel');
|
||||
|
||||
var _doParallel2 = _interopRequireDefault(_doParallel);
|
||||
|
||||
var _notId = require('./internal/notId');
|
||||
|
||||
var _notId2 = _interopRequireDefault(_notId);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Returns `true` if every element in `coll` satisfies an async test. If any
|
||||
* iteratee call returns `false`, the main `callback` is immediately called.
|
||||
*
|
||||
* @name every
|
||||
* @static
|
||||
* @memberOf module:Collections
|
||||
* @method
|
||||
* @alias all
|
||||
* @category Collection
|
||||
* @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||||
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
|
||||
* in the collection in parallel.
|
||||
* The iteratee must complete with a boolean result value.
|
||||
* Invoked with (item, callback).
|
||||
* @param {Function} [callback] - A callback which is called after all the
|
||||
* `iteratee` functions have finished. Result will be either `true` or `false`
|
||||
* depending on the values of the async tests. Invoked with (err, result).
|
||||
* @example
|
||||
*
|
||||
* async.every(['file1','file2','file3'], function(filePath, callback) {
|
||||
* fs.access(filePath, function(err) {
|
||||
* callback(null, !err)
|
||||
* });
|
||||
* }, function(err, result) {
|
||||
* // if result is true then every file exists
|
||||
* });
|
||||
*/
|
||||
exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));
|
||||
module.exports = exports['default'];
|
42
node_modules/async/allLimit.js
generated
vendored
Normal file
42
node_modules/async/allLimit.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createTester = require('./internal/createTester');
|
||||
|
||||
var _createTester2 = _interopRequireDefault(_createTester);
|
||||
|
||||
var _doParallelLimit = require('./internal/doParallelLimit');
|
||||
|
||||
var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
|
||||
|
||||
var _notId = require('./internal/notId');
|
||||
|
||||
var _notId2 = _interopRequireDefault(_notId);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.
|
||||
*
|
||||
* @name everyLimit
|
||||
* @static
|
||||
* @memberOf module:Collections
|
||||
* @method
|
||||
* @see [async.every]{@link module:Collections.every}
|
||||
* @alias allLimit
|
||||
* @category Collection
|
||||
* @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||||
* @param {number} limit - The maximum number of async operations at a time.
|
||||
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
|
||||
* in the collection in parallel.
|
||||
* The iteratee must complete with a boolean result value.
|
||||
* Invoked with (item, callback).
|
||||
* @param {Function} [callback] - A callback which is called after all the
|
||||
* `iteratee` functions have finished. Result will be either `true` or `false`
|
||||
* depending on the values of the async tests. Invoked with (err, result).
|
||||
*/
|
||||
exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));
|
||||
module.exports = exports['default'];
|
37
node_modules/async/allSeries.js
generated
vendored
Normal file
37
node_modules/async/allSeries.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _everyLimit = require('./everyLimit');
|
||||
|
||||
var _everyLimit2 = _interopRequireDefault(_everyLimit);
|
||||
|
||||
var _doLimit = require('./internal/doLimit');
|
||||
|
||||
var _doLimit2 = _interopRequireDefault(_doLimit);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.
|
||||
*
|
||||
* @name everySeries
|
||||
* @static
|
||||
* @memberOf module:Collections
|
||||
* @method
|
||||
* @see [async.every]{@link module:Collections.every}
|
||||
* @alias allSeries
|
||||
* @category Collection
|
||||
* @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||||
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
|
||||
* in the collection in series.
|
||||
* The iteratee must complete with a boolean result value.
|
||||
* Invoked with (item, callback).
|
||||
* @param {Function} [callback] - A callback which is called after all the
|
||||
* `iteratee` functions have finished. Result will be either `true` or `false`
|
||||
* depending on the values of the async tests. Invoked with (err, result).
|
||||
*/
|
||||
exports.default = (0, _doLimit2.default)(_everyLimit2.default, 1);
|
||||
module.exports = exports['default'];
|
52
node_modules/async/any.js
generated
vendored
Normal file
52
node_modules/async/any.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createTester = require('./internal/createTester');
|
||||
|
||||
var _createTester2 = _interopRequireDefault(_createTester);
|
||||
|
||||
var _doParallel = require('./internal/doParallel');
|
||||
|
||||
var _doParallel2 = _interopRequireDefault(_doParallel);
|
||||
|
||||
var _identity = require('lodash/identity');
|
||||
|
||||
var _identity2 = _interopRequireDefault(_identity);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Returns `true` if at least one element in the `coll` satisfies an async test.
|
||||
* If any iteratee call returns `true`, the main `callback` is immediately
|
||||
* called.
|
||||
*
|
||||
* @name some
|
||||
* @static
|
||||
* @memberOf module:Collections
|
||||
* @method
|
||||
* @alias any
|
||||
* @category Collection
|
||||
* @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||||
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
|
||||
* in the collections in parallel.
|
||||
* The iteratee should complete with a boolean `result` value.
|
||||
* Invoked with (item, callback).
|
||||
* @param {Function} [callback] - A callback which is called as soon as any
|
||||
* iteratee returns `true`, or after all the iteratee functions have finished.
|
||||
* Result will be either `true` or `false` depending on the values of the async
|
||||
* tests. Invoked with (err, result).
|
||||
* @example
|
||||
*
|
||||
* async.some(['file1','file2','file3'], function(filePath, callback) {
|
||||
* fs.access(filePath, function(err) {
|
||||
* callback(null, !err)
|
||||
* });
|
||||
* }, function(err, result) {
|
||||
* // if result is true then at least one of the files exists
|
||||
* });
|
||||
*/
|
||||
exports.default = (0, _doParallel2.default)((0, _createTester2.default)(Boolean, _identity2.default));
|
||||
module.exports = exports['default'];
|
43
node_modules/async/anyLimit.js
generated
vendored
Normal file
43
node_modules/async/anyLimit.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createTester = require('./internal/createTester');
|
||||
|
||||
var _createTester2 = _interopRequireDefault(_createTester);
|
||||
|
||||
var _doParallelLimit = require('./internal/doParallelLimit');
|
||||
|
||||
var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
|
||||
|
||||
var _identity = require('lodash/identity');
|
||||
|
||||
var _identity2 = _interopRequireDefault(_identity);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.
|
||||
*
|
||||
* @name someLimit
|
||||
* @static
|
||||
* @memberOf module:Collections
|
||||
* @method
|
||||
* @see [async.some]{@link module:Collections.some}
|
||||
* @alias anyLimit
|
||||
* @category Collection
|
||||
* @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||||
* @param {number} limit - The maximum number of async operations at a time.
|
||||
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
|
||||
* in the collections in parallel.
|
||||
* The iteratee should complete with a boolean `result` value.
|
||||
* Invoked with (item, callback).
|
||||
* @param {Function} [callback] - A callback which is called as soon as any
|
||||
* iteratee returns `true`, or after all the iteratee functions have finished.
|
||||
* Result will be either `true` or `false` depending on the values of the async
|
||||
* tests. Invoked with (err, result).
|
||||
*/
|
||||
exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(Boolean, _identity2.default));
|
||||
module.exports = exports['default'];
|
38
node_modules/async/anySeries.js
generated
vendored
Normal file
38
node_modules/async/anySeries.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _someLimit = require('./someLimit');
|
||||
|
||||
var _someLimit2 = _interopRequireDefault(_someLimit);
|
||||
|
||||
var _doLimit = require('./internal/doLimit');
|
||||
|
||||
var _doLimit2 = _interopRequireDefault(_doLimit);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.
|
||||
*
|
||||
* @name someSeries
|
||||
* @static
|
||||
* @memberOf module:Collections
|
||||
* @method
|
||||
* @see [async.some]{@link module:Collections.some}
|
||||
* @alias anySeries
|
||||
* @category Collection
|
||||
* @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||||
* @param {AsyncFunction} iteratee - An async truth test to apply to each item
|
||||
* in the collections in series.
|
||||
* The iteratee should complete with a boolean `result` value.
|
||||
* Invoked with (item, callback).
|
||||
* @param {Function} [callback] - A callback which is called as soon as any
|
||||
* iteratee returns `true`, or after all the iteratee functions have finished.
|
||||
* Result will be either `true` or `false` depending on the values of the async
|
||||
* tests. Invoked with (err, result).
|
||||
*/
|
||||
exports.default = (0, _doLimit2.default)(_someLimit2.default, 1);
|
||||
module.exports = exports['default'];
|
68
node_modules/async/apply.js
generated
vendored
Normal file
68
node_modules/async/apply.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
exports.default = function (fn /*, ...args*/) {
|
||||
var args = (0, _slice2.default)(arguments, 1);
|
||||
return function () /*callArgs*/{
|
||||
var callArgs = (0, _slice2.default)(arguments);
|
||||
return fn.apply(null, args.concat(callArgs));
|
||||
};
|
||||
};
|
||||
|
||||
var _slice = require('./internal/slice');
|
||||
|
||||
var _slice2 = _interopRequireDefault(_slice);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* Creates a continuation function with some arguments already applied.
|
||||
*
|
||||
* Useful as a shorthand when combined with other control flow functions. Any
|
||||
* arguments passed to the returned function are added to the arguments
|
||||
* originally passed to apply.
|
||||
*
|
||||
* @name apply
|
||||
* @static
|
||||
* @memberOf module:Utils
|
||||
* @method
|
||||
* @category Util
|
||||
* @param {Function} fn - The function you want to eventually apply all
|
||||
* arguments to. Invokes with (arguments...).
|
||||
* @param {...*} arguments... - Any number of arguments to automatically apply
|
||||
* when the continuation is called.
|
||||
* @returns {Function} the partially-applied function
|
||||
* @example
|
||||
*
|
||||
* // using apply
|
||||
* async.parallel([
|
||||
* async.apply(fs.writeFile, 'testfile1', 'test1'),
|
||||
* async.apply(fs.writeFile, 'testfile2', 'test2')
|
||||
* ]);
|
||||
*
|
||||
*
|
||||
* // the same process without using apply
|
||||
* async.parallel([
|
||||
* function(callback) {
|
||||
* fs.writeFile('testfile1', 'test1', callback);
|
||||
* },
|
||||
* function(callback) {
|
||||
* fs.writeFile('testfile2', 'test2', callback);
|
||||
* }
|
||||
* ]);
|
||||
*
|
||||
* // It's possible to pass any number of additional arguments when calling the
|
||||
* // continuation:
|
||||
*
|
||||
* node> var fn = async.apply(sys.puts, 'one');
|
||||
* node> fn('two', 'three');
|
||||
* one
|
||||
* two
|
||||
* three
|
||||
*/
|
||||
module.exports = exports['default'];
|
51
node_modules/async/applyEach.js
generated
vendored
Normal file
51
node_modules/async/applyEach.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _applyEach = require('./internal/applyEach');
|
||||
|
||||
var _applyEach2 = _interopRequireDefault(_applyEach);
|
||||
|
||||
var _map = require('./map');
|
||||
|
||||
var _map2 = _interopRequireDefault(_map);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Applies the provided arguments to each function in the array, calling
|
||||
* `callback` after all functions have completed. If you only provide the first
|
||||
* argument, `fns`, then it will return a function which lets you pass in the
|
||||
* arguments as if it were a single function call. If more arguments are
|
||||
* provided, `callback` is required while `args` is still optional.
|
||||
*
|
||||
* @name applyEach
|
||||
* @static
|
||||
* @memberOf module:ControlFlow
|
||||
* @method
|
||||
* @category Control Flow
|
||||
* @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s
|
||||
* to all call with the same arguments
|
||||
* @param {...*} [args] - any number of separate arguments to pass to the
|
||||
* function.
|
||||
* @param {Function} [callback] - the final argument should be the callback,
|
||||
* called when all functions have completed processing.
|
||||
* @returns {Function} - If only the first argument, `fns`, is provided, it will
|
||||
* return a function which lets you pass in the arguments as if it were a single
|
||||
* function call. The signature is `(..args, callback)`. If invoked with any
|
||||
* arguments, `callback` is required.
|
||||
* @example
|
||||
*
|
||||
* async.applyEach([enableSearch, updateSchema], 'bucket', callback);
|
||||
*
|
||||
* // partial application example:
|
||||
* async.each(
|
||||
* buckets,
|
||||
* async.applyEach([enableSearch, updateSchema]),
|
||||
* callback
|
||||
* );
|
||||
*/
|
||||
exports.default = (0, _applyEach2.default)(_map2.default);
|
||||
module.exports = exports['default'];
|
37
node_modules/async/applyEachSeries.js
generated
vendored
Normal file
37
node_modules/async/applyEachSeries.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _applyEach = require('./internal/applyEach');
|
||||
|
||||
var _applyEach2 = _interopRequireDefault(_applyEach);
|
||||
|
||||
var _mapSeries = require('./mapSeries');
|
||||
|
||||
var _mapSeries2 = _interopRequireDefault(_mapSeries);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.
|
||||
*
|
||||
* @name applyEachSeries
|
||||
* @static
|
||||
* @memberOf module:ControlFlow
|
||||
* @method
|
||||
* @see [async.applyEach]{@link module:ControlFlow.applyEach}
|
||||
* @category Control Flow
|
||||
* @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all
|
||||
* call with the same arguments
|
||||
* @param {...*} [args] - any number of separate arguments to pass to the
|
||||
* function.
|
||||
* @param {Function} [callback] - the final argument should be the callback,
|
||||
* called when all functions have completed processing.
|
||||
* @returns {Function} - If only the first argument is provided, it will return
|
||||
* a function which lets you pass in the arguments as if it were a single
|
||||
* function call.
|
||||
*/
|
||||
exports.default = (0, _applyEach2.default)(_mapSeries2.default);
|
||||
module.exports = exports['default'];
|
110
node_modules/async/asyncify.js
generated
vendored
Normal file
110
node_modules/async/asyncify.js
generated
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = asyncify;
|
||||
|
||||
var _isObject = require('lodash/isObject');
|
||||
|
||||
var _isObject2 = _interopRequireDefault(_isObject);
|
||||
|
||||
var _initialParams = require('./internal/initialParams');
|
||||
|
||||
var _initialParams2 = _interopRequireDefault(_initialParams);
|
||||
|
||||
var _setImmediate = require('./internal/setImmediate');
|
||||
|
||||
var _setImmediate2 = _interopRequireDefault(_setImmediate);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Take a sync function and make it async, passing its return value to a
|
||||
* callback. This is useful for plugging sync functions into a waterfall,
|
||||
* series, or other async functions. Any arguments passed to the generated
|
||||
* function will be passed to the wrapped function (except for the final
|
||||
* callback argument). Errors thrown will be passed to the callback.
|
||||
*
|
||||
* If the function passed to `asyncify` returns a Promise, that promises's
|
||||
* resolved/rejected state will be used to call the callback, rather than simply
|
||||
* the synchronous return value.
|
||||
*
|
||||
* This also means you can asyncify ES2017 `async` functions.
|
||||
*
|
||||
* @name asyncify
|
||||
* @static
|
||||
* @memberOf module:Utils
|
||||
* @method
|
||||
* @alias wrapSync
|
||||
* @category Util
|
||||
* @param {Function} func - The synchronous function, or Promise-returning
|
||||
* function to convert to an {@link AsyncFunction}.
|
||||
* @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be
|
||||
* invoked with `(args..., callback)`.
|
||||
* @example
|
||||
*
|
||||
* // passing a regular synchronous function
|
||||
* async.waterfall([
|
||||
* async.apply(fs.readFile, filename, "utf8"),
|
||||
* async.asyncify(JSON.parse),
|
||||
* function (data, next) {
|
||||
* // data is the result of parsing the text.
|
||||
* // If there was a parsing error, it would have been caught.
|
||||
* }
|
||||
* ], callback);
|
||||
*
|
||||
* // passing a function returning a promise
|
||||
* async.waterfall([
|
||||
* async.apply(fs.readFile, filename, "utf8"),
|
||||
* async.asyncify(function (contents) {
|
||||
* return db.model.create(contents);
|
||||
* }),
|
||||
* function (model, next) {
|
||||
* // `model` is the instantiated model object.
|
||||
* // If there was an error, this function would be skipped.
|
||||
* }
|
||||
* ], callback);
|
||||
*
|
||||
* // es2017 example, though `asyncify` is not needed if your JS environment
|
||||
* // supports async functions out of the box
|
||||
* var q = async.queue(async.asyncify(async function(file) {
|
||||
* var intermediateStep = await processFile(file);
|
||||
* return await somePromise(intermediateStep)
|
||||
* }));
|
||||
*
|
||||
* q.push(files);
|
||||
*/
|
||||
function asyncify(func) {
|
||||
return (0, _initialParams2.default)(function (args, callback) {
|
||||
var result;
|
||||
try {
|
||||
result = func.apply(this, args);
|
||||
} catch (e) {
|
||||
return callback(e);
|
||||
}
|
||||
// if result is Promise object
|
||||
if ((0, _isObject2.default)(result) && typeof result.then === 'function') {
|
||||
result.then(function (value) {
|
||||
invokeCallback(callback, null, value);
|
||||
}, function (err) {
|
||||
invokeCallback(callback, err.message ? err : new Error(err));
|
||||
});
|
||||
} else {
|
||||
callback(null, result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function invokeCallback(callback, error, value) {
|
||||
try {
|
||||
callback(error, value);
|
||||
} catch (e) {
|
||||
(0, _setImmediate2.default)(rethrow, e);
|
||||
}
|
||||
}
|
||||
|
||||
function rethrow(error) {
|
||||
throw error;
|
||||
}
|
||||
module.exports = exports['default'];
|
289
node_modules/async/auto.js
generated
vendored
Normal file
289
node_modules/async/auto.js
generated
vendored
Normal file
@@ -0,0 +1,289 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
exports.default = function (tasks, concurrency, callback) {
|
||||
if (typeof concurrency === 'function') {
|
||||
// concurrency is optional, shift the args.
|
||||
callback = concurrency;
|
||||
concurrency = null;
|
||||
}
|
||||
callback = (0, _once2.default)(callback || _noop2.default);
|
||||
var keys = (0, _keys2.default)(tasks);
|
||||
var numTasks = keys.length;
|
||||
if (!numTasks) {
|
||||
return callback(null);
|
||||
}
|
||||
if (!concurrency) {
|
||||
concurrency = numTasks;
|
||||
}
|
||||
|
||||
var results = {};
|
||||
var runningTasks = 0;
|
||||
var hasError = false;
|
||||
|
||||
var listeners = Object.create(null);
|
||||
|
||||
var readyTasks = [];
|
||||
|
||||
// for cycle detection:
|
||||
var readyToCheck = []; // tasks that have been identified as reachable
|
||||
// without the possibility of returning to an ancestor task
|
||||
var uncheckedDependencies = {};
|
||||
|
||||
(0, _baseForOwn2.default)(tasks, function (task, key) {
|
||||
if (!(0, _isArray2.default)(task)) {
|
||||
// no dependencies
|
||||
enqueueTask(key, [task]);
|
||||
readyToCheck.push(key);
|
||||
return;
|
||||
}
|
||||
|
||||
var dependencies = task.slice(0, task.length - 1);
|
||||
var remainingDependencies = dependencies.length;
|
||||
if (remainingDependencies === 0) {
|
||||
enqueueTask(key, task);
|
||||
readyToCheck.push(key);
|
||||
return;
|
||||
}
|
||||
uncheckedDependencies[key] = remainingDependencies;
|
||||
|
||||
(0, _arrayEach2.default)(dependencies, function (dependencyName) {
|
||||
if (!tasks[dependencyName]) {
|
||||
throw new Error('async.auto task `' + key + '` has a non-existent dependency `' + dependencyName + '` in ' + dependencies.join(', '));
|
||||
}
|
||||
addListener(dependencyName, function () {
|
||||
remainingDependencies--;
|
||||
if (remainingDependencies === 0) {
|
||||
enqueueTask(key, task);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
checkForDeadlocks();
|
||||
processQueue();
|
||||
|
||||
function enqueueTask(key, task) {
|
||||
readyTasks.push(function () {
|
||||
runTask(key, task);
|
||||
});
|
||||
}
|
||||
|
||||
function processQueue() {
|
||||
if (readyTasks.length === 0 && runningTasks === 0) {
|
||||
return callback(null, results);
|
||||
}
|
||||
while (readyTasks.length && runningTasks < concurrency) {
|
||||
var run = readyTasks.shift();
|
||||
run();
|
||||
}
|
||||
}
|
||||
|
||||
function addListener(taskName, fn) {
|
||||
var taskListeners = listeners[taskName];
|
||||
if (!taskListeners) {
|
||||
taskListeners = listeners[taskName] = [];
|
||||
}
|
||||
|
||||
taskListeners.push(fn);
|
||||
}
|
||||
|
||||
function taskComplete(taskName) {
|
||||
var taskListeners = listeners[taskName] || [];
|
||||
(0, _arrayEach2.default)(taskListeners, function (fn) {
|
||||
fn();
|
||||
});
|
||||
processQueue();
|
||||
}
|
||||
|
||||
function runTask(key, task) {
|
||||
if (hasError) return;
|
||||
|
||||
var taskCallback = (0, _onlyOnce2.default)(function (err, result) {
|
||||
runningTasks--;
|
||||
if (arguments.length > 2) {
|
||||
result = (0, _slice2.default)(arguments, 1);
|
||||
}
|
||||
if (err) {
|
||||
var safeResults = {};
|
||||
(0, _baseForOwn2.default)(results, function (val, rkey) {
|
||||
safeResults[rkey] = val;
|
||||
});
|
||||
safeResults[key] = result;
|
||||
hasError = true;
|
||||
listeners = Object.create(null);
|
||||
|
||||
callback(err, safeResults);
|
||||
} else {
|
||||
results[key] = result;
|
||||
taskComplete(key);
|
||||
}
|
||||
});
|
||||
|
||||
runningTasks++;
|
||||
var taskFn = (0, _wrapAsync2.default)(task[task.length - 1]);
|
||||
if (task.length > 1) {
|
||||
taskFn(results, taskCallback);
|
||||
} else {
|
||||
taskFn(taskCallback);
|
||||
}
|
||||
}
|
||||
|
||||
function checkForDeadlocks() {
|
||||
// Kahn's algorithm
|
||||
// https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm
|
||||
// http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html
|
||||
var currentTask;
|
||||
var counter = 0;
|
||||
while (readyToCheck.length) {
|
||||
currentTask = readyToCheck.pop();
|
||||
counter++;
|
||||
(0, _arrayEach2.default)(getDependents(currentTask), function (dependent) {
|
||||
if (--uncheckedDependencies[dependent] === 0) {
|
||||
readyToCheck.push(dependent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (counter !== numTasks) {
|
||||
throw new Error('async.auto cannot execute tasks due to a recursive dependency');
|
||||
}
|
||||
}
|
||||
|
||||
function getDependents(taskName) {
|
||||
var result = [];
|
||||
(0, _baseForOwn2.default)(tasks, function (task, key) {
|
||||
if ((0, _isArray2.default)(task) && (0, _baseIndexOf2.default)(task, taskName, 0) >= 0) {
|
||||
result.push(key);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
var _arrayEach = require('lodash/_arrayEach');
|
||||
|
||||
var _arrayEach2 = _interopRequireDefault(_arrayEach);
|
||||
|
||||
var _baseForOwn = require('lodash/_baseForOwn');
|
||||
|
||||
var _baseForOwn2 = _interopRequireDefault(_baseForOwn);
|
||||
|
||||
var _baseIndexOf = require('lodash/_baseIndexOf');
|
||||
|
||||
var _baseIndexOf2 = _interopRequireDefault(_baseIndexOf);
|
||||
|
||||
var _isArray = require('lodash/isArray');
|
||||
|
||||
var _isArray2 = _interopRequireDefault(_isArray);
|
||||
|
||||
var _keys = require('lodash/keys');
|
||||
|
||||
var _keys2 = _interopRequireDefault(_keys);
|
||||
|
||||
var _noop = require('lodash/noop');
|
||||
|
||||
var _noop2 = _interopRequireDefault(_noop);
|
||||
|
||||
var _slice = require('./internal/slice');
|
||||
|
||||
var _slice2 = _interopRequireDefault(_slice);
|
||||
|
||||
var _once = require('./internal/once');
|
||||
|
||||
var _once2 = _interopRequireDefault(_once);
|
||||
|
||||
var _onlyOnce = require('./internal/onlyOnce');
|
||||
|
||||
var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
|
||||
|
||||
var _wrapAsync = require('./internal/wrapAsync');
|
||||
|
||||
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
module.exports = exports['default'];
|
||||
|
||||
/**
|
||||
* Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on
|
||||
* their requirements. Each function can optionally depend on other functions
|
||||
* being completed first, and each function is run as soon as its requirements
|
||||
* are satisfied.
|
||||
*
|
||||
* If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence
|
||||
* will stop. Further tasks will not execute (so any other functions depending
|
||||
* on it will not run), and the main `callback` is immediately called with the
|
||||
* error.
|
||||
*
|
||||
* {@link AsyncFunction}s also receive an object containing the results of functions which
|
||||
* have completed so far as the first argument, if they have dependencies. If a
|
||||
* task function has no dependencies, it will only be passed a callback.
|
||||
*
|
||||
* @name auto
|
||||
* @static
|
||||
* @memberOf module:ControlFlow
|
||||
* @method
|
||||
* @category Control Flow
|
||||
* @param {Object} tasks - An object. Each of its properties is either a
|
||||
* function or an array of requirements, with the {@link AsyncFunction} itself the last item
|
||||
* in the array. The object's key of a property serves as the name of the task
|
||||
* defined by that property, i.e. can be used when specifying requirements for
|
||||
* other tasks. The function receives one or two arguments:
|
||||
* * a `results` object, containing the results of the previously executed
|
||||
* functions, only passed if the task has any dependencies,
|
||||
* * a `callback(err, result)` function, which must be called when finished,
|
||||
* passing an `error` (which can be `null`) and the result of the function's
|
||||
* execution.
|
||||
* @param {number} [concurrency=Infinity] - An optional `integer` for
|
||||
* determining the maximum number of tasks that can be run in parallel. By
|
||||
* default, as many as possible.
|
||||
* @param {Function} [callback] - An optional callback which is called when all
|
||||
* the tasks have been completed. It receives the `err` argument if any `tasks`
|
||||
* pass an error to their callback. Results are always returned; however, if an
|
||||
* error occurs, no further `tasks` will be performed, and the results object
|
||||
* will only contain partial results. Invoked with (err, results).
|
||||
* @returns undefined
|
||||
* @example
|
||||
*
|
||||
* async.auto({
|
||||
* // this function will just be passed a callback
|
||||
* readData: async.apply(fs.readFile, 'data.txt', 'utf-8'),
|
||||
* showData: ['readData', function(results, cb) {
|
||||
* // results.readData is the file's contents
|
||||
* // ...
|
||||
* }]
|
||||
* }, callback);
|
||||
*
|
||||
* async.auto({
|
||||
* get_data: function(callback) {
|
||||
* console.log('in get_data');
|
||||
* // async code to get some data
|
||||
* callback(null, 'data', 'converted to array');
|
||||
* },
|
||||
* make_folder: function(callback) {
|
||||
* console.log('in make_folder');
|
||||
* // async code to create a directory to store a file in
|
||||
* // this is run at the same time as getting the data
|
||||
* callback(null, 'folder');
|
||||
* },
|
||||
* write_file: ['get_data', 'make_folder', function(results, callback) {
|
||||
* console.log('in write_file', JSON.stringify(results));
|
||||
* // once there is some data and the directory exists,
|
||||
* // write the data to a file in the directory
|
||||
* callback(null, 'filename');
|
||||
* }],
|
||||
* email_link: ['write_file', function(results, callback) {
|
||||
* console.log('in email_link', JSON.stringify(results));
|
||||
* // once the file is written let's email a link to it...
|
||||
* // results.write_file contains the filename returned by write_file.
|
||||
* callback(null, {'file':results.write_file, 'email':'user@example.com'});
|
||||
* }]
|
||||
* }, function(err, results) {
|
||||
* console.log('err = ', err);
|
||||
* console.log('results = ', results);
|
||||
* });
|
||||
*/
|
170
node_modules/async/autoInject.js
generated
vendored
Normal file
170
node_modules/async/autoInject.js
generated
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = autoInject;
|
||||
|
||||
var _auto = require('./auto');
|
||||
|
||||
var _auto2 = _interopRequireDefault(_auto);
|
||||
|
||||
var _baseForOwn = require('lodash/_baseForOwn');
|
||||
|
||||
var _baseForOwn2 = _interopRequireDefault(_baseForOwn);
|
||||
|
||||
var _arrayMap = require('lodash/_arrayMap');
|
||||
|
||||
var _arrayMap2 = _interopRequireDefault(_arrayMap);
|
||||
|
||||
var _isArray = require('lodash/isArray');
|
||||
|
||||
var _isArray2 = _interopRequireDefault(_isArray);
|
||||
|
||||
var _trim = require('lodash/trim');
|
||||
|
||||
var _trim2 = _interopRequireDefault(_trim);
|
||||
|
||||
var _wrapAsync = require('./internal/wrapAsync');
|
||||
|
||||
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m;
|
||||
var FN_ARG_SPLIT = /,/;
|
||||
var FN_ARG = /(=.+)?(\s*)$/;
|
||||
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
|
||||
|
||||
function parseParams(func) {
|
||||
func = func.toString().replace(STRIP_COMMENTS, '');
|
||||
func = func.match(FN_ARGS)[2].replace(' ', '');
|
||||
func = func ? func.split(FN_ARG_SPLIT) : [];
|
||||
func = func.map(function (arg) {
|
||||
return (0, _trim2.default)(arg.replace(FN_ARG, ''));
|
||||
});
|
||||
return func;
|
||||
}
|
||||
|
||||
/**
|
||||
* A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent
|
||||
* tasks are specified as parameters to the function, after the usual callback
|
||||
* parameter, with the parameter names matching the names of the tasks it
|
||||
* depends on. This can provide even more readable task graphs which can be
|
||||
* easier to maintain.
|
||||
*
|
||||
* If a final callback is specified, the task results are similarly injected,
|
||||
* specified as named parameters after the initial error parameter.
|
||||
*
|
||||
* The autoInject function is purely syntactic sugar and its semantics are
|
||||
* otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.
|
||||
*
|
||||
* @name autoInject
|
||||
* @static
|
||||
* @memberOf module:ControlFlow
|
||||
* @method
|
||||
* @see [async.auto]{@link module:ControlFlow.auto}
|
||||
* @category Control Flow
|
||||
* @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of
|
||||
* the form 'func([dependencies...], callback). The object's key of a property
|
||||
* serves as the name of the task defined by that property, i.e. can be used
|
||||
* when specifying requirements for other tasks.
|
||||
* * The `callback` parameter is a `callback(err, result)` which must be called
|
||||
* when finished, passing an `error` (which can be `null`) and the result of
|
||||
* the function's execution. The remaining parameters name other tasks on
|
||||
* which the task is dependent, and the results from those tasks are the
|
||||
* arguments of those parameters.
|
||||
* @param {Function} [callback] - An optional callback which is called when all
|
||||
* the tasks have been completed. It receives the `err` argument if any `tasks`
|
||||
* pass an error to their callback, and a `results` object with any completed
|
||||
* task results, similar to `auto`.
|
||||
* @example
|
||||
*
|
||||
* // The example from `auto` can be rewritten as follows:
|
||||
* async.autoInject({
|
||||
* get_data: function(callback) {
|
||||
* // async code to get some data
|
||||
* callback(null, 'data', 'converted to array');
|
||||
* },
|
||||
* make_folder: function(callback) {
|
||||
* // async code to create a directory to store a file in
|
||||
* // this is run at the same time as getting the data
|
||||
* callback(null, 'folder');
|
||||
* },
|
||||
* write_file: function(get_data, make_folder, callback) {
|
||||
* // once there is some data and the directory exists,
|
||||
* // write the data to a file in the directory
|
||||
* callback(null, 'filename');
|
||||
* },
|
||||
* email_link: function(write_file, callback) {
|
||||
* // once the file is written let's email a link to it...
|
||||
* // write_file contains the filename returned by write_file.
|
||||
* callback(null, {'file':write_file, 'email':'user@example.com'});
|
||||
* }
|
||||
* }, function(err, results) {
|
||||
* console.log('err = ', err);
|
||||
* console.log('email_link = ', results.email_link);
|
||||
* });
|
||||
*
|
||||
* // If you are using a JS minifier that mangles parameter names, `autoInject`
|
||||
* // will not work with plain functions, since the parameter names will be
|
||||
* // collapsed to a single letter identifier. To work around this, you can
|
||||
* // explicitly specify the names of the parameters your task function needs
|
||||
* // in an array, similar to Angular.js dependency injection.
|
||||
*
|
||||
* // This still has an advantage over plain `auto`, since the results a task
|
||||
* // depends on are still spread into arguments.
|
||||
* async.autoInject({
|
||||
* //...
|
||||
* write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {
|
||||
* callback(null, 'filename');
|
||||
* }],
|
||||
* email_link: ['write_file', function(write_file, callback) {
|
||||
* callback(null, {'file':write_file, 'email':'user@example.com'});
|
||||
* }]
|
||||
* //...
|
||||
* }, function(err, results) {
|
||||
* console.log('err = ', err);
|
||||
* console.log('email_link = ', results.email_link);
|
||||
* });
|
||||
*/
|
||||
function autoInject(tasks, callback) {
|
||||
var newTasks = {};
|
||||
|
||||
(0, _baseForOwn2.default)(tasks, function (taskFn, key) {
|
||||
var params;
|
||||
var fnIsAsync = (0, _wrapAsync.isAsync)(taskFn);
|
||||
var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0;
|
||||
|
||||
if ((0, _isArray2.default)(taskFn)) {
|
||||
params = taskFn.slice(0, -1);
|
||||
taskFn = taskFn[taskFn.length - 1];
|
||||
|
||||
newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);
|
||||
} else if (hasNoDeps) {
|
||||
// no dependencies, use the function as-is
|
||||
newTasks[key] = taskFn;
|
||||
} else {
|
||||
params = parseParams(taskFn);
|
||||
if (taskFn.length === 0 && !fnIsAsync && params.length === 0) {
|
||||
throw new Error("autoInject task functions require explicit parameters.");
|
||||
}
|
||||
|
||||
// remove callback param
|
||||
if (!fnIsAsync) params.pop();
|
||||
|
||||
newTasks[key] = params.concat(newTask);
|
||||
}
|
||||
|
||||
function newTask(results, taskCb) {
|
||||
var newArgs = (0, _arrayMap2.default)(params, function (name) {
|
||||
return results[name];
|
||||
});
|
||||
newArgs.push(taskCb);
|
||||
(0, _wrapAsync2.default)(taskFn).apply(null, newArgs);
|
||||
}
|
||||
});
|
||||
|
||||
(0, _auto2.default)(newTasks, callback);
|
||||
}
|
||||
module.exports = exports['default'];
|
17
node_modules/async/bower.json
generated
vendored
Normal file
17
node_modules/async/bower.json
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "async",
|
||||
"main": "dist/async.js",
|
||||
"ignore": [
|
||||
"bower_components",
|
||||
"lib",
|
||||
"mocha_test",
|
||||
"node_modules",
|
||||
"perf",
|
||||
"support",
|
||||
"**/.*",
|
||||
"*.config.js",
|
||||
"*.json",
|
||||
"index.js",
|
||||
"Makefile"
|
||||
]
|
||||
}
|
94
node_modules/async/cargo.js
generated
vendored
Normal file
94
node_modules/async/cargo.js
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = cargo;
|
||||
|
||||
var _queue = require('./internal/queue');
|
||||
|
||||
var _queue2 = _interopRequireDefault(_queue);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* A cargo of tasks for the worker function to complete. Cargo inherits all of
|
||||
* the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}.
|
||||
* @typedef {Object} CargoObject
|
||||
* @memberOf module:ControlFlow
|
||||
* @property {Function} length - A function returning the number of items
|
||||
* waiting to be processed. Invoke like `cargo.length()`.
|
||||
* @property {number} payload - An `integer` for determining how many tasks
|
||||
* should be process per round. This property can be changed after a `cargo` is
|
||||
* created to alter the payload on-the-fly.
|
||||
* @property {Function} push - Adds `task` to the `queue`. The callback is
|
||||
* called once the `worker` has finished processing the task. Instead of a
|
||||
* single task, an array of `tasks` can be submitted. The respective callback is
|
||||
* used for every task in the list. Invoke like `cargo.push(task, [callback])`.
|
||||
* @property {Function} saturated - A callback that is called when the
|
||||
* `queue.length()` hits the concurrency and further tasks will be queued.
|
||||
* @property {Function} empty - A callback that is called when the last item
|
||||
* from the `queue` is given to a `worker`.
|
||||
* @property {Function} drain - A callback that is called when the last item
|
||||
* from the `queue` has returned from the `worker`.
|
||||
* @property {Function} idle - a function returning false if there are items
|
||||
* waiting or being processed, or true if not. Invoke like `cargo.idle()`.
|
||||
* @property {Function} pause - a function that pauses the processing of tasks
|
||||
* until `resume()` is called. Invoke like `cargo.pause()`.
|
||||
* @property {Function} resume - a function that resumes the processing of
|
||||
* queued tasks when the queue is paused. Invoke like `cargo.resume()`.
|
||||
* @property {Function} kill - a function that removes the `drain` callback and
|
||||
* empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a `cargo` object with the specified payload. Tasks added to the
|
||||
* cargo will be processed altogether (up to the `payload` limit). If the
|
||||
* `worker` is in progress, the task is queued until it becomes available. Once
|
||||
* the `worker` has completed some tasks, each callback of those tasks is
|
||||
* called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)
|
||||
* for how `cargo` and `queue` work.
|
||||
*
|
||||
* While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers
|
||||
* at a time, cargo passes an array of tasks to a single worker, repeating
|
||||
* when the worker is finished.
|
||||
*
|
||||
* @name cargo
|
||||
* @static
|
||||
* @memberOf module:ControlFlow
|
||||
* @method
|
||||
* @see [async.queue]{@link module:ControlFlow.queue}
|
||||
* @category Control Flow
|
||||
* @param {AsyncFunction} worker - An asynchronous function for processing an array
|
||||
* of queued tasks. Invoked with `(tasks, callback)`.
|
||||
* @param {number} [payload=Infinity] - An optional `integer` for determining
|
||||
* how many tasks should be processed per round; if omitted, the default is
|
||||
* unlimited.
|
||||
* @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can
|
||||
* attached as certain properties to listen for specific events during the
|
||||
* lifecycle of the cargo and inner queue.
|
||||
* @example
|
||||
*
|
||||
* // create a cargo object with payload 2
|
||||
* var cargo = async.cargo(function(tasks, callback) {
|
||||
* for (var i=0; i<tasks.length; i++) {
|
||||
* console.log('hello ' + tasks[i].name);
|
||||
* }
|
||||
* callback();
|
||||
* }, 2);
|
||||
*
|
||||
* // add some items
|
||||
* cargo.push({name: 'foo'}, function(err) {
|
||||
* console.log('finished processing foo');
|
||||
* });
|
||||
* cargo.push({name: 'bar'}, function(err) {
|
||||
* console.log('finished processing bar');
|
||||
* });
|
||||
* cargo.push({name: 'baz'}, function(err) {
|
||||
* console.log('finished processing baz');
|
||||
* });
|
||||
*/
|
||||
function cargo(worker, payload) {
|
||||
return (0, _queue2.default)(worker, 1, payload);
|
||||
}
|
||||
module.exports = exports['default'];
|
58
node_modules/async/compose.js
generated
vendored
Normal file
58
node_modules/async/compose.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
exports.default = function () /*...args*/{
|
||||
return _seq2.default.apply(null, (0, _slice2.default)(arguments).reverse());
|
||||
};
|
||||
|
||||
var _seq = require('./seq');
|
||||
|
||||
var _seq2 = _interopRequireDefault(_seq);
|
||||
|
||||
var _slice = require('./internal/slice');
|
||||
|
||||
var _slice2 = _interopRequireDefault(_slice);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* Creates a function which is a composition of the passed asynchronous
|
||||
* functions. Each function consumes the return value of the function that
|
||||
* follows. Composing functions `f()`, `g()`, and `h()` would produce the result
|
||||
* of `f(g(h()))`, only this version uses callbacks to obtain the return values.
|
||||
*
|
||||
* Each function is executed with the `this` binding of the composed function.
|
||||
*
|
||||
* @name compose
|
||||
* @static
|
||||
* @memberOf module:ControlFlow
|
||||
* @method
|
||||
* @category Control Flow
|
||||
* @param {...AsyncFunction} functions - the asynchronous functions to compose
|
||||
* @returns {Function} an asynchronous function that is the composed
|
||||
* asynchronous `functions`
|
||||
* @example
|
||||
*
|
||||
* function add1(n, callback) {
|
||||
* setTimeout(function () {
|
||||
* callback(null, n + 1);
|
||||
* }, 10);
|
||||
* }
|
||||
*
|
||||
* function mul3(n, callback) {
|
||||
* setTimeout(function () {
|
||||
* callback(null, n * 3);
|
||||
* }, 10);
|
||||
* }
|
||||
*
|
||||
* var add1mul3 = async.compose(mul3, add1);
|
||||
* add1mul3(4, function (err, result) {
|
||||
* // result now equals 15
|
||||
* });
|
||||
*/
|
||||
module.exports = exports['default'];
|
43
node_modules/async/concat.js
generated
vendored
Normal file
43
node_modules/async/concat.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _doLimit = require('./internal/doLimit');
|
||||
|
||||
var _doLimit2 = _interopRequireDefault(_doLimit);
|
||||
|
||||
var _concatLimit = require('./concatLimit');
|
||||
|
||||
var _concatLimit2 = _interopRequireDefault(_concatLimit);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Applies `iteratee` to each item in `coll`, concatenating the results. Returns
|
||||
* the concatenated list. The `iteratee`s are called in parallel, and the
|
||||
* results are concatenated as they return. There is no guarantee that the
|
||||
* results array will be returned in the original order of `coll` passed to the
|
||||
* `iteratee` function.
|
||||
*
|
||||
* @name concat
|
||||
* @static
|
||||
* @memberOf module:Collections
|
||||
* @method
|
||||
* @category Collection
|
||||
* @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||||
* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,
|
||||
* which should use an array as its result. Invoked with (item, callback).
|
||||
* @param {Function} [callback(err)] - A callback which is called after all the
|
||||
* `iteratee` functions have finished, or an error occurs. Results is an array
|
||||
* containing the concatenated results of the `iteratee` function. Invoked with
|
||||
* (err, results).
|
||||
* @example
|
||||
*
|
||||
* async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files) {
|
||||
* // files is now a list of filenames that exist in the 3 directories
|
||||
* });
|
||||
*/
|
||||
exports.default = (0, _doLimit2.default)(_concatLimit2.default, Infinity);
|
||||
module.exports = exports['default'];
|
65
node_modules/async/concatLimit.js
generated
vendored
Normal file
65
node_modules/async/concatLimit.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
exports.default = function (coll, limit, iteratee, callback) {
|
||||
callback = callback || _noop2.default;
|
||||
var _iteratee = (0, _wrapAsync2.default)(iteratee);
|
||||
(0, _mapLimit2.default)(coll, limit, function (val, callback) {
|
||||
_iteratee(val, function (err /*, ...args*/) {
|
||||
if (err) return callback(err);
|
||||
return callback(null, (0, _slice2.default)(arguments, 1));
|
||||
});
|
||||
}, function (err, mapResults) {
|
||||
var result = [];
|
||||
for (var i = 0; i < mapResults.length; i++) {
|
||||
if (mapResults[i]) {
|
||||
result = _concat.apply(result, mapResults[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return callback(err, result);
|
||||
});
|
||||
};
|
||||
|
||||
var _noop = require('lodash/noop');
|
||||
|
||||
var _noop2 = _interopRequireDefault(_noop);
|
||||
|
||||
var _wrapAsync = require('./internal/wrapAsync');
|
||||
|
||||
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
|
||||
|
||||
var _slice = require('./internal/slice');
|
||||
|
||||
var _slice2 = _interopRequireDefault(_slice);
|
||||
|
||||
var _mapLimit = require('./mapLimit');
|
||||
|
||||
var _mapLimit2 = _interopRequireDefault(_mapLimit);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _concat = Array.prototype.concat;
|
||||
|
||||
/**
|
||||
* The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time.
|
||||
*
|
||||
* @name concatLimit
|
||||
* @static
|
||||
* @memberOf module:Collections
|
||||
* @method
|
||||
* @see [async.concat]{@link module:Collections.concat}
|
||||
* @category Collection
|
||||
* @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||||
* @param {number} limit - The maximum number of async operations at a time.
|
||||
* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,
|
||||
* which should use an array as its result. Invoked with (item, callback).
|
||||
* @param {Function} [callback] - A callback which is called after all the
|
||||
* `iteratee` functions have finished, or an error occurs. Results is an array
|
||||
* containing the concatenated results of the `iteratee` function. Invoked with
|
||||
* (err, results).
|
||||
*/
|
||||
module.exports = exports['default'];
|
36
node_modules/async/concatSeries.js
generated
vendored
Normal file
36
node_modules/async/concatSeries.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _doLimit = require('./internal/doLimit');
|
||||
|
||||
var _doLimit2 = _interopRequireDefault(_doLimit);
|
||||
|
||||
var _concatLimit = require('./concatLimit');
|
||||
|
||||
var _concatLimit2 = _interopRequireDefault(_concatLimit);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time.
|
||||
*
|
||||
* @name concatSeries
|
||||
* @static
|
||||
* @memberOf module:Collections
|
||||
* @method
|
||||
* @see [async.concat]{@link module:Collections.concat}
|
||||
* @category Collection
|
||||
* @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||||
* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`.
|
||||
* The iteratee should complete with an array an array of results.
|
||||
* Invoked with (item, callback).
|
||||
* @param {Function} [callback(err)] - A callback which is called after all the
|
||||
* `iteratee` functions have finished, or an error occurs. Results is an array
|
||||
* containing the concatenated results of the `iteratee` function. Invoked with
|
||||
* (err, results).
|
||||
*/
|
||||
exports.default = (0, _doLimit2.default)(_concatLimit2.default, 1);
|
||||
module.exports = exports['default'];
|
66
node_modules/async/constant.js
generated
vendored
Normal file
66
node_modules/async/constant.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
exports.default = function () /*...values*/{
|
||||
var values = (0, _slice2.default)(arguments);
|
||||
var args = [null].concat(values);
|
||||
return function () /*...ignoredArgs, callback*/{
|
||||
var callback = arguments[arguments.length - 1];
|
||||
return callback.apply(this, args);
|
||||
};
|
||||
};
|
||||
|
||||
var _slice = require('./internal/slice');
|
||||
|
||||
var _slice2 = _interopRequireDefault(_slice);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* Returns a function that when called, calls-back with the values provided.
|
||||
* Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to
|
||||
* [`auto`]{@link module:ControlFlow.auto}.
|
||||
*
|
||||
* @name constant
|
||||
* @static
|
||||
* @memberOf module:Utils
|
||||
* @method
|
||||
* @category Util
|
||||
* @param {...*} arguments... - Any number of arguments to automatically invoke
|
||||
* callback with.
|
||||
* @returns {AsyncFunction} Returns a function that when invoked, automatically
|
||||
* invokes the callback with the previous given arguments.
|
||||
* @example
|
||||
*
|
||||
* async.waterfall([
|
||||
* async.constant(42),
|
||||
* function (value, next) {
|
||||
* // value === 42
|
||||
* },
|
||||
* //...
|
||||
* ], callback);
|
||||
*
|
||||
* async.waterfall([
|
||||
* async.constant(filename, "utf8"),
|
||||
* fs.readFile,
|
||||
* function (fileData, next) {
|
||||
* //...
|
||||
* }
|
||||
* //...
|
||||
* ], callback);
|
||||
*
|
||||
* async.auto({
|
||||
* hostname: async.constant("https://server.net/"),
|
||||
* port: findFreePort,
|
||||
* launchServer: ["hostname", "port", function (options, cb) {
|
||||
* startServer(options, cb);
|
||||
* }],
|
||||
* //...
|
||||
* }, callback);
|
||||
*/
|
||||
module.exports = exports['default'];
|
61
node_modules/async/detect.js
generated
vendored
Normal file
61
node_modules/async/detect.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _identity = require('lodash/identity');
|
||||
|
||||
var _identity2 = _interopRequireDefault(_identity);
|
||||
|
||||
var _createTester = require('./internal/createTester');
|
||||
|
||||
var _createTester2 = _interopRequireDefault(_createTester);
|
||||
|
||||
var _doParallel = require('./internal/doParallel');
|
||||
|
||||
var _doParallel2 = _interopRequireDefault(_doParallel);
|
||||
|
||||
var _findGetResult = require('./internal/findGetResult');
|
||||
|
||||
var _findGetResult2 = _interopRequireDefault(_findGetResult);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Returns the first value in `coll` that passes an async truth test. The
|
||||
* `iteratee` is applied in parallel, meaning the first iteratee to return
|
||||
* `true` will fire the detect `callback` with that result. That means the
|
||||
* result might not be the first item in the original `coll` (in terms of order)
|
||||
* that passes the test.
|
||||
|
||||
* If order within the original `coll` is important, then look at
|
||||
* [`detectSeries`]{@link module:Collections.detectSeries}.
|
||||
*
|
||||
* @name detect
|
||||
* @static
|
||||
* @memberOf module:Collections
|
||||
* @method
|
||||
* @alias find
|
||||
* @category Collections
|
||||
* @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||||
* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
|
||||
* The iteratee must complete with a boolean value as its result.
|
||||
* Invoked with (item, callback).
|
||||
* @param {Function} [callback] - A callback which is called as soon as any
|
||||
* iteratee returns `true`, or after all the `iteratee` functions have finished.
|
||||
* Result will be the first item in the array that passes the truth test
|
||||
* (iteratee) or the value `undefined` if none passed. Invoked with
|
||||
* (err, result).
|
||||
* @example
|
||||
*
|
||||
* async.detect(['file1','file2','file3'], function(filePath, callback) {
|
||||
* fs.access(filePath, function(err) {
|
||||
* callback(null, !err)
|
||||
* });
|
||||
* }, function(err, result) {
|
||||
* // result now equals the first file in the list that exists
|
||||
* });
|
||||
*/
|
||||
exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));
|
||||
module.exports = exports['default'];
|
48
node_modules/async/detectLimit.js
generated
vendored
Normal file
48
node_modules/async/detectLimit.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _identity = require('lodash/identity');
|
||||
|
||||
var _identity2 = _interopRequireDefault(_identity);
|
||||
|
||||
var _createTester = require('./internal/createTester');
|
||||
|
||||
var _createTester2 = _interopRequireDefault(_createTester);
|
||||
|
||||
var _doParallelLimit = require('./internal/doParallelLimit');
|
||||
|
||||
var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
|
||||
|
||||
var _findGetResult = require('./internal/findGetResult');
|
||||
|
||||
var _findGetResult2 = _interopRequireDefault(_findGetResult);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a
|
||||
* time.
|
||||
*
|
||||
* @name detectLimit
|
||||
* @static
|
||||
* @memberOf module:Collections
|
||||
* @method
|
||||
* @see [async.detect]{@link module:Collections.detect}
|
||||
* @alias findLimit
|
||||
* @category Collections
|
||||
* @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||||
* @param {number} limit - The maximum number of async operations at a time.
|
||||
* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
|
||||
* The iteratee must complete with a boolean value as its result.
|
||||
* Invoked with (item, callback).
|
||||
* @param {Function} [callback] - A callback which is called as soon as any
|
||||
* iteratee returns `true`, or after all the `iteratee` functions have finished.
|
||||
* Result will be the first item in the array that passes the truth test
|
||||
* (iteratee) or the value `undefined` if none passed. Invoked with
|
||||
* (err, result).
|
||||
*/
|
||||
exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));
|
||||
module.exports = exports['default'];
|
38
node_modules/async/detectSeries.js
generated
vendored
Normal file
38
node_modules/async/detectSeries.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _detectLimit = require('./detectLimit');
|
||||
|
||||
var _detectLimit2 = _interopRequireDefault(_detectLimit);
|
||||
|
||||
var _doLimit = require('./internal/doLimit');
|
||||
|
||||
var _doLimit2 = _interopRequireDefault(_doLimit);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.
|
||||
*
|
||||
* @name detectSeries
|
||||
* @static
|
||||
* @memberOf module:Collections
|
||||
* @method
|
||||
* @see [async.detect]{@link module:Collections.detect}
|
||||
* @alias findSeries
|
||||
* @category Collections
|
||||
* @param {Array|Iterable|Object} coll - A collection to iterate over.
|
||||
* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
|
||||
* The iteratee must complete with a boolean value as its result.
|
||||
* Invoked with (item, callback).
|
||||
* @param {Function} [callback] - A callback which is called as soon as any
|
||||
* iteratee returns `true`, or after all the `iteratee` functions have finished.
|
||||
* Result will be the first item in the array that passes the truth test
|
||||
* (iteratee) or the value `undefined` if none passed. Invoked with
|
||||
* (err, result).
|
||||
*/
|
||||
exports.default = (0, _doLimit2.default)(_detectLimit2.default, 1);
|
||||
module.exports = exports['default'];
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user