mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 02:42:48 +00:00
updated package.json
This commit is contained in:
17
node_modules/inflight/.eslintrc
generated
vendored
Normal file
17
node_modules/inflight/.eslintrc
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"env" : {
|
||||
"node" : true
|
||||
},
|
||||
"rules" : {
|
||||
"semi": [2, "never"],
|
||||
"strict": 0,
|
||||
"quotes": [1, "single", "avoid-escape"],
|
||||
"no-use-before-define": 0,
|
||||
"curly": 0,
|
||||
"no-underscore-dangle": 0,
|
||||
"no-lonely-if": 1,
|
||||
"no-unused-vars": [2, {"vars" : "all", "args" : "after-used"}],
|
||||
"no-mixed-requires": 0,
|
||||
"space-infix-ops": 0
|
||||
}
|
||||
}
|
||||
15
node_modules/inflight/LICENSE
generated
vendored
Normal file
15
node_modules/inflight/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter
|
||||
|
||||
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.
|
||||
37
node_modules/inflight/README.md
generated
vendored
Normal file
37
node_modules/inflight/README.md
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
# inflight
|
||||
|
||||
Add callbacks to requests in flight to avoid async duplication
|
||||
|
||||
## USAGE
|
||||
|
||||
```javascript
|
||||
var inflight = require('inflight')
|
||||
|
||||
// some request that does some stuff
|
||||
function req(key, callback) {
|
||||
// key is any random string. like a url or filename or whatever.
|
||||
//
|
||||
// will return either a falsey value, indicating that the
|
||||
// request for this key is already in flight, or a new callback
|
||||
// which when called will call all callbacks passed to inflightk
|
||||
// with the same key
|
||||
callback = inflight(key, callback)
|
||||
|
||||
// If we got a falsey value back, then there's already a req going
|
||||
if (!callback) return
|
||||
|
||||
// this is where you'd fetch the url or whatever
|
||||
// callback is also once()-ified, so it can safely be assigned
|
||||
// to multiple events etc. First call wins.
|
||||
setTimeout(function() {
|
||||
callback(null, key)
|
||||
}, 100)
|
||||
}
|
||||
|
||||
// only assigns a single setTimeout
|
||||
// when it dings, all cbs get called
|
||||
req('foo', cb1)
|
||||
req('foo', cb2)
|
||||
req('foo', cb3)
|
||||
req('foo', cb4)
|
||||
```
|
||||
44
node_modules/inflight/inflight.js
generated
vendored
Normal file
44
node_modules/inflight/inflight.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
var wrappy = require('wrappy')
|
||||
var reqs = Object.create(null)
|
||||
var once = require('once')
|
||||
|
||||
module.exports = wrappy(inflight)
|
||||
|
||||
function inflight (key, cb) {
|
||||
if (reqs[key]) {
|
||||
reqs[key].push(cb)
|
||||
return null
|
||||
} else {
|
||||
reqs[key] = [cb]
|
||||
return makeres(key)
|
||||
}
|
||||
}
|
||||
|
||||
function makeres (key) {
|
||||
return once(function RES () {
|
||||
var cbs = reqs[key]
|
||||
var len = cbs.length
|
||||
var args = slice(arguments)
|
||||
for (var i = 0; i < len; i++) {
|
||||
cbs[i].apply(null, args)
|
||||
}
|
||||
if (cbs.length > len) {
|
||||
// added more in the interim.
|
||||
// de-zalgo, just in case, but don't call again.
|
||||
cbs.splice(0, len)
|
||||
process.nextTick(function () {
|
||||
RES.apply(null, args)
|
||||
})
|
||||
} else {
|
||||
delete reqs[key]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function slice (args) {
|
||||
var length = args.length
|
||||
var array = []
|
||||
|
||||
for (var i = 0; i < length; i++) array[i] = args[i]
|
||||
return array
|
||||
}
|
||||
86
node_modules/inflight/package.json
generated
vendored
Normal file
86
node_modules/inflight/package.json
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"inflight@^1.0.4",
|
||||
"/home/mywebsite/node_modules/glob"
|
||||
]
|
||||
],
|
||||
"_from": "inflight@>=1.0.4 <2.0.0",
|
||||
"_id": "inflight@1.0.4",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/inflight",
|
||||
"_nodeVersion": "0.10.32",
|
||||
"_npmUser": {
|
||||
"email": "ogd@aoaioxxysz.net",
|
||||
"name": "othiym23"
|
||||
},
|
||||
"_npmVersion": "2.1.3",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "inflight",
|
||||
"raw": "inflight@^1.0.4",
|
||||
"rawSpec": "^1.0.4",
|
||||
"scope": null,
|
||||
"spec": ">=1.0.4 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/glob"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz",
|
||||
"_shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "inflight@^1.0.4",
|
||||
"_where": "/home/mywebsite/node_modules/glob",
|
||||
"author": {
|
||||
"email": "i@izs.me",
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"url": "http://blog.izs.me/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/inflight/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
},
|
||||
"description": "Add callbacks to requests in flight to avoid async duplication",
|
||||
"devDependencies": {
|
||||
"tap": "^0.4.10"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a",
|
||||
"tarball": "http://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz"
|
||||
},
|
||||
"gitHead": "c7b5531d572a867064d4a1da9e013e8910b7d1ba",
|
||||
"homepage": "https://github.com/isaacs/inflight",
|
||||
"license": "ISC",
|
||||
"main": "inflight.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "isaacs",
|
||||
"email": "i@izs.me"
|
||||
},
|
||||
{
|
||||
"name": "othiym23",
|
||||
"email": "ogd@aoaioxxysz.net"
|
||||
},
|
||||
{
|
||||
"name": "iarna",
|
||||
"email": "me@re-becca.org"
|
||||
}
|
||||
],
|
||||
"name": "inflight",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/inflight.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test.js"
|
||||
},
|
||||
"version": "1.0.4"
|
||||
}
|
||||
97
node_modules/inflight/test.js
generated
vendored
Normal file
97
node_modules/inflight/test.js
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
var test = require('tap').test
|
||||
var inf = require('./inflight.js')
|
||||
|
||||
|
||||
function req (key, cb) {
|
||||
cb = inf(key, cb)
|
||||
if (cb) setTimeout(function () {
|
||||
cb(key)
|
||||
cb(key)
|
||||
})
|
||||
return cb
|
||||
}
|
||||
|
||||
test('basic', function (t) {
|
||||
var calleda = false
|
||||
var a = req('key', function (k) {
|
||||
t.notOk(calleda)
|
||||
calleda = true
|
||||
t.equal(k, 'key')
|
||||
if (calledb) t.end()
|
||||
})
|
||||
t.ok(a, 'first returned cb function')
|
||||
|
||||
var calledb = false
|
||||
var b = req('key', function (k) {
|
||||
t.notOk(calledb)
|
||||
calledb = true
|
||||
t.equal(k, 'key')
|
||||
if (calleda) t.end()
|
||||
})
|
||||
|
||||
t.notOk(b, 'second should get falsey inflight response')
|
||||
})
|
||||
|
||||
test('timing', function (t) {
|
||||
var expect = [
|
||||
'method one',
|
||||
'start one',
|
||||
'end one',
|
||||
'two',
|
||||
'tick',
|
||||
'three'
|
||||
]
|
||||
var i = 0
|
||||
|
||||
function log (m) {
|
||||
t.equal(m, expect[i], m + ' === ' + expect[i])
|
||||
++i
|
||||
if (i === expect.length)
|
||||
t.end()
|
||||
}
|
||||
|
||||
function method (name, cb) {
|
||||
log('method ' + name)
|
||||
process.nextTick(cb)
|
||||
}
|
||||
|
||||
var one = inf('foo', function () {
|
||||
log('start one')
|
||||
var three = inf('foo', function () {
|
||||
log('three')
|
||||
})
|
||||
if (three) method('three', three)
|
||||
log('end one')
|
||||
})
|
||||
|
||||
method('one', one)
|
||||
|
||||
var two = inf('foo', function () {
|
||||
log('two')
|
||||
})
|
||||
if (two) method('one', two)
|
||||
|
||||
process.nextTick(log.bind(null, 'tick'))
|
||||
})
|
||||
|
||||
test('parameters', function (t) {
|
||||
t.plan(8)
|
||||
|
||||
var a = inf('key', function (first, second, third) {
|
||||
t.equal(first, 1)
|
||||
t.equal(second, 2)
|
||||
t.equal(third, 3)
|
||||
})
|
||||
t.ok(a, 'first returned cb function')
|
||||
|
||||
var b = inf('key', function (first, second, third) {
|
||||
t.equal(first, 1)
|
||||
t.equal(second, 2)
|
||||
t.equal(third, 3)
|
||||
})
|
||||
t.notOk(b, 'second should get falsey inflight response')
|
||||
|
||||
setTimeout(function () {
|
||||
a(1, 2, 3)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user