From c056d02790c0d88d321c1f91e5fc08d2eac4b35c Mon Sep 17 00:00:00 2001 From: Walamana Date: Mon, 27 Nov 2017 18:27:05 +0100 Subject: [PATCH] Redirecting http to https Signed-off-by: Walamana --- app.js | 5 + node_modules/express-force-ssl/.npmignore | 170 +++++++++++++ node_modules/express-force-ssl/LICENSE | 21 ++ node_modules/express-force-ssl/README.md | 208 +++++++++++++++ .../express-force-ssl/examples/example.js | 34 +++ node_modules/express-force-ssl/index.js | 80 ++++++ node_modules/express-force-ssl/package.json | 79 ++++++ node_modules/express-force-ssl/test/http.js | 140 +++++++++++ .../test/https-disable-301s.js | 102 ++++++++ node_modules/express-force-ssl/test/https.js | 63 +++++ .../express-force-ssl/test/keys/localhost.crt | 21 ++ .../express-force-ssl/test/keys/localhost.csr | 17 ++ .../express-force-ssl/test/keys/localhost.key | 27 ++ .../express-force-ssl/test/server/index.js | 82 ++++++ .../test/variable-overide.js | 91 +++++++ .../test/x-forwarded-proto-trusted.js | 133 ++++++++++ .../test/x-forwarded-proto.js | 136 ++++++++++ node_modules/lodash._baseassign/LICENSE.txt | 22 ++ node_modules/lodash._baseassign/README.md | 20 ++ node_modules/lodash._baseassign/index.js | 27 ++ node_modules/lodash._baseassign/package.json | 79 ++++++ node_modules/lodash._basecopy/LICENSE.txt | 22 ++ node_modules/lodash._basecopy/README.md | 20 ++ node_modules/lodash._basecopy/index.js | 32 +++ node_modules/lodash._basecopy/package.json | 75 ++++++ node_modules/lodash._bindcallback/LICENSE.txt | 22 ++ node_modules/lodash._bindcallback/README.md | 20 ++ node_modules/lodash._bindcallback/index.js | 65 +++++ .../lodash._bindcallback/package.json | 75 ++++++ .../lodash._createassigner/LICENSE.txt | 22 ++ node_modules/lodash._createassigner/README.md | 20 ++ node_modules/lodash._createassigner/index.js | 52 ++++ .../lodash._createassigner/package.json | 80 ++++++ node_modules/lodash._getnative/LICENSE | 22 ++ node_modules/lodash._getnative/README.md | 20 ++ node_modules/lodash._getnative/index.js | 137 ++++++++++ node_modules/lodash._getnative/package.json | 75 ++++++ .../lodash._isiterateecall/LICENSE.txt | 22 ++ node_modules/lodash._isiterateecall/README.md | 20 ++ node_modules/lodash._isiterateecall/index.js | 132 ++++++++++ .../lodash._isiterateecall/package.json | 75 ++++++ node_modules/lodash.assign/LICENSE.txt | 22 ++ node_modules/lodash.assign/README.md | 20 ++ node_modules/lodash.assign/index.js | 80 ++++++ node_modules/lodash.assign/package.json | 86 +++++++ node_modules/lodash.isarguments/LICENSE | 47 ++++ node_modules/lodash.isarguments/README.md | 18 ++ node_modules/lodash.isarguments/index.js | 229 +++++++++++++++++ node_modules/lodash.isarguments/package.json | 69 +++++ node_modules/lodash.isarray/LICENSE | 22 ++ node_modules/lodash.isarray/README.md | 20 ++ node_modules/lodash.isarray/index.js | 180 +++++++++++++ node_modules/lodash.isarray/package.json | 81 ++++++ node_modules/lodash.keys/LICENSE | 22 ++ node_modules/lodash.keys/README.md | 20 ++ node_modules/lodash.keys/index.js | 236 ++++++++++++++++++ node_modules/lodash.keys/package.json | 87 +++++++ node_modules/lodash.restparam/LICENSE.txt | 22 ++ node_modules/lodash.restparam/README.md | 20 ++ node_modules/lodash.restparam/index.js | 67 +++++ node_modules/lodash.restparam/package.json | 81 ++++++ package-lock.json | 82 ++++++ package.json | 1 + 63 files changed, 4077 insertions(+) create mode 100644 node_modules/express-force-ssl/.npmignore create mode 100644 node_modules/express-force-ssl/LICENSE create mode 100644 node_modules/express-force-ssl/README.md create mode 100644 node_modules/express-force-ssl/examples/example.js create mode 100644 node_modules/express-force-ssl/index.js create mode 100644 node_modules/express-force-ssl/package.json create mode 100644 node_modules/express-force-ssl/test/http.js create mode 100644 node_modules/express-force-ssl/test/https-disable-301s.js create mode 100644 node_modules/express-force-ssl/test/https.js create mode 100644 node_modules/express-force-ssl/test/keys/localhost.crt create mode 100644 node_modules/express-force-ssl/test/keys/localhost.csr create mode 100644 node_modules/express-force-ssl/test/keys/localhost.key create mode 100644 node_modules/express-force-ssl/test/server/index.js create mode 100644 node_modules/express-force-ssl/test/variable-overide.js create mode 100644 node_modules/express-force-ssl/test/x-forwarded-proto-trusted.js create mode 100644 node_modules/express-force-ssl/test/x-forwarded-proto.js create mode 100644 node_modules/lodash._baseassign/LICENSE.txt create mode 100644 node_modules/lodash._baseassign/README.md create mode 100644 node_modules/lodash._baseassign/index.js create mode 100644 node_modules/lodash._baseassign/package.json create mode 100644 node_modules/lodash._basecopy/LICENSE.txt create mode 100644 node_modules/lodash._basecopy/README.md create mode 100644 node_modules/lodash._basecopy/index.js create mode 100644 node_modules/lodash._basecopy/package.json create mode 100644 node_modules/lodash._bindcallback/LICENSE.txt create mode 100644 node_modules/lodash._bindcallback/README.md create mode 100644 node_modules/lodash._bindcallback/index.js create mode 100644 node_modules/lodash._bindcallback/package.json create mode 100644 node_modules/lodash._createassigner/LICENSE.txt create mode 100644 node_modules/lodash._createassigner/README.md create mode 100644 node_modules/lodash._createassigner/index.js create mode 100644 node_modules/lodash._createassigner/package.json create mode 100644 node_modules/lodash._getnative/LICENSE create mode 100644 node_modules/lodash._getnative/README.md create mode 100644 node_modules/lodash._getnative/index.js create mode 100644 node_modules/lodash._getnative/package.json create mode 100644 node_modules/lodash._isiterateecall/LICENSE.txt create mode 100644 node_modules/lodash._isiterateecall/README.md create mode 100644 node_modules/lodash._isiterateecall/index.js create mode 100644 node_modules/lodash._isiterateecall/package.json create mode 100644 node_modules/lodash.assign/LICENSE.txt create mode 100644 node_modules/lodash.assign/README.md create mode 100644 node_modules/lodash.assign/index.js create mode 100644 node_modules/lodash.assign/package.json create mode 100644 node_modules/lodash.isarguments/LICENSE create mode 100644 node_modules/lodash.isarguments/README.md create mode 100644 node_modules/lodash.isarguments/index.js create mode 100644 node_modules/lodash.isarguments/package.json create mode 100644 node_modules/lodash.isarray/LICENSE create mode 100644 node_modules/lodash.isarray/README.md create mode 100644 node_modules/lodash.isarray/index.js create mode 100644 node_modules/lodash.isarray/package.json create mode 100644 node_modules/lodash.keys/LICENSE create mode 100644 node_modules/lodash.keys/README.md create mode 100644 node_modules/lodash.keys/index.js create mode 100644 node_modules/lodash.keys/package.json create mode 100644 node_modules/lodash.restparam/LICENSE.txt create mode 100644 node_modules/lodash.restparam/README.md create mode 100644 node_modules/lodash.restparam/index.js create mode 100644 node_modules/lodash.restparam/package.json diff --git a/app.js b/app.js index 890e1b3..8928708 100644 --- a/app.js +++ b/app.js @@ -1,8 +1,10 @@ var express = require("express"); var cookieParser = require("cookie-parser"); +var forceSsl = require('express-force-ssl'); var app = express(); app.use(cookieParser()); +app.use(forceSsl); var uuid = require("uuid/v4"); var mysql = require("mysql"); @@ -150,6 +152,9 @@ https.createServer( app ).listen(3000); +var http = require('http'); +http.createServer(app).listen(80); + function isConnected(){ if(con.isConnected){ diff --git a/node_modules/express-force-ssl/.npmignore b/node_modules/express-force-ssl/.npmignore new file mode 100644 index 0000000..9de8aae --- /dev/null +++ b/node_modules/express-force-ssl/.npmignore @@ -0,0 +1,170 @@ +################# +## JetBrains +################# +.idea/ + +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.vspscc +.builds +*.dotCover + +## TODO: If you have NuGet Package Restore enabled, uncomment this +#packages/ + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp + +# ReSharper is a .NET coding add-in +_ReSharper* + +# Installshield output folder +[Ee]xpress + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish + +# Others +[Bb]in +[Oo]bj +sql +TestResults +*.Cache +ClientBin +stylecop.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML + + + +############ +## Windows +############ + +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +# Mac crap +.DS_Store + +node_modules \ No newline at end of file diff --git a/node_modules/express-force-ssl/LICENSE b/node_modules/express-force-ssl/LICENSE new file mode 100644 index 0000000..0a4a7a9 --- /dev/null +++ b/node_modules/express-force-ssl/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (c) 2013 Jeremy Battle + +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. \ No newline at end of file diff --git a/node_modules/express-force-ssl/README.md b/node_modules/express-force-ssl/README.md new file mode 100644 index 0000000..891add7 --- /dev/null +++ b/node_modules/express-force-ssl/README.md @@ -0,0 +1,208 @@ +express-force-ssl +================= +Extremely simple middleware for requiring some or all pages +to be visited over SSL. + + +Installation +------------ +```` +$ npm install express-force-ssl +```` + +Configuration +============= +As of v0.3.0 there are some configuration options +------------------------------------------------- + +**NEW Settings Option** +```javascript +app.set('forceSSLOptions', { + enable301Redirects: true, + trustXFPHeader: false, + httpsPort: 443, + sslRequiredMessage: 'SSL Required.' +}); +``` + + +**enable301Redirects** - Defaults to ***true*** - the normal behavior is to 301 redirect GET requests to the https version of a +website. Changing this value to ***false*** will cause even GET requests to 403 SSL Required errors. + +**trustXFPHeader** - Defaults to ***false*** - this behavior is NEW and will be default NOT TRUST X-Forwarded-Proto which +could allow a client to spoof whether or not they were on HTTPS or not. This can be changed to ***true*** if you are +behind a proxy where you trust the X-Forwarded-Proto header. + +**httpsPort** - Previous this value was set with app.set('httpsPort', :portNumber) which is now deprecated. This value +should now be set in the forceSSLOptions setting. + +**sslRequiredMessage** - Defaults to ***SSL Required.*** This can be useful if you want to localize your error messages. + +Per-Route SSL Settings are now possible +--------------------------------------- +Settings in your forceSSLOptions configuration will act as default settings for your app. However, these values can +be overridden by setting *res.locals* values before the the express-force-ssl middleware is run. For example: + +```javascript +app.set('forceSSLOptions', { + enable301Redirects: false +}); + +app.get('/', forceSSL, function (req, res) { + //this route will 403 if accessed via HTTP + return res.send('HTTPS only.'); +}); + +function allow301 (req, res, next) { + res.locals.forceSSLOptions = { + enable301Redirects: true + }; + next(); +} + +app.get('/allow', allow301, forceSSL, function (req, res) { + //this route will NOT 403 if accessed via HTTP + return res.send('HTTP or HTTPS'); +}); + +``` + + + +Examples +======== +Force SSL on all pages +---------------------- +```javascript +var express = require('express'); +var forceSSL = require('express-force-ssl'); +var fs = require('fs'); +var http = require('http'); +var https = require('https'); + +var ssl_options = { + key: fs.readFileSync('./keys/private.key'), + cert: fs.readFileSync('./keys/cert.crt'), + ca: fs.readFileSync('./keys/intermediate.crt') +}; + +var app = express(); +var server = http.createServer(app); +var secureServer = https.createServer(ssl_options, app); + +app.use(express.bodyParser()); +app.use(forceSSL); +app.use(app.router); + +secureServer.listen(443) +server.listen(80) + +``` + +Only certain pages SSL +---------------------- +```javascript +var express = require('express'); +var forceSSL = require('express-force-ssl'); +var fs = require('fs'); +var http = require('http'); +var https = require('https'); + +var ssl_options = { + key: fs.readFileSync('./keys/private.key') + cert: fs.readFileSync('./keys/cert.crt') + ca: fs.readFileSync('./keys/intermediate.crt') +}; + +var app = express(); + +var server = http.createServer(app); +var secureServer = https.createServer(ssl_options, app); + +app.use(express.bodyParser()); +app.use(app.router); + +app.get('/', somePublicFunction); +app.get('/user/:name', somePublicFunction); +app.get('/login', forceSSL, someSecureFunction); +app.get('/logout', forceSSL, someSecureFunction); + +secureServer.listen(443) +server.listen(80) +``` + +Custom Server Port Support +-------------------------- +If your server isn't listening on 80/443 respectively, you can change this pretty simply. + +```javascript + +var app = express(); +app.set('forceSSLOptions', { + httpsPort: 8443 +}); + +var server = http.createServer(app); +var secureServer = https.createServer(ssl_options, app); + +... + +secureServer.listen(443) +server.listen(80) + +``` + +Test +---- +``` +npm test +``` + +Change Log +========== +**v0.3.2** - Updated README to remove typo. Thanks @gswalden + +**v0.3.1** - Updated README to remove deprecated usage and fix some typos. Thanks @Alfredo-Delgado and @glennr + +**v0.3.0** - Added additional configuration options, ability to add per route configuration options + +**v0.2.13** - Bug Fix, thanks @tatepostnikoff + +**v0.2.12** - Bug Fix + +**v0.2.11** - Updated README to fix usage example typo and formatting fixes + +**v0.2.10** - Updated README for npmjs.com markdown changes + +**v0.2.9** - More modular tests. + +**v0.2.8** - Now sends 403 SSL Required error when HTTP method is anything but GET. +This will prevent a POST/PUT etc with data that will end up being lost in a redirect. + +**v0.2.7** - Additional Test cases. Added example server. + +**v0.2.6** - Added Tests + +**v0.2.5** - Bug Fix + +**v0.2.4** - Now also checking X-Forwarded-Proto header to determine SSL connection +Courtesy of @ronco + +**v0.2.3** - Update README + +**v0.2.2** - Redirect now gives a 301 permanent redirection HTTP Status Code +Courtesy of @tixz + +**v0.2.0** - Added support for ports other than 80/443 for non-secure/secure ports. +For example, if you host your non-ssl site on port 8080 and your secure site on 8443, version 0.1.x did not support it. +Now, out of the box your non-ssl site port will be recognized, and to specify a port other than 443 for your ssl port +you just have to add a setting in your express config like so: +**Update, this method of setting httpsPort is deprecated as of v 0.3.0** + +````javascript +app.set('httpsPort', 8443); +```` +and the plugin will check for it and use it. Defaults to 443 of course. + +**v0.1.1** - Bug fix +Courtesy of @timshadel diff --git a/node_modules/express-force-ssl/examples/example.js b/node_modules/express-force-ssl/examples/example.js new file mode 100644 index 0000000..14ef326 --- /dev/null +++ b/node_modules/express-force-ssl/examples/example.js @@ -0,0 +1,34 @@ +var express = require('express') + , forceSSL = require('./../index') + , fs = require('fs') + , http = require('http') + , https = require('https') + ; + +var ssl_options = { + key: fs.readFileSync('./test/keys/localhost.key'), + cert: fs.readFileSync('./test/keys/localhost.crt'), + ca: fs.readFileSync('./test/keys/localhost.crt') +}; + +var app = express(); +var server = http.createServer(app); +var secureServer = https.createServer(ssl_options, app); + +app.get('/', function(req, res){ + res.json({msg: 'accessible by http'}); +}); +app.get('/ssl', forceSSL, function(req, res){ + res.json({msg: 'only https'}); +}); + +app.get('/ssl/deep/route/:id', forceSSL, function(req, res){ + var host = req.headers.host.split(':'); + var port = host.length > 1 ? host[1] : 'default port'; + res.json({msg: 'only https, port: ' + port, id: req.param('id')}); +}); + +app.set('httpsPort', 8443); + +secureServer.listen(8443); +server.listen(8080); \ No newline at end of file diff --git a/node_modules/express-force-ssl/index.js b/node_modules/express-force-ssl/index.js new file mode 100644 index 0000000..9414b69 --- /dev/null +++ b/node_modules/express-force-ssl/index.js @@ -0,0 +1,80 @@ +var parseUrl = require('url').parse; +var assign = require('lodash.assign'); + +function isSecure (secure, xfpHeader, trustXFPHeader) { + xfpHeader = xfpHeader ? xfpHeader.toString().toLowerCase() : ''; + if (secure) { + return true; + } + + return trustXFPHeader && xfpHeader === 'https' +} + +function shouldRedirect (redirectsEnabled, method) { + if (!redirectsEnabled) { + return false + } + + return method === "GET"; +} + +function checkForDeprecation (appSettings, optionsHttpsPort) { + var httpsPort = appSettings.get('httpsPort'); + + if (appSettings.get('env') === 'development') { + if (httpsPort) { + console.warn('express-force-ssl deprecated: app.set("httpsPort", ' + httpsPort + '), use ' + + 'app.set("forceSSLOptions", { httpsPort: ' + httpsPort + ' }) instead.'); + } + + if (httpsPort && optionsHttpsPort) { + console.warn('You have set both app.get("httpsPort") and app.get("forceSSLOptions").httpsPort ' + + 'Your app will use the value in forceSSLOptions.'); + } + } +} + +module.exports = function(req, res, next){ + var redirect; + var secure; + var xfpHeader = req.get('X-Forwarded-Proto'); + var localHttpsPort; + var appHttpsPort = req.app.get('httpsPort'); + var httpsPort; + var fullUrl; + var redirectUrl; + + var options = { + trustXFPHeader: false, + enable301Redirects: true, + httpsPort: false, + sslRequiredMessage: 'SSL Required.' + }; + + var expressOptions = req.app.get('forceSSLOptions') || {}; + var localOptions = res.locals.forceSSLOptions || {}; + localHttpsPort = localOptions.httpsPort; + assign(options, expressOptions, localOptions); + + secure = isSecure(req.secure, xfpHeader, options.trustXFPHeader); + redirect = shouldRedirect(options.enable301Redirects, req.method); + + if (!secure) { + if (redirect) { + checkForDeprecation(req.app, options.httpsPort); + + httpsPort = localHttpsPort || options.httpsPort || appHttpsPort || 443; + fullUrl = parseUrl(req.protocol + '://' + req.header('Host') + req.originalUrl); + + //intentionally allow coercion of https port + redirectUrl = 'https://' + fullUrl.hostname + (httpsPort == 443 ? '' : (':' + httpsPort)) + req.originalUrl; + + res.redirect(301, redirectUrl); + } else { + res.status(403).send(options.sslRequiredMessage); + } + } else { + delete res.locals.forceSSLOptions; + next(); + } +}; diff --git a/node_modules/express-force-ssl/package.json b/node_modules/express-force-ssl/package.json new file mode 100644 index 0000000..1d5eef6 --- /dev/null +++ b/node_modules/express-force-ssl/package.json @@ -0,0 +1,79 @@ +{ + "_from": "express-force-ssl@^0.3.2", + "_id": "express-force-ssl@0.3.2", + "_inBundle": false, + "_integrity": "sha1-AbK0mK5v0uQRUrIrV6Phc3c69n4=", + "_location": "/express-force-ssl", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "express-force-ssl@^0.3.2", + "name": "express-force-ssl", + "escapedName": "express-force-ssl", + "rawSpec": "^0.3.2", + "saveSpec": null, + "fetchSpec": "^0.3.2" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/express-force-ssl/-/express-force-ssl-0.3.2.tgz", + "_shasum": "01b2b498ae6fd2e41152b22b57a3e173773af67e", + "_spec": "express-force-ssl@^0.3.2", + "_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI", + "author": { + "name": "Jeremy Battle", + "email": "@complexcarb", + "url": "http://jeremybattle.com" + }, + "bugs": { + "url": "http://github.com/battlejj/express-force-ssl/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jeremy Battle", + "email": "battlejj@gmail.com" + } + ], + "dependencies": { + "lodash.assign": "^3.2.0" + }, + "deprecated": false, + "description": "Force SSL on particular/all pages in Express", + "devDependencies": { + "body-parser": "^1.9.0", + "chai": "^1.9.1", + "express": "^4.9.4", + "mocha": "^1.21.4", + "request": "^2.44.0" + }, + "engines": { + "node": ">=0.2.2" + }, + "homepage": "http://github.com/battlejj/express-force-ssl", + "keywords": [ + "ssl", + "tls", + "https", + "express" + ], + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/battlejj/express-force-ssl/raw/master/LICENSE" + } + ], + "main": "index", + "name": "express-force-ssl", + "repository": { + "type": "git", + "url": "git://github.com/battlejj/express-force-ssl.git" + }, + "scripts": { + "test": "mocha test" + }, + "version": "0.3.2" +} diff --git a/node_modules/express-force-ssl/test/http.js b/node_modules/express-force-ssl/test/http.js new file mode 100644 index 0000000..bca2b82 --- /dev/null +++ b/node_modules/express-force-ssl/test/http.js @@ -0,0 +1,140 @@ +var chai = require('chai') + , expect = chai.expect + , request = require('request') + , server + , baseurl + , secureBaseurl + , SSLRequiredErrorText + ; + + +before(function () { + server = require('./server')({ httpPort: 8080, httpsPort: 8443 }); + baseurl = 'http://localhost:' + server.port; + secureBaseurl = 'https://localhost:' + server.securePort; + SSLRequiredErrorText = 'SSL Required.'; +}); + +describe('Test standard HTTP behavior.', function(){ + + it('Should not be redirected to SSL on non "SSL Only" endpoint.', function(done){ + request.get({ + url: baseurl, + followRedirect: false, + strictSSL: false + }, function (error, response){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + done(); + }); + }); + + it('Should receive a 301 redirect on "SSL Only" endpoint.', function(done){ + var originalDestination = baseurl + '/ssl'; + var expectedDestination = secureBaseurl + '/ssl'; + request.get({ + url: originalDestination, + followRedirect: false, + strictSSL: false + }, function (error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(301); + expect(response.headers.location).to.equal(expectedDestination); + done(); + }); + }); + + it('Should end up at secure endpoint on "SSL Only" endpoint.', function(done){ + var originalDestination = baseurl + '/ssl'; + var expectedDestination = secureBaseurl + '/ssl'; + request.get({ + url: originalDestination, + followRedirect: true, + strictSSL: false + }, function (error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + expect(response.request.uri.href).to.equal(expectedDestination); + done(); + }); + }); + + /* + I think these next two tests are completely redundant, but someone once opened an issue about this + because they incorrectly configured their express server, so I had to write tests against his use case + to prove this isn't actually a problem. + */ + + it('Should receive a 301 redirect on a deeply nested "SSL Only" endpoint.', function(done){ + var id = 12983498; + var originalDestination = baseurl + '/ssl/nested/route/' + id; + var expectedDestination = secureBaseurl + '/ssl/nested/route/' + id; + request.get({ + url: originalDestination, + followRedirect: false, + strictSSL: false + }, function (error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(301); + expect(response.headers.location).to.equal(expectedDestination); + done(); + }); + }); + + it('Should end up at secure endpoint on a deeply nested "SSL Only" endpoint.', function(done){ + var id = 233223625745; + var originalDestination = baseurl + '/ssl/nested/route/' + id; + var expectedDestination = secureBaseurl + '/ssl/nested/route/' + id; + request.get({ + url: originalDestination, + followRedirect: true, + strictSSL: false + }, function (error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + expect(response.request.uri.href).to.equal(expectedDestination); + done(); + }); + }); + + it('Should successfully POST data to non "SSL Only" endpoint.', function(done){ + var destination = baseurl + '/echo'; + var postData = { key1: 'Keyboard.', key2: 'Cat.'}; + request.post({ + url: destination, + followRedirect: true, + strictSSL: false, + form: postData + }, function(error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + expect(response.request.uri.href).to.equal(destination); + expect(body).to.equal(JSON.stringify(postData)); + done(); + }); + }); + + it('Should receive 403 error when POSTing data to "SSL Only" endpoint.', function(done){ + var destination = baseurl + '/sslEcho'; + var postData = { key1: 'Keyboard.', key2: 'Cat.'}; + request.post({ + url: destination, + followRedirect: true, + strictSSL: false, + form: postData + }, function(error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(403); + expect(response.request.uri.href).to.equal(destination); + expect(body).to.equal(SSLRequiredErrorText); + done(); + }); + }); +}); \ No newline at end of file diff --git a/node_modules/express-force-ssl/test/https-disable-301s.js b/node_modules/express-force-ssl/test/https-disable-301s.js new file mode 100644 index 0000000..00763e3 --- /dev/null +++ b/node_modules/express-force-ssl/test/https-disable-301s.js @@ -0,0 +1,102 @@ +var chai = require('chai') + , expect = chai.expect + , request = require('request') + , server + , baseurl + , secureBaseurl + , SSLRequiredErrorText + ; + +before(function () { + server = require('./server')({ enable301Redirects: false, httpPort: 8090, httpsPort: 10443 }); + baseurl = 'http://localhost:' + server.port; + secureBaseurl = 'https://localhost:' + server.securePort; + SSLRequiredErrorText = 'SSL Required.'; +}); + +describe('Test HTTPS behavior when 301 redirects are disabled.', function() { + + it('Should be able to get to SSL pages with no issue', function (done) { + var sslEndpoint = secureBaseurl + '/ssl'; + + request.get({ + url: sslEndpoint, + followRedirect: false, + strictSSL: false + }, function (error, response, body) { + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + expect(body).to.equal('HTTPS only.'); + done(); + }); + }); + + it('Non ssl pages should continue to work normally', function (done) { + request.get({ + url: baseurl, + followRedirect: false, + strictSSL: false + }, function (error, response){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + done(); + }); + }); + + it('Should receive a 403 error on "SSL Only" endpoint when accessed insecurely.', function (done) { + var originalEndpoint = baseurl + '/ssl'; + + request.get({ + url: originalEndpoint, + followRedirect: false, + strictSSL: false + }, function (error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(403); + expect(body).to.equal(SSLRequiredErrorText); + done(); + }); + }); + + it('Should successfully POST data to non "SSL Only" endpoint.', function (done) { + var destination = baseurl + '/echo'; + var postData = { key1: 'Keyboard.', key2: 'Cat.'}; + + request.post({ + url: destination, + followRedirect: true, + strictSSL: false, + form: postData + }, function(error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + expect(response.request.uri.href).to.equal(destination); + expect(body).to.equal(JSON.stringify(postData)); + done(); + }); + }); + + it('Should receive 403 error when POSTing data to "SSL Only" endpoint.', function (done) { + var destination = baseurl + '/sslEcho'; + var postData = { key1: 'Keyboard.', key2: 'Cat.'}; + + request.post({ + url: destination, + followRedirect: true, + strictSSL: false, + form: postData + }, function(error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(403); + expect(response.request.uri.href).to.equal(destination); + expect(body).to.equal(SSLRequiredErrorText); + done(); + }); + }); + +}); \ No newline at end of file diff --git a/node_modules/express-force-ssl/test/https.js b/node_modules/express-force-ssl/test/https.js new file mode 100644 index 0000000..66ee4d0 --- /dev/null +++ b/node_modules/express-force-ssl/test/https.js @@ -0,0 +1,63 @@ +var chai = require('chai') + , expect = chai.expect + , request = require('request') + , server + , secureBaseurl + , SSLRequiredErrorText + ; + +before(function () { + server = require('./server')({ httpPort: 8086, httpsPort: 6443 }); + secureBaseurl = 'https://localhost:' + server.securePort; + SSLRequiredErrorText = 'SSL Required.'; +}); + +describe('Test standard HTTPS behavior.', function() { + + it('Should have no redirection from SSL on non "SSL Only" endpoint.', function (done) { + request.get({ + url: secureBaseurl, + followRedirect: false, + strictSSL: false + }, function (error, response, body) { + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + expect(body).to.equal('HTTP and HTTPS.'); + done(); + }); + }); + + it('Should have no redirection from SSL on "SSL Only" endpoint.', function (done) { + request.get({ + url: secureBaseurl + '/ssl', + followRedirect: false, + strictSSL: false + }, function (error, response, body) { + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + expect(body).to.equal('HTTPS only.'); + done(); + }); + }); + + it('Should successfully POST to an "SSL Only" endpoint.', function(done){ + var destination = secureBaseurl + '/sslEcho'; + var postData = { key1: 'Keyboard.', key2: 'Cat.'}; + request.post({ + url: destination, + followRedirect: false, + strictSSL: false, + form: postData + }, function(error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + expect(response.request.uri.href).to.equal(destination); + expect(body).to.equal(JSON.stringify(postData)); + done(); + }); + }); + +}); \ No newline at end of file diff --git a/node_modules/express-force-ssl/test/keys/localhost.crt b/node_modules/express-force-ssl/test/keys/localhost.crt new file mode 100644 index 0000000..c49c1b2 --- /dev/null +++ b/node_modules/express-force-ssl/test/keys/localhost.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDeDCCAmACCQC+YKNm0V1QRTANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJV +UzETMBEGA1UECBMKQ2FsaWZvcm5pYTESMBAGA1UEBxMJSG9sbHl3b29kMSUwIwYD +VQQKExxleHByZXNzLWJhdHRsZW5ldC1vYXV0aC10ZXN0MQswCQYDVQQLEwJJVDES +MBAGA1UEAxMJbG9jYWxob3N0MB4XDTE0MDgyODE3NDMyMFoXDTE3MDYxNzE3NDMy +MFowfjELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExEjAQBgNVBAcT +CUhvbGx5d29vZDElMCMGA1UEChMcZXhwcmVzcy1iYXR0bGVuZXQtb2F1dGgtdGVz +dDELMAkGA1UECxMCSVQxEjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBALWbWCg0evxLwD5Z1lmV9GJQkcBJkCY3yZNU2fvx +LcK+1PVo0a0aHjXPaBlaU5y3xgazPtU7T6H+DKgW5tKVPPcZsiIje8vwH/mE5U3I +IzmaxPJZPvpErCHSx9Ite4J7mrt2WcIAy95wjiu1//KkpHxpI11noTh87+6QqxV5 +YZH2L0plHp5IzNJHdb8crvOEsV01g3ymjthQY9OXQHZm9+vHG3EjVzHB41Bh3Mk9 +nq5cCUef10yHbTW8jusyf58CBO4y+ofYs7dlQjPpzmddpFYoIkjWspZWy+w/6+nP +VTkyNZr8jnAhNbjSdbZezpuq8qoCHoCK6XHPecrtJH9ToyECAwEAATANBgkqhkiG +9w0BAQUFAAOCAQEAE9+sbbiwLCPRwG24B4KB3eJ+IblNNsBJfvCuYneuyi1pWwCU +6BBotEWENFlIoUXO/yTR/uDvMfcvs5YmarIu3Suj5+qf0rL0b42317uGFvYBsVIA +0uG8/rFP8HyUCfKLZL2NvLkG1EaywlCW2MnfD6U6haTCUaAkaIpy6hHOU1P+dMDI +OuNyG6wdeujlx2WWyag7uqr5YeKpVEpmEZUa2Dr2O0aEIU3OByuxYY8/1fwbWkbC +GuOP88J/t6Ahs1DcqYsX+aE8OvMnEL6hhd1UqOUC2jh6DkxIxsQqakSRYb8PcSdL +3+5RREr8os2Futi06PR5+r67Hva/k+oaysAN+g== +-----END CERTIFICATE----- diff --git a/node_modules/express-force-ssl/test/keys/localhost.csr b/node_modules/express-force-ssl/test/keys/localhost.csr new file mode 100644 index 0000000..4610cee --- /dev/null +++ b/node_modules/express-force-ssl/test/keys/localhost.csr @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICwzCCAasCAQAwfjELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWEx +EjAQBgNVBAcTCUhvbGx5d29vZDElMCMGA1UEChMcZXhwcmVzcy1iYXR0bGVuZXQt +b2F1dGgtdGVzdDELMAkGA1UECxMCSVQxEjAQBgNVBAMTCWxvY2FsaG9zdDCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALWbWCg0evxLwD5Z1lmV9GJQkcBJ +kCY3yZNU2fvxLcK+1PVo0a0aHjXPaBlaU5y3xgazPtU7T6H+DKgW5tKVPPcZsiIj +e8vwH/mE5U3IIzmaxPJZPvpErCHSx9Ite4J7mrt2WcIAy95wjiu1//KkpHxpI11n +oTh87+6QqxV5YZH2L0plHp5IzNJHdb8crvOEsV01g3ymjthQY9OXQHZm9+vHG3Ej +VzHB41Bh3Mk9nq5cCUef10yHbTW8jusyf58CBO4y+ofYs7dlQjPpzmddpFYoIkjW +spZWy+w/6+nPVTkyNZr8jnAhNbjSdbZezpuq8qoCHoCK6XHPecrtJH9ToyECAwEA +AaAAMA0GCSqGSIb3DQEBBQUAA4IBAQBmUj7lzaQpYuRHGRlwmRs52rLZzsNmqcBQ +7/E7QrMKeRYHOuhOJPTvbNbYdDuR9zHenTxJvp2C3Ufw7cl0XoH0swUSu1nix+E3 +Wx8TnsDzSkE3dwEgdT4mXD77Ei9FvVOPGZdJkiPvUAeICprI+RhAwMEBpMKGEr57 +6stYK+tyQ/FN7WKsRN+tUq7Kjs4+645x45lIwiGqkfDhjjA1GcYkRd9J+Eo+JtNo +NRcLFd+KRatCN0RL5HqBPHBSYd9/WtPJbKujNHU+a3KEoxKPATg8E9Lgs69s6TZP +io5ZcfppFGy/67JtN5LTwH8h0/kQsNV4pJV2NtzhrKx4NfnGUavK +-----END CERTIFICATE REQUEST----- diff --git a/node_modules/express-force-ssl/test/keys/localhost.key b/node_modules/express-force-ssl/test/keys/localhost.key new file mode 100644 index 0000000..225f161 --- /dev/null +++ b/node_modules/express-force-ssl/test/keys/localhost.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAtZtYKDR6/EvAPlnWWZX0YlCRwEmQJjfJk1TZ+/Etwr7U9WjR +rRoeNc9oGVpTnLfGBrM+1TtPof4MqBbm0pU89xmyIiN7y/Af+YTlTcgjOZrE8lk+ ++kSsIdLH0i17gnuau3ZZwgDL3nCOK7X/8qSkfGkjXWehOHzv7pCrFXlhkfYvSmUe +nkjM0kd1vxyu84SxXTWDfKaO2FBj05dAdmb368cbcSNXMcHjUGHcyT2erlwJR5/X +TIdtNbyO6zJ/nwIE7jL6h9izt2VCM+nOZ12kVigiSNayllbL7D/r6c9VOTI1mvyO +cCE1uNJ1tl7Om6ryqgIegIrpcc95yu0kf1OjIQIDAQABAoIBAAxqx7dQB0yy3T0m +JVrQvvnt6llMble+nsC9H35zeh6Dr8nr1dJRI9moCcUaAPeJNTgGD3jC6mn4FeN0 +VWn2nEmE70IYTQGftH/6DzenRIlOxMKRSZYRFffmEpWTWIuOagEBUZfLOCVIauAg +PJTZnwmGos1jJYnYOQuFxrzcJMi2//5o4lzy9fCyGnVX1S1K2aVAsTKziZxj1mEI +6+QQJo+57tMGHrOZl6pJHWsfjd/DGeLtAA9PRstkzWUG3e+cVTlGH+Vr9f6foq44 +TRWDKUcCzy8fKXhmguBiJkRmY6CjiWKbx0EZ5BV5js1jXvAwzcqrCBHxlZedZggI +EohelYUCgYEA2DUVjNBYoxBk/3C2ZLXi954ZzN0hEa/Pv8DLHn57448aoOVb/+H0 +qzgfhibc/y6+pWearW7EERIfp3ZprcnRYkNGC9hc4aGP1ae4AOZfm0TkdpAYiTNc +3vV+PtI3iv6/qZPNktqk55jo6WMmw3MUfy66TwUYPUzZpXm6hdBUtOcCgYEA1wgB +qDV/G+T1w2gIy6IfPnQw/0UoHtcuRcJIrjlF0tc/KEf36tZwxHhr8i+ayBmU9HhH +Q46eZAq6KrVE9ysnyirDRllW8qxV5Go0A3ICnirL6jnWSzuOu9aIn4VcB8F+Xx2R +th7gCzRUBdgJWYJL9FcR86WhM+5my7kciRAq3rcCgYA1Zq8i75bk97iqavFx4Ibl +uBQRSJDRaIY8i2bf6ke5RfBCy0O06N9gpuUKYnD1SltmSTeoHJKq0Lomx5WEijOA +PLOBW3hddmUrVViaSExW8mYnbqHQyXHn0+TRqWR0nUVDojEFU6GlXlwwwP+jCLqI +S0dTGyQIiAG94FoUkQdLAwKBgQC6N4nP1PxN+NtIrSioyK6MFG12M7rJ8ol1CgqN +LrYkIBnm1WSCr9CapLq+0rEVRuozSJJWlAThGFUetTqTXoEn2B6iJq5gnBQKKlr+ +/NX9iYxsPEgzgNFcJC7PDtujL9MzpdTRRi26Jkf5g5ydMnR6lojKWo6e/X9yP83R +ePnXQwKBgQCiHjWzMNRbeqjjWtaeb3Wv3QkKGZkwOgrOlqODZcZ4kNalDeh2Q4Ho +cWUsbG4ko8J6yWnnhzRxG2G5Q/W6rpzZWCNsazKaz5LI0svYjWFOyIUvNjO5giFx +udNcjnqrwql/F8xZK7YoiMuM6ltU03NY1lpUh/X4Gd3ThXnhr8DLRw== +-----END RSA PRIVATE KEY----- diff --git a/node_modules/express-force-ssl/test/server/index.js b/node_modules/express-force-ssl/test/server/index.js new file mode 100644 index 0000000..ec3ff6c --- /dev/null +++ b/node_modules/express-force-ssl/test/server/index.js @@ -0,0 +1,82 @@ +var bodyParser = require('body-parser') + , express = require('express') + , forceSSL = require('../../index') + , fs = require('fs') + , http = require('http') + , https = require('https') + ; + +module.exports = function (options) { + var ssl_options = { + key: fs.readFileSync('./test/keys/localhost.key'), + cert: fs.readFileSync('./test/keys/localhost.crt') + }; + + options = options || {}; + + var httpPort = options.httpPort || 8080; + var httpsPort = options.httpsPort || 8443; + + delete options.httpPort; + + var app = express(); + + /* + Allow for testing with POSTing of data + */ + app.use(bodyParser.urlencoded({ extended: false })); + app.use(bodyParser.json()); + + var server = http.createServer(app); + var secureServer = https.createServer(ssl_options, app); + + /* + Routes + */ + app.get('/', function (req, res) { + res.send('HTTP and HTTPS.'); + }); + + app.get('/ssl', forceSSL, function (req, res) { + res.send('HTTPS only.'); + }); + + app.get('/ssl/nested/route/:id', forceSSL, function (req, res) { + var host = req.headers.host.split(':'); + var port = host.length > 1 ? host[1] : 'default port'; + res.send('HTTPS Only. Port: ' + port + '. Got param of ' + req.params.id + '.'); + }); + + app.post('/echo', function (req, res) { + res.json(req.body); + }); + + app.post('/sslEcho', forceSSL, function (req, res) { + res.json(req.body); + }); + + app.get('/override', function (req, res, next) { + res.locals.forceSSLOptions = { + enable301Redirects: false + }; + next(); + }, forceSSL, function (req, res) { + res.json(req.body); + }); + + //Old Usage + //app.set('httpsPort', httpsPort); + app.set('forceSSLOptions', options); + secureServer.listen(httpsPort); + server.listen(httpPort); + + return { + secureServer: secureServer, + server: server, + app: app, + securePort: httpsPort, + port: httpPort, + options: options + }; +}; + diff --git a/node_modules/express-force-ssl/test/variable-overide.js b/node_modules/express-force-ssl/test/variable-overide.js new file mode 100644 index 0000000..aee10b6 --- /dev/null +++ b/node_modules/express-force-ssl/test/variable-overide.js @@ -0,0 +1,91 @@ +var chai = require('chai') + , expect = chai.expect + , request = require('request') + , server + , baseurl + , secureBaseurl + , SSLRequiredErrorText = 'Custom SSL Required Message.' + ; + +before(function () { + server = require('./server')({ + enable301Redirects: false, + httpPort: 8091, + httpsPort: 11443, + sslRequiredMessage: SSLRequiredErrorText + }); + baseurl = 'http://localhost:' + server.port; + secureBaseurl = 'https://localhost:' + server.securePort; +}); + +describe('Test HTTPS behavior when 301 redirects are disabled.', function () { + it('301 Redirect should be disabled by user setting', function (done) { + + var endpoint = baseurl + '/ssl'; + + request.get({ + url: endpoint, + followRedirect: false, + strictSSL: false + }, function (error, response, body) { + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(403); + done() + }); + + }); + + it('301 Redirect should be enabled by res.local setting', function (done) { + + var sslEndpoint = secureBaseurl + '/override'; + + request.get({ + url: sslEndpoint, + followRedirect: false, + strictSSL: false + }, function (error, response, body) { + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + done(); + }); + + }); + + it('301 Redirect should be enabled by res.local setting', function (done) { + + var sslEndpoint = secureBaseurl + '/override'; + + request.get({ + url: sslEndpoint, + followRedirect: false, + strictSSL: false + }, function (error, response, body) { + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + done(); + }); + + }); + + it('Custom error text test', function (done) { + + var endpoint = baseurl + '/ssl'; + + request.get({ + url: endpoint, + followRedirect: false, + strictSSL: false + }, function (error, response, body) { + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(403); + expect(body).to.equal(SSLRequiredErrorText); + done(); + }); + + }); + +}); \ No newline at end of file diff --git a/node_modules/express-force-ssl/test/x-forwarded-proto-trusted.js b/node_modules/express-force-ssl/test/x-forwarded-proto-trusted.js new file mode 100644 index 0000000..b2c9e20 --- /dev/null +++ b/node_modules/express-force-ssl/test/x-forwarded-proto-trusted.js @@ -0,0 +1,133 @@ +var chai = require('chai') + , expect = chai.expect + , request = require('request') + , server + , baseurl + , secureBaseurl + , SSLRequiredErrorText + , validHeader + , invalidHeader + ; + +before(function () { + server = require('./server')({ trustXFPHeader: true, httpPort: 8089, httpsPort: 9443 }); + baseurl = 'http://localhost:' + server.port; + secureBaseurl = 'https://localhost:' + server.securePort; + SSLRequiredErrorText = 'SSL Required.'; + + validHeader = { + 'X-Forwarded-Proto': 'https' + }; + + invalidHeader = { + 'X-Forwarded-Proto': 'WrongProtocol' + }; +}); + +describe('Test HTTPS behavior when X-Forwarded-Proto header exists and is trusted.', function(){ + it('Should not be redirected to SSL on non "SSL Only" endpoint.', function(done){ + request.get({ + url: baseurl, + followRedirect: false, + strictSSL: false, + headers: validHeader + }, function (error, response){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + done(); + }); + }); + + it('Should not be redirected to SSL on "SSL Only" endpoint with valid X-Forwarded-Proto Header.', function(done){ + var destination = baseurl + '/ssl'; + request.get({ + url: destination, + followRedirect: false, + strictSSL: false, + headers: validHeader + }, function (error, response){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + done(); + }); + }); + + it('Should get redirect to SSL on "SSL Only" endpoint with invalid X-Forwarded-Proto Header.', function(done){ + var originalDestination = baseurl + '/ssl'; + var expectedDestination = secureBaseurl + '/ssl'; + + request.get({ + url: originalDestination, + followRedirect: false, + strictSSL: false, + headers: invalidHeader + }, function (error, response){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(301); + expect(response.headers.location).to.equal(expectedDestination); + done(); + }); + }); + + it('Should get redirected to expected destination on "SSL Only" endpoint with invalid X-Forwarded-Proto ' + + 'Header.', function(done){ + var originalDestination = baseurl + '/ssl'; + var expectedDestination = secureBaseurl + '/ssl'; + + request.get({ + url: originalDestination, + followRedirect: true, + strictSSL: false, + headers: invalidHeader + }, function (error, response){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + expect(response.request.uri.href).to.equal(expectedDestination); + done(); + }); + }); + + it('Should successfully POST data to "SSL Only" endpoint with valid X-Forwarded-Proto Header.', function(done){ + var destination = baseurl + '/sslEcho'; + var postData = { key1: 'Keyboard.', key2: 'Cat.'}; + request.post({ + url: destination, + followRedirect: true, + strictSSL: false, + form: postData, + headers: validHeader + }, function(error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + expect(response.request.uri.href).to.equal(destination); + expect(body).to.equal(JSON.stringify(postData)); + done(); + }); + }); + + it('Should receive 403 error when POSTing data to "SSL Only" endpoint with invalid X-Forwarded-Proto ' + + 'Header.', function(done){ + var destination = baseurl + '/sslEcho'; + var postData = { key1: 'Keyboard.', key2: 'Cat.'}; + request.post({ + url: destination, + followRedirect: true, + strictSSL: false, + form: postData, + headers: invalidHeader + }, function(error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(403); + expect(response.request.uri.href).to.equal(destination); + expect(body).to.equal(SSLRequiredErrorText); + done(); + }); + }); + +}); \ No newline at end of file diff --git a/node_modules/express-force-ssl/test/x-forwarded-proto.js b/node_modules/express-force-ssl/test/x-forwarded-proto.js new file mode 100644 index 0000000..69559e1 --- /dev/null +++ b/node_modules/express-force-ssl/test/x-forwarded-proto.js @@ -0,0 +1,136 @@ +var chai = require('chai') + , expect = chai.expect + , request = require('request') + , server + , baseurl + , secureBaseurl + , SSLRequiredErrorText + , validHeader + , invalidHeader + ; + +before(function () { + server = require('./server')({ httpPort: 8087, httpsPort: 7443 }); + baseurl = 'http://localhost:' + server.port; + secureBaseurl = 'https://localhost:' + server.securePort; + SSLRequiredErrorText = 'SSL Required.'; + + validHeader = { + 'X-Forwarded-Proto': 'https' + }; + + invalidHeader = { + 'X-Forwarded-Proto': 'WrongProtocol' + }; +}); + +describe('Test HTTPS behavior when X-Forwarded-Proto header exists but is not trusted.', function(){ + it('Should not be redirected to SSL on non "SSL Only" endpoint.', function(done){ + request.get({ + url: baseurl, + followRedirect: false, + strictSSL: false, + headers: validHeader + }, function (error, response){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + done(); + }); + }); + + it('Should be redirected to SSL on "SSL Only" endpoint with valid but untrusted X-Forwarded-Proto Header.', + function(done){ + var destination = baseurl + '/ssl'; + request.get({ + url: destination, + followRedirect: false, + strictSSL: false, + headers: validHeader + }, function (error, response){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(301); + done(); + }); + }); + + it('Should be redirect to SSL on "SSL Only" endpoint with invalid untrusted X-Forwarded-Proto Header.', + function(done){ + var originalDestination = baseurl + '/ssl'; + var expectedDestination = secureBaseurl + '/ssl'; + + request.get({ + url: originalDestination, + followRedirect: false, + strictSSL: false, + headers: invalidHeader + }, function (error, response){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(301); + expect(response.headers.location).to.equal(expectedDestination); + done(); + }); + }); + + it('Should be redirected to expected destination on "SSL Only" endpoint with invalid untrusted X-Forwarded-Proto ' + + 'Header.', function(done){ + var originalDestination = baseurl + '/ssl'; + var expectedDestination = secureBaseurl + '/ssl'; + + request.get({ + url: originalDestination, + followRedirect: true, + strictSSL: false, + headers: invalidHeader + }, function (error, response){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(200); + expect(response.request.uri.href).to.equal(expectedDestination); + done(); + }); + }); + + it('Should receive 403 error when POSTing data to "SSL Only" endpoint with untrusted X-Forwarded-Proto Header.', + function(done){ + var destination = baseurl + '/sslEcho'; + var postData = { key1: 'Keyboard.', key2: 'Cat.'}; + request.post({ + url: destination, + followRedirect: true, + strictSSL: false, + form: postData, + headers: validHeader + }, function(error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(403); + expect(response.request.uri.href).to.equal(destination); + expect(body).to.equal(SSLRequiredErrorText); + done(); + }); + }); + + it('Should receive 403 error when POSTing data to "SSL Only" endpoint with untrusted invalid X-Forwarded-Proto ' + + 'Header.', function(done){ + var destination = baseurl + '/sslEcho'; + var postData = { key1: 'Keyboard.', key2: 'Cat.'}; + request.post({ + url: destination, + followRedirect: true, + strictSSL: false, + form: postData, + headers: invalidHeader + }, function(error, response, body){ + //noinspection BadExpressionStatementJS + expect(error).to.not.exist; + expect(response.statusCode).to.equal(403); + expect(response.request.uri.href).to.equal(destination); + expect(body).to.equal(SSLRequiredErrorText); + done(); + }); + }); + +}); \ No newline at end of file diff --git a/node_modules/lodash._baseassign/LICENSE.txt b/node_modules/lodash._baseassign/LICENSE.txt new file mode 100644 index 0000000..9cd87e5 --- /dev/null +++ b/node_modules/lodash._baseassign/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. diff --git a/node_modules/lodash._baseassign/README.md b/node_modules/lodash._baseassign/README.md new file mode 100644 index 0000000..0aa2309 --- /dev/null +++ b/node_modules/lodash._baseassign/README.md @@ -0,0 +1,20 @@ +# lodash._baseassign v3.2.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseAssign` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseassign +``` + +In Node.js/io.js: + +```js +var baseAssign = require('lodash._baseassign'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.2.0-npm-packages/lodash._baseassign) for more details. diff --git a/node_modules/lodash._baseassign/index.js b/node_modules/lodash._baseassign/index.js new file mode 100644 index 0000000..f5612c8 --- /dev/null +++ b/node_modules/lodash._baseassign/index.js @@ -0,0 +1,27 @@ +/** + * lodash 3.2.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseCopy = require('lodash._basecopy'), + keys = require('lodash.keys'); + +/** + * The base implementation of `_.assign` without support for argument juggling, + * multiple sources, and `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return source == null + ? object + : baseCopy(source, keys(source), object); +} + +module.exports = baseAssign; diff --git a/node_modules/lodash._baseassign/package.json b/node_modules/lodash._baseassign/package.json new file mode 100644 index 0000000..82b5ce3 --- /dev/null +++ b/node_modules/lodash._baseassign/package.json @@ -0,0 +1,79 @@ +{ + "_from": "lodash._baseassign@^3.0.0", + "_id": "lodash._baseassign@3.2.0", + "_inBundle": false, + "_integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "_location": "/lodash._baseassign", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash._baseassign@^3.0.0", + "name": "lodash._baseassign", + "escapedName": "lodash._baseassign", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/lodash.assign" + ], + "_resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "_shasum": "8c38a099500f215ad09e59f1722fd0c52bfe0a4e", + "_spec": "lodash._baseassign@^3.0.0", + "_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\lodash.assign", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._basecopy": "^3.0.0", + "lodash.keys": "^3.0.0" + }, + "deprecated": false, + "description": "The modern build of lodash’s internal `baseAssign` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "name": "lodash._baseassign", + "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.\"" + }, + "version": "3.2.0" +} diff --git a/node_modules/lodash._basecopy/LICENSE.txt b/node_modules/lodash._basecopy/LICENSE.txt new file mode 100644 index 0000000..9cd87e5 --- /dev/null +++ b/node_modules/lodash._basecopy/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. diff --git a/node_modules/lodash._basecopy/README.md b/node_modules/lodash._basecopy/README.md new file mode 100644 index 0000000..acdfa29 --- /dev/null +++ b/node_modules/lodash._basecopy/README.md @@ -0,0 +1,20 @@ +# lodash._basecopy v3.0.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseCopy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._basecopy +``` + +In Node.js/io.js: + +```js +var baseCopy = require('lodash._basecopy'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basecopy) for more details. diff --git a/node_modules/lodash._basecopy/index.js b/node_modules/lodash._basecopy/index.js new file mode 100644 index 0000000..b586d31 --- /dev/null +++ b/node_modules/lodash._basecopy/index.js @@ -0,0 +1,32 @@ +/** + * lodash 3.0.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property names to copy. + * @param {Object} [object={}] The object to copy properties to. + * @returns {Object} Returns `object`. + */ +function baseCopy(source, props, object) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + object[key] = source[key]; + } + return object; +} + +module.exports = baseCopy; diff --git a/node_modules/lodash._basecopy/package.json b/node_modules/lodash._basecopy/package.json new file mode 100644 index 0000000..69729a9 --- /dev/null +++ b/node_modules/lodash._basecopy/package.json @@ -0,0 +1,75 @@ +{ + "_from": "lodash._basecopy@^3.0.0", + "_id": "lodash._basecopy@3.0.1", + "_inBundle": false, + "_integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "_location": "/lodash._basecopy", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash._basecopy@^3.0.0", + "name": "lodash._basecopy", + "escapedName": "lodash._basecopy", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/lodash._baseassign" + ], + "_resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "_shasum": "8da0e6a876cf344c0ad8a54882111dd3c5c7ca36", + "_spec": "lodash._basecopy@^3.0.0", + "_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\lodash._baseassign", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The modern build of lodash’s internal `baseCopy` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "name": "lodash._basecopy", + "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.\"" + }, + "version": "3.0.1" +} diff --git a/node_modules/lodash._bindcallback/LICENSE.txt b/node_modules/lodash._bindcallback/LICENSE.txt new file mode 100644 index 0000000..9cd87e5 --- /dev/null +++ b/node_modules/lodash._bindcallback/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. diff --git a/node_modules/lodash._bindcallback/README.md b/node_modules/lodash._bindcallback/README.md new file mode 100644 index 0000000..d287f26 --- /dev/null +++ b/node_modules/lodash._bindcallback/README.md @@ -0,0 +1,20 @@ +# lodash._bindcallback v3.0.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `bindCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._bindcallback +``` + +In Node.js/io.js: + +```js +var bindCallback = require('lodash._bindcallback'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._bindcallback) for more details. diff --git a/node_modules/lodash._bindcallback/index.js b/node_modules/lodash._bindcallback/index.js new file mode 100644 index 0000000..ef6811d --- /dev/null +++ b/node_modules/lodash._bindcallback/index.js @@ -0,0 +1,65 @@ +/** + * lodash 3.0.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * A specialized version of `baseCallback` which only supports `this` binding + * and specifying the number of arguments to provide to `func`. + * + * @private + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ +function bindCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + if (thisArg === undefined) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + case 5: return function(value, other, key, object, source) { + return func.call(thisArg, value, other, key, object, source); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; +} + +/** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utility + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +module.exports = bindCallback; diff --git a/node_modules/lodash._bindcallback/package.json b/node_modules/lodash._bindcallback/package.json new file mode 100644 index 0000000..77c1de0 --- /dev/null +++ b/node_modules/lodash._bindcallback/package.json @@ -0,0 +1,75 @@ +{ + "_from": "lodash._bindcallback@^3.0.0", + "_id": "lodash._bindcallback@3.0.1", + "_inBundle": false, + "_integrity": "sha1-5THCdkTPi1epnhftlbNcdIeJOS4=", + "_location": "/lodash._bindcallback", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash._bindcallback@^3.0.0", + "name": "lodash._bindcallback", + "escapedName": "lodash._bindcallback", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/lodash._createassigner" + ], + "_resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", + "_shasum": "e531c27644cf8b57a99e17ed95b35c748789392e", + "_spec": "lodash._bindcallback@^3.0.0", + "_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\lodash._createassigner", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The modern build of lodash’s internal `bindCallback` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "name": "lodash._bindcallback", + "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.\"" + }, + "version": "3.0.1" +} diff --git a/node_modules/lodash._createassigner/LICENSE.txt b/node_modules/lodash._createassigner/LICENSE.txt new file mode 100644 index 0000000..9cd87e5 --- /dev/null +++ b/node_modules/lodash._createassigner/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. diff --git a/node_modules/lodash._createassigner/README.md b/node_modules/lodash._createassigner/README.md new file mode 100644 index 0000000..daeebce --- /dev/null +++ b/node_modules/lodash._createassigner/README.md @@ -0,0 +1,20 @@ +# lodash._createassigner v3.1.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createAssigner` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._createassigner +``` + +In Node.js/io.js: + +```js +var createAssigner = require('lodash._createassigner'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash._createassigner) for more details. diff --git a/node_modules/lodash._createassigner/index.js b/node_modules/lodash._createassigner/index.js new file mode 100644 index 0000000..2fdfba7 --- /dev/null +++ b/node_modules/lodash._createassigner/index.js @@ -0,0 +1,52 @@ +/** + * lodash 3.1.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var bindCallback = require('lodash._bindcallback'), + isIterateeCall = require('lodash._isiterateecall'), + restParam = require('lodash.restparam'); + +/** + * Creates a function that assigns properties of source object(s) to a given + * destination object. + * + * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return restParam(function(object, sources) { + var index = -1, + length = object == null ? 0 : sources.length, + customizer = length > 2 ? sources[length - 2] : undefined, + guard = length > 2 ? sources[2] : undefined, + thisArg = length > 1 ? sources[length - 1] : undefined; + + if (typeof customizer == 'function') { + customizer = bindCallback(customizer, thisArg, 5); + length -= 2; + } else { + customizer = typeof thisArg == 'function' ? thisArg : undefined; + length -= (customizer ? 1 : 0); + } + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; diff --git a/node_modules/lodash._createassigner/package.json b/node_modules/lodash._createassigner/package.json new file mode 100644 index 0000000..f27a886 --- /dev/null +++ b/node_modules/lodash._createassigner/package.json @@ -0,0 +1,80 @@ +{ + "_from": "lodash._createassigner@^3.0.0", + "_id": "lodash._createassigner@3.1.1", + "_inBundle": false, + "_integrity": "sha1-g4pbri/aymOsIt7o4Z+k5taXCxE=", + "_location": "/lodash._createassigner", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash._createassigner@^3.0.0", + "name": "lodash._createassigner", + "escapedName": "lodash._createassigner", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/lodash.assign" + ], + "_resolved": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", + "_shasum": "838a5bae2fdaca63ac22dee8e19fa4e6d6970b11", + "_spec": "lodash._createassigner@^3.0.0", + "_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\lodash.assign", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._bindcallback": "^3.0.0", + "lodash._isiterateecall": "^3.0.0", + "lodash.restparam": "^3.0.0" + }, + "deprecated": false, + "description": "The modern build of lodash’s internal `createAssigner` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "name": "lodash._createassigner", + "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.\"" + }, + "version": "3.1.1" +} diff --git a/node_modules/lodash._getnative/LICENSE b/node_modules/lodash._getnative/LICENSE new file mode 100644 index 0000000..9cd87e5 --- /dev/null +++ b/node_modules/lodash._getnative/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. diff --git a/node_modules/lodash._getnative/README.md b/node_modules/lodash._getnative/README.md new file mode 100644 index 0000000..7835cec --- /dev/null +++ b/node_modules/lodash._getnative/README.md @@ -0,0 +1,20 @@ +# lodash._getnative v3.9.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `getNative` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._getnative +``` + +In Node.js/io.js: + +```js +var getNative = require('lodash._getnative'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.9.1-npm-packages/lodash._getnative) for more details. diff --git a/node_modules/lodash._getnative/index.js b/node_modules/lodash._getnative/index.js new file mode 100644 index 0000000..a32063d --- /dev/null +++ b/node_modules/lodash._getnative/index.js @@ -0,0 +1,137 @@ +/** + * lodash 3.9.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** `Object#toString` result references. */ +var funcTag = '[object Function]'; + +/** Used to detect host constructors (Safari > 5). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var fnToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @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(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); +} + +module.exports = getNative; diff --git a/node_modules/lodash._getnative/package.json b/node_modules/lodash._getnative/package.json new file mode 100644 index 0000000..456921e --- /dev/null +++ b/node_modules/lodash._getnative/package.json @@ -0,0 +1,75 @@ +{ + "_from": "lodash._getnative@^3.0.0", + "_id": "lodash._getnative@3.9.1", + "_inBundle": false, + "_integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "_location": "/lodash._getnative", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash._getnative@^3.0.0", + "name": "lodash._getnative", + "escapedName": "lodash._getnative", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/lodash.keys" + ], + "_resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "_shasum": "570bc7dede46d61cdcde687d65d3eecbaa3aaff5", + "_spec": "lodash._getnative@^3.0.0", + "_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\lodash.keys", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The modern build of lodash’s internal `getNative` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "name": "lodash._getnative", + "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.\"" + }, + "version": "3.9.1" +} diff --git a/node_modules/lodash._isiterateecall/LICENSE.txt b/node_modules/lodash._isiterateecall/LICENSE.txt new file mode 100644 index 0000000..9cd87e5 --- /dev/null +++ b/node_modules/lodash._isiterateecall/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. diff --git a/node_modules/lodash._isiterateecall/README.md b/node_modules/lodash._isiterateecall/README.md new file mode 100644 index 0000000..0c5c701 --- /dev/null +++ b/node_modules/lodash._isiterateecall/README.md @@ -0,0 +1,20 @@ +# lodash._isiterateecall v3.0.9 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `isIterateeCall` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._isiterateecall +``` + +In Node.js/io.js: + +```js +var isIterateeCall = require('lodash._isiterateecall'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.9-npm-packages/lodash._isiterateecall) for more details. diff --git a/node_modules/lodash._isiterateecall/index.js b/node_modules/lodash._isiterateecall/index.js new file mode 100644 index 0000000..ea3761b --- /dev/null +++ b/node_modules/lodash._isiterateecall/index.js @@ -0,0 +1,132 @@ +/** + * lodash 3.0.9 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used to detect unsigned integer values. */ +var reIsUint = /^\d+$/; + +/** + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +/** + * Checks if the provided arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object)) { + var other = object[index]; + return value === value ? (value === other) : (other !== other); + } + return false; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @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(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +module.exports = isIterateeCall; diff --git a/node_modules/lodash._isiterateecall/package.json b/node_modules/lodash._isiterateecall/package.json new file mode 100644 index 0000000..1095f5d --- /dev/null +++ b/node_modules/lodash._isiterateecall/package.json @@ -0,0 +1,75 @@ +{ + "_from": "lodash._isiterateecall@^3.0.0", + "_id": "lodash._isiterateecall@3.0.9", + "_inBundle": false, + "_integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "_location": "/lodash._isiterateecall", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash._isiterateecall@^3.0.0", + "name": "lodash._isiterateecall", + "escapedName": "lodash._isiterateecall", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/lodash._createassigner" + ], + "_resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "_shasum": "5203ad7ba425fae842460e696db9cf3e6aac057c", + "_spec": "lodash._isiterateecall@^3.0.0", + "_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\lodash._createassigner", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The modern build of lodash’s internal `isIterateeCall` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "name": "lodash._isiterateecall", + "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.\"" + }, + "version": "3.0.9" +} diff --git a/node_modules/lodash.assign/LICENSE.txt b/node_modules/lodash.assign/LICENSE.txt new file mode 100644 index 0000000..9cd87e5 --- /dev/null +++ b/node_modules/lodash.assign/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. diff --git a/node_modules/lodash.assign/README.md b/node_modules/lodash.assign/README.md new file mode 100644 index 0000000..59a24c0 --- /dev/null +++ b/node_modules/lodash.assign/README.md @@ -0,0 +1,20 @@ +# lodash.assign v3.2.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.assign` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.assign +``` + +In Node.js/io.js: + +```js +var assign = require('lodash.assign'); +``` + +See the [documentation](https://lodash.com/docs#assign) or [package source](https://github.com/lodash/lodash/blob/3.2.0-npm-packages/lodash.assign) for more details. diff --git a/node_modules/lodash.assign/index.js b/node_modules/lodash.assign/index.js new file mode 100644 index 0000000..e394fb0 --- /dev/null +++ b/node_modules/lodash.assign/index.js @@ -0,0 +1,80 @@ +/** + * lodash 3.2.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseAssign = require('lodash._baseassign'), + createAssigner = require('lodash._createassigner'), + keys = require('lodash.keys'); + +/** + * A specialized version of `_.assign` for customizing assigned values without + * support for argument juggling, multiple sources, and `this` binding `customizer` + * functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + */ +function assignWith(object, source, customizer) { + var index = -1, + props = keys(source), + length = props.length; + + while (++index < length) { + var key = props[index], + value = object[key], + result = customizer(value, source[key], key, object, source); + + if ((result === result ? (result !== value) : (value === value)) || + (value === undefined && !(key in object))) { + object[key] = result; + } + } + return object; +} + +/** + * Assigns own enumerable properties of source object(s) to the destination + * object. Subsequent sources overwrite property assignments of previous sources. + * If `customizer` is provided it is invoked to produce the assigned values. + * The `customizer` is bound to `thisArg` and invoked with five arguments: + * (objectValue, sourceValue, key, object, source). + * + * **Note:** This method mutates `object` and is based on + * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). + * + * @static + * @memberOf _ + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {Object} Returns `object`. + * @example + * + * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); + * // => { 'user': 'fred', 'age': 40 } + * + * // using a customizer callback + * var defaults = _.partialRight(_.assign, function(value, other) { + * return _.isUndefined(value) ? other : value; + * }); + * + * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } + */ +var assign = createAssigner(function(object, source, customizer) { + return customizer + ? assignWith(object, source, customizer) + : baseAssign(object, source); +}); + +module.exports = assign; diff --git a/node_modules/lodash.assign/package.json b/node_modules/lodash.assign/package.json new file mode 100644 index 0000000..af40f8b --- /dev/null +++ b/node_modules/lodash.assign/package.json @@ -0,0 +1,86 @@ +{ + "_from": "lodash.assign@^3.2.0", + "_id": "lodash.assign@3.2.0", + "_inBundle": false, + "_integrity": "sha1-POnwI0tLIiPilrj6CsH+6OvKZPo=", + "_location": "/lodash.assign", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash.assign@^3.2.0", + "name": "lodash.assign", + "escapedName": "lodash.assign", + "rawSpec": "^3.2.0", + "saveSpec": null, + "fetchSpec": "^3.2.0" + }, + "_requiredBy": [ + "/express-force-ssl" + ], + "_resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", + "_shasum": "3ce9f0234b4b2223e296b8fa0ac1fee8ebca64fa", + "_spec": "lodash.assign@^3.2.0", + "_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\express-force-ssl", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._baseassign": "^3.0.0", + "lodash._createassigner": "^3.0.0", + "lodash.keys": "^3.0.0" + }, + "deprecated": false, + "description": "The modern build of lodash’s `_.assign` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "license": "MIT", + "name": "lodash.assign", + "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.\"" + }, + "version": "3.2.0" +} diff --git a/node_modules/lodash.isarguments/LICENSE b/node_modules/lodash.isarguments/LICENSE new file mode 100644 index 0000000..e0c69d5 --- /dev/null +++ b/node_modules/lodash.isarguments/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. diff --git a/node_modules/lodash.isarguments/README.md b/node_modules/lodash.isarguments/README.md new file mode 100644 index 0000000..eb95fe1 --- /dev/null +++ b/node_modules/lodash.isarguments/README.md @@ -0,0 +1,18 @@ +# lodash.isarguments v3.1.0 + +The [lodash](https://lodash.com/) method `_.isArguments` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.isarguments +``` + +In Node.js: +```js +var isArguments = require('lodash.isarguments'); +``` + +See the [documentation](https://lodash.com/docs#isArguments) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.isarguments) for more details. diff --git a/node_modules/lodash.isarguments/index.js b/node_modules/lodash.isarguments/index.js new file mode 100644 index 0000000..042dac5 --- /dev/null +++ b/node_modules/lodash.isarguments/index.js @@ -0,0 +1,229 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * 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'; +} + +module.exports = isArguments; diff --git a/node_modules/lodash.isarguments/package.json b/node_modules/lodash.isarguments/package.json new file mode 100644 index 0000000..0f85769 --- /dev/null +++ b/node_modules/lodash.isarguments/package.json @@ -0,0 +1,69 @@ +{ + "_from": "lodash.isarguments@^3.0.0", + "_id": "lodash.isarguments@3.1.0", + "_inBundle": false, + "_integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "_location": "/lodash.isarguments", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash.isarguments@^3.0.0", + "name": "lodash.isarguments", + "escapedName": "lodash.isarguments", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/lodash.keys" + ], + "_resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "_shasum": "2f573d85c6a24289ff00663b491c1d338ff3458a", + "_spec": "lodash.isarguments@^3.0.0", + "_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\lodash.keys", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "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/" + } + ], + "deprecated": false, + "description": "The lodash method `_.isArguments` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "isarguments" + ], + "license": "MIT", + "name": "lodash.isarguments", + "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.\"" + }, + "version": "3.1.0" +} diff --git a/node_modules/lodash.isarray/LICENSE b/node_modules/lodash.isarray/LICENSE new file mode 100644 index 0000000..9cd87e5 --- /dev/null +++ b/node_modules/lodash.isarray/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. diff --git a/node_modules/lodash.isarray/README.md b/node_modules/lodash.isarray/README.md new file mode 100644 index 0000000..ea274aa --- /dev/null +++ b/node_modules/lodash.isarray/README.md @@ -0,0 +1,20 @@ +# lodash.isarray v3.0.4 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isArray` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.isarray +``` + +In Node.js/io.js: + +```js +var isArray = require('lodash.isarray'); +``` + +See the [documentation](https://lodash.com/docs#isArray) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.isarray) for more details. diff --git a/node_modules/lodash.isarray/index.js b/node_modules/lodash.isarray/index.js new file mode 100644 index 0000000..dd24658 --- /dev/null +++ b/node_modules/lodash.isarray/index.js @@ -0,0 +1,180 @@ +/** + * lodash 3.0.4 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** `Object#toString` result references. */ +var arrayTag = '[object Array]', + funcTag = '[object Function]'; + +/** Used to detect host constructors (Safari > 5). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var fnToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeIsArray = getNative(Array, 'isArray'); + +/** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(function() { return arguments; }()); + * // => false + */ +var isArray = nativeIsArray || function(value) { + return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; +}; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @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(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); +} + +module.exports = isArray; diff --git a/node_modules/lodash.isarray/package.json b/node_modules/lodash.isarray/package.json new file mode 100644 index 0000000..04e5e58 --- /dev/null +++ b/node_modules/lodash.isarray/package.json @@ -0,0 +1,81 @@ +{ + "_from": "lodash.isarray@^3.0.0", + "_id": "lodash.isarray@3.0.4", + "_inBundle": false, + "_integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "_location": "/lodash.isarray", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash.isarray@^3.0.0", + "name": "lodash.isarray", + "escapedName": "lodash.isarray", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/lodash.keys" + ], + "_resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "_shasum": "79e4eb88c36a8122af86f844aa9bcd851b5fbb55", + "_spec": "lodash.isarray@^3.0.0", + "_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\lodash.keys", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The modern build of lodash’s `_.isArray` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "license": "MIT", + "name": "lodash.isarray", + "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.\"" + }, + "version": "3.0.4" +} diff --git a/node_modules/lodash.keys/LICENSE b/node_modules/lodash.keys/LICENSE new file mode 100644 index 0000000..9cd87e5 --- /dev/null +++ b/node_modules/lodash.keys/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. diff --git a/node_modules/lodash.keys/README.md b/node_modules/lodash.keys/README.md new file mode 100644 index 0000000..5f69a18 --- /dev/null +++ b/node_modules/lodash.keys/README.md @@ -0,0 +1,20 @@ +# lodash.keys v3.1.2 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.keys` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.keys +``` + +In Node.js/io.js: + +```js +var keys = require('lodash.keys'); +``` + +See the [documentation](https://lodash.com/docs#keys) or [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash.keys) for more details. diff --git a/node_modules/lodash.keys/index.js b/node_modules/lodash.keys/index.js new file mode 100644 index 0000000..f4c1774 --- /dev/null +++ b/node_modules/lodash.keys/index.js @@ -0,0 +1,236 @@ +/** + * lodash 3.1.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var getNative = require('lodash._getnative'), + isArguments = require('lodash.isarguments'), + isArray = require('lodash.isarray'); + +/** Used to detect unsigned integer values. */ +var reIsUint = /^\d+$/; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeKeys = getNative(Object, 'keys'); + +/** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * A fallback implementation of `Object.keys` which creates an array of the + * own enumerable property names of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function shimKeys(object) { + var props = keysIn(object), + propsLength = props.length, + length = propsLength && object.length; + + var allowIndexes = !!length && isLength(length) && + (isArray(object) || isArguments(object)); + + var index = -1, + result = []; + + while (++index < propsLength) { + var key = props[index]; + if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { + result.push(key); + } + } + return result; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @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(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +var keys = !nativeKeys ? shimKeys : function(object) { + var Ctor = object == null ? undefined : object.constructor; + if ((typeof Ctor == 'function' && Ctor.prototype === object) || + (typeof object != 'function' && isArrayLike(object))) { + return shimKeys(object); + } + return isObject(object) ? nativeKeys(object) : []; +}; + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + if (object == null) { + return []; + } + if (!isObject(object)) { + object = Object(object); + } + var length = object.length; + length = (length && isLength(length) && + (isArray(object) || isArguments(object)) && length) || 0; + + var Ctor = object.constructor, + index = -1, + isProto = typeof Ctor == 'function' && Ctor.prototype === object, + result = Array(length), + skipIndexes = length > 0; + + while (++index < length) { + result[index] = (index + ''); + } + for (var key in object) { + if (!(skipIndexes && isIndex(key, length)) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = keys; diff --git a/node_modules/lodash.keys/package.json b/node_modules/lodash.keys/package.json new file mode 100644 index 0000000..9052ec5 --- /dev/null +++ b/node_modules/lodash.keys/package.json @@ -0,0 +1,87 @@ +{ + "_from": "lodash.keys@^3.0.0", + "_id": "lodash.keys@3.1.2", + "_inBundle": false, + "_integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "_location": "/lodash.keys", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash.keys@^3.0.0", + "name": "lodash.keys", + "escapedName": "lodash.keys", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/lodash._baseassign", + "/lodash.assign" + ], + "_resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "_shasum": "4dbc0472b156be50a0b286855d1bd0b0c656098a", + "_spec": "lodash.keys@^3.0.0", + "_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\lodash.assign", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._getnative": "^3.0.0", + "lodash.isarguments": "^3.0.0", + "lodash.isarray": "^3.0.0" + }, + "deprecated": false, + "description": "The modern build of lodash’s `_.keys` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "license": "MIT", + "name": "lodash.keys", + "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.\"" + }, + "version": "3.1.2" +} diff --git a/node_modules/lodash.restparam/LICENSE.txt b/node_modules/lodash.restparam/LICENSE.txt new file mode 100644 index 0000000..9cd87e5 --- /dev/null +++ b/node_modules/lodash.restparam/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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. diff --git a/node_modules/lodash.restparam/README.md b/node_modules/lodash.restparam/README.md new file mode 100644 index 0000000..80e47a4 --- /dev/null +++ b/node_modules/lodash.restparam/README.md @@ -0,0 +1,20 @@ +# lodash.restparam v3.6.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.restParam` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.restparam +``` + +In Node.js/io.js: + +```js +var restParam = require('lodash.restparam'); +``` + +See the [documentation](https://lodash.com/docs#restParam) or [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash.restparam) for more details. diff --git a/node_modules/lodash.restparam/index.js b/node_modules/lodash.restparam/index.js new file mode 100644 index 0000000..932f47a --- /dev/null +++ b/node_modules/lodash.restparam/index.js @@ -0,0 +1,67 @@ +/** + * lodash 3.6.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as an array. + * + * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.restParam(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ +function restParam(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + rest = Array(length); + + while (++index < length) { + rest[index] = args[start + index]; + } + switch (start) { + case 0: return func.call(this, rest); + case 1: return func.call(this, args[0], rest); + case 2: return func.call(this, args[0], args[1], rest); + } + var otherArgs = Array(start + 1); + index = -1; + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = rest; + return func.apply(this, otherArgs); + }; +} + +module.exports = restParam; diff --git a/node_modules/lodash.restparam/package.json b/node_modules/lodash.restparam/package.json new file mode 100644 index 0000000..ed3930d --- /dev/null +++ b/node_modules/lodash.restparam/package.json @@ -0,0 +1,81 @@ +{ + "_from": "lodash.restparam@^3.0.0", + "_id": "lodash.restparam@3.6.1", + "_inBundle": false, + "_integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", + "_location": "/lodash.restparam", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash.restparam@^3.0.0", + "name": "lodash.restparam", + "escapedName": "lodash.restparam", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/lodash._createassigner" + ], + "_resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "_shasum": "936a4e309ef330a7645ed4145986c85ae5b20805", + "_spec": "lodash.restparam@^3.0.0", + "_where": "C:\\Users\\jonio\\Documents\\Programmieren\\Miniportal\\Neu\\MiniportalAPI\\node_modules\\lodash._createassigner", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The modern build of lodash’s `_.restParam` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "license": "MIT", + "name": "lodash.restparam", + "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.\"" + }, + "version": "3.6.1" +} diff --git a/package-lock.json b/package-lock.json index 3a60651..783afb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -154,6 +154,14 @@ "vary": "1.1.2" } }, + "express-force-ssl": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/express-force-ssl/-/express-force-ssl-0.3.2.tgz", + "integrity": "sha1-AbK0mK5v0uQRUrIrV6Phc3c69n4=", + "requires": { + "lodash.assign": "3.2.0" + } + }, "finalhandler": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", @@ -216,6 +224,80 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, + "lodash._baseassign": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "requires": { + "lodash._basecopy": "3.0.1", + "lodash.keys": "3.1.2" + } + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=" + }, + "lodash._bindcallback": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", + "integrity": "sha1-5THCdkTPi1epnhftlbNcdIeJOS4=" + }, + "lodash._createassigner": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", + "integrity": "sha1-g4pbri/aymOsIt7o4Z+k5taXCxE=", + "requires": { + "lodash._bindcallback": "3.0.1", + "lodash._isiterateecall": "3.0.9", + "lodash.restparam": "3.6.1" + } + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=" + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=" + }, + "lodash.assign": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", + "integrity": "sha1-POnwI0tLIiPilrj6CsH+6OvKZPo=", + "requires": { + "lodash._baseassign": "3.2.0", + "lodash._createassigner": "3.1.1", + "lodash.keys": "3.1.2" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "lodash.restparam": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", diff --git a/package.json b/package.json index 51972de..97f1c15 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "cookie-parser": "^1.4.3", "express": "^4.16.1", + "express-force-ssl": "^0.3.2", "mysql": "^2.15.0", "uuid": "^3.1.0" }