database externa

This commit is contained in:
nau
2016-08-23 18:11:51 +02:00
parent 8a6f3bf221
commit 5fa880dd01
616 changed files with 101532 additions and 43773 deletions

View File

@@ -4,6 +4,25 @@
All notable changes to this project will be documented in this file starting from version **v4.0.0**.
This project adheres to [Semantic Versioning](http://semver.org/).
## 7.1.7 - 2016-07-29
- Use lodash.once instead of unlicensed/unmaintained cb ([3ac95ad93ef3068a64e03d8d14deff231b1ed529](https://github.com/auth0/node-jsonwebtoken/commit/3ac95ad93ef3068a64e03d8d14deff231b1ed529))
## 7.1.6 - 2016-07-15
- fix issue with buffer payload. closes #216 ([6b50ff324b4dfd2cb0e49b666f14a6672d015b22](https://github.com/auth0/node-jsonwebtoken/commit/6b50ff324b4dfd2cb0e49b666f14a6672d015b22)), closes [#216](https://github.com/auth0/node-jsonwebtoken/issues/216)
## 7.1.5 - 2016-07-15
- update jws in package.json ([b6260951eefc68aae5f4ede359210761f901ff7a](https://github.com/auth0/node-jsonwebtoken/commit/b6260951eefc68aae5f4ede359210761f901ff7a))
## 7.1.4 - 2016-07-14
- add redundant test ([bece8816096f324511c3efcb8db0e64b75d757a1](https://github.com/auth0/node-jsonwebtoken/commit/bece8816096f324511c3efcb8db0e64b75d757a1))
- fix an issue of double callback on error ([758ca5eeca2f1b06c32c9fce70642bf488b2e52b](https://github.com/auth0/node-jsonwebtoken/commit/758ca5eeca2f1b06c32c9fce70642bf488b2e52b))
## 7.1.2 - 2016-07-12
- do not stringify the payload when signing async - closes #224 ([084f537d3dfbcef2bea411cc0a1515899cc8aa21](https://github.com/auth0/node-jsonwebtoken/commit/084f537d3dfbcef2bea411cc0a1515899cc8aa21)), closes [#224](https://github.com/auth0/node-jsonwebtoken/issues/224)

View File

@@ -1,2 +0,0 @@
*.DS_Store
node_modules

View File

@@ -1,6 +0,0 @@
.PHONY: test
MOCHA = ./node_modules/mocha/bin/mocha
test:
$(MOCHA) -R list

View File

@@ -1,95 +0,0 @@
# cb()
A minimal node.js utility for handling common (but often overlooked) callback scenarios.
##Features
* `.timeout()`: Simple callback timeouts
* `.error()`: Explicit error handling
* `.once()`: Once-and-only-once callback semantics
* Guaranteed asynchronous callback execution (protects against code that breaks this assumption)
## Installation
$ npm install cb
## Usage
### Basic Usage
The most basic usage of `cb` consists of passing in your own function reference. In this example, `cb` will do nothing other
than insure the once-and-only-once, asynchronous invocation of the callback.
doAsync(cb(function(err, res) {
console.log(res);
}));
### Timeout Handling
Timeouts are specified through the `.timeout()` method, and are specified in milliseconds. If a timeout does occur, the error
passed to the callback will be an instance of `cb.TimeoutError`.
doReallySlowAsync(cb(function(err, res) {
assert(err instanceof cb.TimeoutError);
}).timeout(50));
*Note: once a timeout has occured, any tardy attempts to invoke the callback will be ignored.*
### Explicit Error Handling
In situations where it is convenient to separate the code that runs on success or failure, this can easily be accomplished
with `.error()`. If an 'errback' handler has been provided to `.error()`, then it is assumed that the error-first parameter
to the success handler is no longer required. To illustrate,
doAsync(cb(function(err, res) {
if (err) {
console.error(err);
} else {
console.log(res);
}
}));
Can be rewritten as:
doAsync(cb(console.log).error(console.error));
### Force Once-and-only-once Callback Execution
Sometimes it's necessary to ensure that a callback is invoked once, and no more. Once-and-only-once execution semantics can be
enforced by using `.once()`.
function runTwice(callback) {
process.nextTick(function() {
callback();
callback();
});
}
runTwice(cb(function() {
console.log('I will only run once');
}).once());
*Note: technically, `.once()` simply enforces at-most-once semantics. However, when combined with `.timeout()`, once-and-only-once
is achieved.*
### Combining Features
The `cb` API is fully chainable, and any arrangement of the features is valid. For example:
doAsync(cb(console.log).error(console.error).timeout(50).once());
## Running the Tests
$ make test
## License
The MIT License (MIT)
Copyright (c) 2012 Jeremy Martin
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.

View File

@@ -1,39 +0,0 @@
module.exports = function(callback) {
var cb = function() {
if (timedout || (once && count)) return;
count += 1;
tid && clearTimeout(tid);
var args = Array.prototype.slice.call(arguments);
process.nextTick(function() {
if (!errback) return callback.apply(this, args);
args[0] ? errback(args[0]) : callback.apply(this, args.slice(1));
});
}, count = 0, once = false, timedout = false, errback, tid;
cb.timeout = function(ms) {
tid && clearTimeout(tid);
tid = setTimeout(function() {
cb(new TimeoutError(ms));
timedout = true;
}, ms);
return cb;
};
cb.error = function(func) { errback = func; return cb; };
cb.once = function() { once = true; return cb; };
return cb;
};
var TimeoutError = module.exports.TimeoutError = function TimeoutError(ms) {
this.message = 'Specified timeout of ' + ms + 'ms was reached';
Error.captureStackTrace(this, this.constructor);
};
TimeoutError.prototype = new Error;
TimeoutError.prototype.constructor = TimeoutError;
TimeoutError.prototype.name = 'TimeoutError';

View File

@@ -1,46 +0,0 @@
{
"author": {
"name": "Jeremy Martin",
"email": "jmar777@gmail.com",
"url": "http://twitter.com/jmar777"
},
"name": "cb",
"description": "Super simple callback mechanism with support for timeouts and explicit error handling",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "git://github.com/jmar777/cb.git"
},
"main": "lib/cb.js",
"devDependencies": {
"mocha": ">=0.3.6"
},
"engines": {
"node": ">=0.6.0"
},
"_npmUser": {
"name": "jmar777",
"email": "jmar777@gmail.com"
},
"_id": "cb@0.1.0",
"dependencies": {},
"optionalDependencies": {},
"_engineSupported": true,
"_npmVersion": "1.1.0-2",
"_nodeVersion": "v0.6.8",
"_defaultsLoaded": true,
"dist": {
"shasum": "26f7e740f2808facc83cef7b20392e4d881b5203",
"tarball": "https://registry.npmjs.org/cb/-/cb-0.1.0.tgz"
},
"maintainers": [
{
"name": "jmar777",
"email": "jmar777@gmail.com"
}
],
"directories": {},
"_shasum": "26f7e740f2808facc83cef7b20392e4d881b5203",
"_resolved": "https://registry.npmjs.org/cb/-/cb-0.1.0.tgz",
"_from": "cb@>=0.1.0 <0.2.0"
}

View File

@@ -1,125 +0,0 @@
var assert = require('assert'),
cb = require('../');
function invokeAsync(callback) {
setTimeout(function() {
callback(null, 'foo');
}, 100);
}
function invokeAsyncError(callback) {
setTimeout(function() {
callback(new Error());
}, 100);
}
function invokeAsyncTwice(callback) {
setTimeout(function() {
callback(null, 'foo');
callback(null, 'foo');
}, 100);
}
describe('cb(callback)', function() {
it('should invoke the provided callback', function(done) {
invokeAsync(cb(function(err, res) {
assert.strictEqual(res, 'foo');
done();
}));
});
it('shouldn\'t mess with errors', function(done) {
invokeAsyncError(cb(function(err, res) {
assert(err);
done();
}));
});
it('should allow multiple executions', function(done) {
var count = 0;
invokeAsyncTwice(cb(function(err, res) {
count++;
if (count === 2) done();
}));
});
});
describe('cb(callback).timeout(ms)', function() {
it('should complete successfully within timeout period', function(done) {
invokeAsync(cb(function(err, res) {
assert.strictEqual(res, 'foo');
done();
}).timeout(200));
});
it('should complete with an error after timeout period', function(done) {
invokeAsync(cb(function(err, res) {
assert(err);
done();
}).timeout(50));
});
it('error resulting from a timeout should be instanceof cb.TimeoutError', function(done) {
invokeAsync(cb(function(err, res) {
assert(err instanceof cb.TimeoutError);
done();
}).timeout(50));
});
});
describe('cb(callback).error(errback)', function() {
it('should skip the err argument when invoking callback', function(done) {
invokeAsync(cb(function(res) {
assert.strictEqual(res, 'foo');
done();
}).error(assert.ifError));
});
it('should pass errors to provided errback', function(done) {
invokeAsyncError(cb(function(res) {
throw new Error('should not be invoked');
}).error(function(err) {
assert(err);
done();
}));
});
});
describe('cb(callback).error(errback).timeout(ms)', function() {
it('should skip the err argument when invoking callback', function(done) {
invokeAsync(cb(function(res) {
assert.strictEqual(res, 'foo');
done();
}).error(assert.ifError).timeout(200));
});
it('should pass timeout error to provided errback', function(done) {
invokeAsyncError(cb(function(res) {
throw new Error('should not be invoked');
}).error(function(err) {
assert(err);
done();
}).timeout(50));
});
});
describe('cb(callback).once()', function() {
it('should allow multiple executions', function(done) {
var count = 0;
invokeAsyncTwice(cb(function(err, res) {
count++;
assert.notEqual(count, 2);
setTimeout(done, 100);
}).once());
});
});

View File

@@ -58,5 +58,6 @@
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz"
"_resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -144,5 +144,6 @@
"tmp": "tmp/moment-2.14.1.tgz_1467614674915_0.32715084473602474"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/moment/-/moment-2.14.1.tgz"
"_resolved": "https://registry.npmjs.org/moment/-/moment-2.14.1.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -4,7 +4,7 @@
"version": "1.1.0",
"repository": {
"type": "git",
"url": "git://github.com/hapijs/topo"
"url": "git://github.com/hapijs/topo.git"
},
"main": "lib/index.js",
"keywords": [
@@ -56,5 +56,6 @@
"tarball": "https://registry.npmjs.org/topo/-/topo-1.1.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/topo/-/topo-1.1.0.tgz"
"_resolved": "https://registry.npmjs.org/topo/-/topo-1.1.0.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -63,5 +63,6 @@
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/joi/-/joi-6.10.1.tgz"
"_resolved": "https://registry.npmjs.org/joi/-/joi-6.10.1.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -5,7 +5,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/sindresorhus/camelcase"
"url": "git+https://github.com/sindresorhus/camelcase.git"
},
"author": {
"name": "Sindre Sorhus",
@@ -63,5 +63,6 @@
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz"
"_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -5,7 +5,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/sindresorhus/map-obj"
"url": "git+https://github.com/sindresorhus/map-obj.git"
},
"author": {
"name": "Sindre Sorhus",
@@ -61,5 +61,6 @@
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz"
"_resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -5,7 +5,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/sindresorhus/camelcase-keys"
"url": "git+https://github.com/sindresorhus/camelcase-keys.git"
},
"author": {
"name": "Sindre Sorhus",
@@ -76,5 +76,6 @@
"tarball": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-1.0.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-1.0.0.tgz"
"_resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-1.0.0.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -5,7 +5,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/sindresorhus/get-stdin"
"url": "git+https://github.com/sindresorhus/get-stdin.git"
},
"author": {
"name": "Sindre Sorhus",
@@ -59,5 +59,6 @@
"tarball": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"
"_resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -5,7 +5,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/sindresorhus/indent-string"
"url": "git+https://github.com/sindresorhus/indent-string.git"
},
"author": {
"name": "Sindre Sorhus",
@@ -68,5 +68,6 @@
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/indent-string/-/indent-string-1.2.2.tgz"
"_resolved": "https://registry.npmjs.org/indent-string/-/indent-string-1.2.2.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -5,7 +5,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/sindresorhus/object-assign"
"url": "git+https://github.com/sindresorhus/object-assign.git"
},
"author": {
"name": "Sindre Sorhus",
@@ -62,5 +62,6 @@
"tarball": "https://registry.npmjs.org/object-assign/-/object-assign-1.0.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-1.0.0.tgz"
"_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-1.0.0.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -5,7 +5,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/sindresorhus/meow"
"url": "git+https://github.com/sindresorhus/meow.git"
},
"author": {
"name": "Sindre Sorhus",
@@ -63,5 +63,6 @@
"tarball": "https://registry.npmjs.org/meow/-/meow-2.0.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/meow/-/meow-2.0.0.tgz"
"_resolved": "https://registry.npmjs.org/meow/-/meow-2.0.0.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -57,5 +57,6 @@
"tmp": "tmp/base64url-1.0.6.tgz_1455309394658_0.6706331633031368"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/base64url/-/base64url-1.0.6.tgz"
"_resolved": "https://registry.npmjs.org/base64url/-/base64url-1.0.6.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -8,7 +8,7 @@
},
"repository": {
"type": "git",
"url": "git@github.com:goinstant/buffer-equal-constant-time.git"
"url": "git+ssh://git@github.com/goinstant/buffer-equal-constant-time.git"
},
"keywords": [
"buffer",
@@ -47,5 +47,6 @@
],
"directories": {},
"_shasum": "f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819",
"_resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz"
"_resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
"homepage": "https://github.com/goinstant/buffer-equal-constant-time#readme"
}

View File

@@ -69,5 +69,6 @@
"tmp": "tmp/base64-url-1.3.2.tgz_1468593630635_0.8208693880587816"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/base64-url/-/base64-url-1.3.2.tgz"
"_resolved": "https://registry.npmjs.org/base64-url/-/base64-url-1.3.2.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -69,5 +69,6 @@
"tmp": "tmp/ecdsa-sig-formatter-1.0.7.tgz_1466263566774_0.3799667169805616"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.7.tgz"
"_resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.7.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -70,5 +70,6 @@
"host": "packages-5-east.internal.npmjs.com",
"tmp": "tmp/jwa-1.1.3.tgz_1455809964709_0.6556255409959704"
},
"_resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.3.tgz"
"_resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.3.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -67,5 +67,6 @@
"host": "packages-6-west.internal.npmjs.com",
"tmp": "tmp/jws-3.1.3.tgz_1455809983684_0.8235816163942218"
},
"_resolved": "https://registry.npmjs.org/jws/-/jws-3.1.3.tgz"
"_resolved": "https://registry.npmjs.org/jws/-/jws-3.1.3.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -0,0 +1,47 @@
Copyright jQuery Foundation and other contributors <https://jquery.org/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
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.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View File

@@ -0,0 +1,18 @@
# lodash.once v4.1.1
The [lodash](https://lodash.com/) method `_.once` exported as a [Node.js](https://nodejs.org/) module.
## Installation
Using npm:
```bash
$ {sudo -H} npm i -g npm
$ npm i --save lodash.once
```
In Node.js:
```js
var once = require('lodash.once');
```
See the [documentation](https://lodash.com/docs#once) or [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash.once) for more details.

View File

@@ -0,0 +1,294 @@
/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_INTEGER = 1.7976931348623157e+308,
NAN = 0 / 0;
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/**
* Creates a function that invokes `func`, with the `this` binding and arguments
* of the created function, while it's called less than `n` times. Subsequent
* calls to the created function return the result of the last `func` invocation.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {number} n The number of calls at which `func` is no longer invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* jQuery(element).on('click', _.before(5, addContactToList));
* // => Allows adding up to 4 contacts to the list.
*/
function before(n, func) {
var result;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
return function() {
if (--n > 0) {
result = func.apply(this, arguments);
}
if (n <= 1) {
func = undefined;
}
return result;
};
}
/**
* Creates a function that is restricted to invoking `func` once. Repeat calls
* to the function return the value of the first invocation. The `func` is
* invoked with the `this` binding and arguments of the created function.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var initialize = _.once(createApplication);
* initialize();
* initialize();
* // => `createApplication` is invoked once
*/
function once(func) {
return before(2, func);
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
}
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3.2');
* // => 3
*/
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? (remainder ? result - remainder : result) : 0;
}
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
module.exports = once;

View File

@@ -0,0 +1,78 @@
{
"name": "lodash.once",
"version": "4.1.1",
"description": "The lodash method `_.once` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",
"license": "MIT",
"keywords": [
"lodash-modularized",
"once"
],
"author": {
"name": "John-David Dalton",
"email": "john.david.dalton@gmail.com",
"url": "http://allyoucanleet.com/"
},
"contributors": [
{
"name": "John-David Dalton",
"email": "john.david.dalton@gmail.com",
"url": "http://allyoucanleet.com/"
},
{
"name": "Blaine Bublitz",
"email": "blaine.bublitz@gmail.com",
"url": "https://github.com/phated"
},
{
"name": "Mathias Bynens",
"email": "mathias@qiwi.be",
"url": "https://mathiasbynens.be/"
}
],
"repository": {
"type": "git",
"url": "git+https://github.com/lodash/lodash.git"
},
"scripts": {
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
},
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash.once@4.1.1",
"_shasum": "0dd3971213c7c56df880977d504c88fb471a97ac",
"_from": "lodash.once@>=4.0.0 <5.0.0",
"_npmVersion": "2.15.10",
"_nodeVersion": "4.4.7",
"_npmUser": {
"name": "jdalton",
"email": "john.david.dalton@gmail.com"
},
"dist": {
"shasum": "0dd3971213c7c56df880977d504c88fb471a97ac",
"tarball": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz"
},
"maintainers": [
{
"name": "jdalton",
"email": "john.david.dalton@gmail.com"
},
{
"name": "mathias",
"email": "mathias@qiwi.be"
},
{
"name": "phated",
"email": "blaine@iceddev.com"
}
],
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/lodash.once-4.1.1.tgz_1471110166870_0.09848929662257433"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
"readme": "ERROR: No README data found!"
}

View File

@@ -1,6 +1,6 @@
{
"name": "jsonwebtoken",
"version": "7.1.6",
"version": "7.1.9",
"description": "JSON Web Token implementation (symmetric and asymmetric)",
"main": "index.js",
"scripts": {
@@ -21,9 +21,9 @@
"url": "https://github.com/auth0/node-jsonwebtoken/issues"
},
"dependencies": {
"cb": "^0.1.0",
"joi": "^6.10.1",
"jws": "^3.1.3",
"lodash.once": "^4.0.0",
"ms": "^0.7.1",
"xtend": "^4.0.1"
},
@@ -38,10 +38,10 @@
"npm": ">=1.4.28",
"node": ">=0.12"
},
"gitHead": "ae360b56792a875e16cefa8ff4103b87b4a2e386",
"gitHead": "cc0f4d67b649110a035db3df9265f05db269a15a",
"homepage": "https://github.com/auth0/node-jsonwebtoken#readme",
"_id": "jsonwebtoken@7.1.6",
"_shasum": "2ea9557af144311148f53093cfeec69e1e048abc",
"_id": "jsonwebtoken@7.1.9",
"_shasum": "847804e5258bec5a9499a8dc4a5e7a3bae08d58a",
"_from": "jsonwebtoken@latest",
"_npmVersion": "2.15.1",
"_nodeVersion": "4.4.3",
@@ -50,8 +50,8 @@
"email": "jfromaniello@gmail.com"
},
"dist": {
"shasum": "2ea9557af144311148f53093cfeec69e1e048abc",
"tarball": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-7.1.6.tgz"
"shasum": "847804e5258bec5a9499a8dc4a5e7a3bae08d58a",
"tarball": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-7.1.9.tgz"
},
"maintainers": [
{
@@ -84,9 +84,10 @@
}
],
"_npmOperationalInternal": {
"host": "packages-16-east.internal.npmjs.com",
"tmp": "tmp/jsonwebtoken-7.1.6.tgz_1468585972042_0.5801840056665242"
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/jsonwebtoken-7.1.9.tgz_1470932603683_0.2585906428284943"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-7.1.6.tgz"
"_resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-7.1.9.tgz",
"readme": "ERROR: No README data found!"
}

4
node_modules/jsonwebtoken/sign.js generated vendored
View File

@@ -2,7 +2,7 @@ var Joi = require('joi');
var timespan = require('./lib/timespan');
var xtend = require('xtend');
var jws = require('jws');
var cb = require('cb');
var once = require('lodash.once');
var sign_options_schema = Joi.object().keys({
expiresIn: [Joi.number().integer(), Joi.string()],
@@ -129,7 +129,7 @@ module.exports = function (payload, secretOrPrivateKey, options, callback) {
var encoding = options.encoding || 'utf8';
if (typeof callback === 'function') {
callback = callback && cb(callback).once();
callback = callback && once(callback);
jws.createSign({
header: header,