Initial
This commit is contained in:
61
resources/app/node_modules/uid-safe/HISTORY.md
generated
vendored
Normal file
61
resources/app/node_modules/uid-safe/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
2.1.5 / 2017-08-02
|
||||
==================
|
||||
|
||||
* perf: remove only trailing `=`
|
||||
|
||||
2.1.4 / 2017-03-02
|
||||
==================
|
||||
|
||||
* Remove `base64-url` dependency
|
||||
|
||||
2.1.3 / 2016-10-30
|
||||
==================
|
||||
|
||||
* deps: base64-url@1.3.3
|
||||
|
||||
2.1.2 / 2016-08-15
|
||||
==================
|
||||
|
||||
* deps: base64-url@1.3.2
|
||||
|
||||
2.1.1 / 2016-05-04
|
||||
==================
|
||||
|
||||
* deps: base64-url@1.2.2
|
||||
|
||||
2.1.0 / 2016-01-17
|
||||
==================
|
||||
|
||||
* Use `random-bytes` for byte source
|
||||
|
||||
2.0.0 / 2015-05-08
|
||||
==================
|
||||
|
||||
* Use global `Promise` when returning a promise
|
||||
|
||||
1.1.0 / 2015-02-01
|
||||
==================
|
||||
|
||||
* Use `crypto.randomBytes`, if available
|
||||
* deps: base64-url@1.2.1
|
||||
|
||||
1.0.3 / 2015-01-31
|
||||
==================
|
||||
|
||||
* Fix error branch that would throw
|
||||
* deps: base64-url@1.2.0
|
||||
|
||||
1.0.2 / 2015-01-08
|
||||
==================
|
||||
|
||||
* Remove dependency on `mz`
|
||||
|
||||
1.0.1 / 2014-06-18
|
||||
==================
|
||||
|
||||
* Remove direct `bluebird` dependency
|
||||
|
||||
1.0.0 / 2014-06-18
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
22
resources/app/node_modules/uid-safe/LICENSE
generated
vendored
Normal file
22
resources/app/node_modules/uid-safe/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||
Copyright (c) 2015-2017 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.
|
||||
107
resources/app/node_modules/uid-safe/index.js
generated
vendored
Normal file
107
resources/app/node_modules/uid-safe/index.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
/*!
|
||||
* uid-safe
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015-2017 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var randomBytes = require('random-bytes')
|
||||
|
||||
/**
|
||||
* Module variables.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var EQUAL_END_REGEXP = /=+$/
|
||||
var PLUS_GLOBAL_REGEXP = /\+/g
|
||||
var SLASH_GLOBAL_REGEXP = /\//g
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = uid
|
||||
module.exports.sync = uidSync
|
||||
|
||||
/**
|
||||
* Create a unique ID.
|
||||
*
|
||||
* @param {number} length
|
||||
* @param {function} [callback]
|
||||
* @return {Promise}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function uid (length, callback) {
|
||||
// validate callback is a function, if provided
|
||||
if (callback !== undefined && typeof callback !== 'function') {
|
||||
throw new TypeError('argument callback must be a function')
|
||||
}
|
||||
|
||||
// require the callback without promises
|
||||
if (!callback && !global.Promise) {
|
||||
throw new TypeError('argument callback is required')
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
// classic callback style
|
||||
return generateUid(length, callback)
|
||||
}
|
||||
|
||||
return new Promise(function executor (resolve, reject) {
|
||||
generateUid(length, function onUid (err, str) {
|
||||
if (err) return reject(err)
|
||||
resolve(str)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a unique ID sync.
|
||||
*
|
||||
* @param {number} length
|
||||
* @return {string}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function uidSync (length) {
|
||||
return toString(randomBytes.sync(length))
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a unique ID string.
|
||||
*
|
||||
* @param {number} length
|
||||
* @param {function} callback
|
||||
* @private
|
||||
*/
|
||||
|
||||
function generateUid (length, callback) {
|
||||
randomBytes(length, function (err, buf) {
|
||||
if (err) return callback(err)
|
||||
callback(null, toString(buf))
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Change a Buffer into a string.
|
||||
*
|
||||
* @param {Buffer} buf
|
||||
* @return {string}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function toString (buf) {
|
||||
return buf.toString('base64')
|
||||
.replace(EQUAL_END_REGEXP, '')
|
||||
.replace(PLUS_GLOBAL_REGEXP, '-')
|
||||
.replace(SLASH_GLOBAL_REGEXP, '_')
|
||||
}
|
||||
30
resources/app/node_modules/uid-safe/package.json
generated
vendored
Normal file
30
resources/app/node_modules/uid-safe/package.json
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "uid-safe",
|
||||
"description": "URL and cookie safe UIDs",
|
||||
"version": "2.1.5",
|
||||
"license": "MIT",
|
||||
"repository": "crypto-utils/uid-safe",
|
||||
"dependencies": {
|
||||
"random-bytes": "~1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bluebird": "3.5.0",
|
||||
"eslint": "3.19.0",
|
||||
"eslint-config-standard": "10.2.1",
|
||||
"eslint-plugin-import": "2.7.0",
|
||||
"eslint-plugin-node": "5.1.1",
|
||||
"eslint-plugin-promise": "3.5.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "2.5.3"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"HISTORY.md",
|
||||
"README.md",
|
||||
"index.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user