diff --git a/node_modules/.bin/har-validator b/node_modules/.bin/har-validator deleted file mode 120000 index c6ec163..0000000 --- a/node_modules/.bin/har-validator +++ /dev/null @@ -1 +0,0 @@ -../har-validator/bin/har-validator \ No newline at end of file diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js deleted file mode 100644 index 7894527..0000000 --- a/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -function assembleStyles () { - var styles = { - modifiers: { - reset: [0, 0], - bold: [1, 22], // 21 isn't widely supported and 22 does the same thing - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - colors: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - gray: [90, 39] - }, - bgColors: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49] - } - }; - - // fix humans - styles.colors.grey = styles.colors.gray; - - Object.keys(styles).forEach(function (groupName) { - var group = styles[groupName]; - - Object.keys(group).forEach(function (styleName) { - var style = group[styleName]; - - styles[styleName] = group[styleName] = { - open: '\u001b[' + style[0] + 'm', - close: '\u001b[' + style[1] + 'm' - }; - }); - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - }); - - return styles; -} - -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/ansi-styles/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/ansi-styles/package.json b/node_modules/ansi-styles/package.json deleted file mode 100644 index 02991ef..0000000 --- a/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "ansi-styles@^2.2.1", - "scope": null, - "escapedName": "ansi-styles", - "name": "ansi-styles", - "rawSpec": "^2.2.1", - "spec": ">=2.2.1 <3.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/chalk" - ] - ], - "_from": "ansi-styles@>=2.2.1 <3.0.0", - "_id": "ansi-styles@2.2.1", - "_inCache": true, - "_location": "/ansi-styles", - "_nodeVersion": "4.3.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176" - }, - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "_npmVersion": "3.8.3", - "_phantomChildren": {}, - "_requested": { - "raw": "ansi-styles@^2.2.1", - "scope": null, - "escapedName": "ansi-styles", - "name": "ansi-styles", - "rawSpec": "^2.2.1", - "spec": ">=2.2.1 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/chalk" - ], - "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", - "_shrinkwrap": null, - "_spec": "ansi-styles@^2.2.1", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/chalk", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-styles/issues" - }, - "dependencies": {}, - "description": "ANSI escape codes for styling strings in the terminal", - "devDependencies": { - "mocha": "*" - }, - "directories": {}, - "dist": { - "shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", - "tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "gitHead": "95c59b23be760108b6530ca1c89477c21b258032", - "homepage": "https://github.com/chalk/ansi-styles#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "name": "ansi-styles", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-styles.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.2.1" -} diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md deleted file mode 100644 index 3f933f6..0000000 --- a/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,86 +0,0 @@ -# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) - -> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal - -You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - -![](screenshot.png) - - -## Install - -``` -$ npm install --save ansi-styles -``` - - -## Usage - -```js -var ansi = require('ansi-styles'); - -console.log(ansi.green.open + 'Hello world!' + ansi.green.close); -``` - - -## API - -Each style has an `open` and `close` property. - - -## Styles - -### Modifiers - -- `reset` -- `bold` -- `dim` -- `italic` *(not widely supported)* -- `underline` -- `inverse` -- `hidden` -- `strikethrough` *(not widely supported)* - -### Colors - -- `black` -- `red` -- `green` -- `yellow` -- `blue` -- `magenta` -- `cyan` -- `white` -- `gray` - -### Background colors - -- `bgBlack` -- `bgRed` -- `bgGreen` -- `bgYellow` -- `bgBlue` -- `bgMagenta` -- `bgCyan` -- `bgWhite` - - -## Advanced usage - -By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. - -- `ansi.modifiers` -- `ansi.colors` -- `ansi.bgColors` - - -###### Example - -```js -console.log(ansi.colors.green.open); -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/asn1/package.json b/node_modules/asn1/package.json index 7556273..990e1a5 100644 --- a/node_modules/asn1/package.json +++ b/node_modules/asn1/package.json @@ -1,45 +1,27 @@ { - "_args": [ - [ - { - "raw": "asn1@~0.2.3", - "scope": null, - "escapedName": "asn1", - "name": "asn1", - "rawSpec": "~0.2.3", - "spec": ">=0.2.3 <0.3.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/sshpk" - ] - ], - "_from": "asn1@>=0.2.3 <0.3.0", + "_from": "asn1@~0.2.3", "_id": "asn1@0.2.3", - "_inCache": true, + "_inBundle": false, + "_integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", "_location": "/asn1", - "_npmUser": { - "name": "pfmooney", - "email": "patrick.f.mooney@gmail.com" - }, - "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { + "type": "range", + "registry": true, "raw": "asn1@~0.2.3", - "scope": null, - "escapedName": "asn1", "name": "asn1", + "escapedName": "asn1", "rawSpec": "~0.2.3", - "spec": ">=0.2.3 <0.3.0", - "type": "range" + "saveSpec": null, + "fetchSpec": "~0.2.3" }, "_requiredBy": [ "/sshpk" ], "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", "_shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86", - "_shrinkwrap": null, "_spec": "asn1@~0.2.3", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/sshpk", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/sshpk", "author": { "name": "Mark Cavage", "email": "mcavage@gmail.com" @@ -47,6 +29,7 @@ "bugs": { "url": "https://github.com/mcavage/node-asn1/issues" }, + "bundleDependencies": false, "contributors": [ { "name": "David Gwynne", @@ -62,31 +45,15 @@ } ], "dependencies": {}, + "deprecated": false, "description": "Contains parsers and serializers for ASN.1 (currently BER only)", "devDependencies": { "tap": "0.4.8" }, - "directories": {}, - "dist": { - "shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86", - "tarball": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz" - }, - "homepage": "https://github.com/mcavage/node-asn1", + "homepage": "https://github.com/mcavage/node-asn1#readme", "license": "MIT", "main": "lib/index.js", - "maintainers": [ - { - "name": "mcavage", - "email": "mcavage@gmail.com" - }, - { - "name": "pfmooney", - "email": "patrick.f.mooney@gmail.com" - } - ], "name": "asn1", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/mcavage/node-asn1.git" diff --git a/node_modules/assert-plus/CHANGES.md b/node_modules/assert-plus/CHANGES.md index d249d9b..57d92bf 100644 --- a/node_modules/assert-plus/CHANGES.md +++ b/node_modules/assert-plus/CHANGES.md @@ -1,5 +1,11 @@ # assert-plus Changelog +## 1.0.0 + +- *BREAKING* assert.number (and derivatives) now accept Infinity as valid input +- Add assert.finite check. Previous assert.number callers should use this if + they expect Infinity inputs to throw. + ## 0.2.0 - Fix `assert.object(null)` so it throws diff --git a/node_modules/assert-plus/README.md b/node_modules/assert-plus/README.md index 0b39593..ec200d1 100644 --- a/node_modules/assert-plus/README.md +++ b/node_modules/assert-plus/README.md @@ -74,41 +74,48 @@ The complete list of APIs is: * assert.buffer * assert.func * assert.number +* assert.finite * assert.object * assert.string * assert.stream * assert.date -* assert.regex +* assert.regexp * assert.uuid * assert.arrayOfArray * assert.arrayOfBool * assert.arrayOfBuffer * assert.arrayOfFunc * assert.arrayOfNumber +* assert.arrayOfFinite * assert.arrayOfObject * assert.arrayOfString * assert.arrayOfStream * assert.arrayOfDate +* assert.arrayOfRegexp * assert.arrayOfUuid * assert.optionalArray * assert.optionalBool * assert.optionalBuffer * assert.optionalFunc * assert.optionalNumber +* assert.optionalFinite * assert.optionalObject * assert.optionalString * assert.optionalStream * assert.optionalDate +* assert.optionalRegexp * assert.optionalUuid * assert.optionalArrayOfArray * assert.optionalArrayOfBool * assert.optionalArrayOfBuffer * assert.optionalArrayOfFunc * assert.optionalArrayOfNumber +* assert.optionalArrayOfFinite * assert.optionalArrayOfObject * assert.optionalArrayOfString * assert.optionalArrayOfStream * assert.optionalArrayOfDate +* assert.optionalArrayOfRegexp * assert.optionalArrayOfUuid * assert.AssertionError * assert.fail diff --git a/node_modules/assert-plus/assert.js b/node_modules/assert-plus/assert.js index 6bce4d8..26f944e 100644 --- a/node_modules/assert-plus/assert.js +++ b/node_modules/assert-plus/assert.js @@ -55,6 +55,11 @@ var types = { } }, number: { + check: function (arg) { + return typeof (arg) === 'number' && !isNaN(arg); + } + }, + finite: { check: function (arg) { return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); } diff --git a/node_modules/assert-plus/package.json b/node_modules/assert-plus/package.json index 7599b1c..4dd77b6 100644 --- a/node_modules/assert-plus/package.json +++ b/node_modules/assert-plus/package.json @@ -1,46 +1,32 @@ { - "_args": [ - [ - { - "raw": "assert-plus@^0.2.0", - "scope": null, - "escapedName": "assert-plus", - "name": "assert-plus", - "rawSpec": "^0.2.0", - "spec": ">=0.2.0 <0.3.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/http-signature" - ] - ], - "_from": "assert-plus@>=0.2.0 <0.3.0", - "_id": "assert-plus@0.2.0", - "_inCache": true, + "_from": "assert-plus@^1.0.0", + "_id": "assert-plus@1.0.0", + "_inBundle": false, + "_integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "_location": "/assert-plus", - "_nodeVersion": "0.10.36", - "_npmUser": { - "name": "pfmooney", - "email": "patrick.f.mooney@gmail.com" - }, - "_npmVersion": "3.3.8", "_phantomChildren": {}, "_requested": { - "raw": "assert-plus@^0.2.0", - "scope": null, - "escapedName": "assert-plus", + "type": "range", + "registry": true, + "raw": "assert-plus@^1.0.0", "name": "assert-plus", - "rawSpec": "^0.2.0", - "spec": ">=0.2.0 <0.3.0", - "type": "range" + "escapedName": "assert-plus", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" }, "_requiredBy": [ - "/http-signature" + "/dashdash", + "/getpass", + "/http-signature", + "/jsprim", + "/sshpk", + "/verror" ], - "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "_shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234", - "_shrinkwrap": null, - "_spec": "assert-plus@^0.2.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/http-signature", + "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "_shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", + "_spec": "assert-plus@^1.0.0", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/http-signature", "author": { "name": "Mark Cavage", "email": "mcavage@gmail.com" @@ -48,6 +34,7 @@ "bugs": { "url": "https://github.com/mcavage/node-assert-plus/issues" }, + "bundleDependencies": false, "contributors": [ { "name": "Dave Eddy", @@ -75,35 +62,20 @@ } ], "dependencies": {}, + "deprecated": false, "description": "Extra assertions on top of node's assert module", "devDependencies": { "faucet": "0.0.1", "tape": "4.2.2" }, - "directories": {}, - "dist": { - "shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234", - "tarball": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz" - }, "engines": { "node": ">=0.8" }, "homepage": "https://github.com/mcavage/node-assert-plus#readme", "license": "MIT", "main": "./assert.js", - "maintainers": [ - { - "name": "mcavage", - "email": "mcavage@gmail.com" - }, - { - "name": "pfmooney", - "email": "patrick.f.mooney@gmail.com" - } - ], "name": "assert-plus", "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/mcavage/node-assert-plus.git" @@ -111,5 +83,5 @@ "scripts": { "test": "tape tests/*.js | ./node_modules/.bin/faucet" }, - "version": "0.2.0" + "version": "1.0.0" } diff --git a/node_modules/asynckit/package.json b/node_modules/asynckit/package.json index 2ed20ab..661fd8e 100644 --- a/node_modules/asynckit/package.json +++ b/node_modules/asynckit/package.json @@ -1,50 +1,27 @@ { - "_args": [ - [ - { - "raw": "asynckit@^0.4.0", - "scope": null, - "escapedName": "asynckit", - "name": "asynckit", - "rawSpec": "^0.4.0", - "spec": ">=0.4.0 <0.5.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/form-data" - ] - ], - "_from": "asynckit@>=0.4.0 <0.5.0", + "_from": "asynckit@^0.4.0", "_id": "asynckit@0.4.0", - "_inCache": true, + "_inBundle": false, + "_integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "_location": "/asynckit", - "_nodeVersion": "0.12.11", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/asynckit-0.4.0.tgz_1465928940169_0.8008207362145185" - }, - "_npmUser": { - "name": "alexindigo", - "email": "iam@alexindigo.com" - }, - "_npmVersion": "2.15.6", "_phantomChildren": {}, "_requested": { + "type": "range", + "registry": true, "raw": "asynckit@^0.4.0", - "scope": null, - "escapedName": "asynckit", "name": "asynckit", + "escapedName": "asynckit", "rawSpec": "^0.4.0", - "spec": ">=0.4.0 <0.5.0", - "type": "range" + "saveSpec": null, + "fetchSpec": "^0.4.0" }, "_requiredBy": [ "/form-data" ], "_resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "_shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79", - "_shrinkwrap": null, "_spec": "asynckit@^0.4.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/form-data", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/form-data", "author": { "name": "Alex Indigo", "email": "iam@alexindigo.com" @@ -52,7 +29,9 @@ "bugs": { "url": "https://github.com/alexindigo/asynckit/issues" }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, "description": "Minimal async jobs utility library, with streams support", "devDependencies": { "browserify": "^13.0.0", @@ -69,12 +48,6 @@ "tap-spec": "^4.1.1", "tape": "^4.5.1" }, - "directories": {}, - "dist": { - "shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79", - "tarball": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" - }, - "gitHead": "583a75ed4fe41761b66416bb6e703ebb1f8963bf", "homepage": "https://github.com/alexindigo/asynckit#readme", "keywords": [ "async", @@ -91,14 +64,7 @@ ], "license": "MIT", "main": "index.js", - "maintainers": [ - { - "name": "alexindigo", - "email": "iam@alexindigo.com" - } - ], "name": "asynckit", - "optionalDependencies": {}, "pre-commit": [ "clean", "lint", @@ -107,7 +73,6 @@ "report", "size" ], - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/alexindigo/asynckit.git" diff --git a/node_modules/aws-sign2/index.js b/node_modules/aws-sign2/index.js index ac72093..fb35f6d 100644 --- a/node_modules/aws-sign2/index.js +++ b/node_modules/aws-sign2/index.js @@ -133,7 +133,7 @@ function stringToSign (options) { ] return r.join('\n') } -module.exports.queryStringToSign = stringToSign +module.exports.stringToSign = stringToSign /** * Return a string for sign() with the given `options`, but is meant exclusively diff --git a/node_modules/aws-sign2/package.json b/node_modules/aws-sign2/package.json index d11482a..8e2f7de 100644 --- a/node_modules/aws-sign2/package.json +++ b/node_modules/aws-sign2/package.json @@ -1,46 +1,27 @@ { - "_args": [ - [ - { - "raw": "aws-sign2@~0.6.0", - "scope": null, - "escapedName": "aws-sign2", - "name": "aws-sign2", - "rawSpec": "~0.6.0", - "spec": ">=0.6.0 <0.7.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/request" - ] - ], - "_from": "aws-sign2@>=0.6.0 <0.7.0", - "_id": "aws-sign2@0.6.0", - "_inCache": true, + "_from": "aws-sign2@~0.7.0", + "_id": "aws-sign2@0.7.0", + "_inBundle": false, + "_integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", "_location": "/aws-sign2", - "_nodeVersion": "4.1.2", - "_npmUser": { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, - "_npmVersion": "2.14.4", "_phantomChildren": {}, "_requested": { - "raw": "aws-sign2@~0.6.0", - "scope": null, - "escapedName": "aws-sign2", + "type": "range", + "registry": true, + "raw": "aws-sign2@~0.7.0", "name": "aws-sign2", - "rawSpec": "~0.6.0", - "spec": ">=0.6.0 <0.7.0", - "type": "range" + "escapedName": "aws-sign2", + "rawSpec": "~0.7.0", + "saveSpec": null, + "fetchSpec": "~0.7.0" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "_shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", - "_shrinkwrap": null, - "_spec": "aws-sign2@~0.6.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/request", + "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "_shasum": "b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8", + "_spec": "aws-sign2@~0.7.0", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/request", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com", @@ -49,33 +30,21 @@ "bugs": { "url": "https://github.com/mikeal/aws-sign/issues" }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", - "tarball": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" - }, "engines": { "node": "*" }, - "gitHead": "8554bdb41268fa295eb1ee300f4adaa9f7f07fec", "homepage": "https://github.com/mikeal/aws-sign#readme", "license": "Apache-2.0", "main": "index.js", - "maintainers": [ - { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - } - ], "name": "aws-sign2", "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "url": "git+https://github.com/mikeal/aws-sign.git" }, - "scripts": {}, - "version": "0.6.0" + "version": "0.7.0" } diff --git a/node_modules/aws4/aws4.js b/node_modules/aws4/aws4.js index a543180..0cff0f0 100644 --- a/node_modules/aws4/aws4.js +++ b/node_modules/aws4/aws4.js @@ -118,14 +118,14 @@ RequestSigner.prototype.prepareRequest = function() { if (request.body && !headers['Content-Length'] && !headers['content-length']) headers['Content-Length'] = Buffer.byteLength(request.body) - if (this.credentials.sessionToken) + if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) headers['X-Amz-Security-Token'] = this.credentials.sessionToken - if (this.service === 's3') + if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') - if (headers['X-Amz-Date']) - this.datetime = headers['X-Amz-Date'] + if (headers['X-Amz-Date'] || headers['x-amz-date']) + this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] else headers['X-Amz-Date'] = this.getDateTime() } @@ -202,13 +202,22 @@ RequestSigner.prototype.canonicalString = function() { var pathStr = this.parsedPath.path, query = this.parsedPath.query, + headers = this.request.headers, queryStr = '', normalizePath = this.service !== 's3', decodePath = this.service === 's3' || this.request.doNotEncodePath, decodeSlashesInPath = this.service === 's3', firstValOnly = this.service === 's3', - bodyHash = this.service === 's3' && this.request.signQuery ? 'UNSIGNED-PAYLOAD' : - (this.isCodeCommitGit ? '' : hash(this.request.body || '', 'hex')) + bodyHash + + if (this.service === 's3' && this.request.signQuery) { + bodyHash = 'UNSIGNED-PAYLOAD' + } else if (this.isCodeCommitGit) { + bodyHash = '' + } else { + bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || + hash(this.request.body || '', 'hex') + } if (query) { queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { diff --git a/node_modules/aws4/package.json b/node_modules/aws4/package.json index 096726d..c116a1b 100644 --- a/node_modules/aws4/package.json +++ b/node_modules/aws4/package.json @@ -1,50 +1,27 @@ { - "_args": [ - [ - { - "raw": "aws4@^1.2.1", - "scope": null, - "escapedName": "aws4", - "name": "aws4", - "rawSpec": "^1.2.1", - "spec": ">=1.2.1 <2.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/request" - ] - ], - "_from": "aws4@>=1.2.1 <2.0.0", - "_id": "aws4@1.5.0", - "_inCache": true, + "_from": "aws4@^1.6.0", + "_id": "aws4@1.6.0", + "_inBundle": false, + "_integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", "_location": "/aws4", - "_nodeVersion": "4.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/aws4-1.5.0.tgz_1476226259635_0.2796843808609992" - }, - "_npmUser": { - "name": "hichaelmart", - "email": "michael.hart.au@gmail.com" - }, - "_npmVersion": "2.15.11", "_phantomChildren": {}, "_requested": { - "raw": "aws4@^1.2.1", - "scope": null, - "escapedName": "aws4", + "type": "range", + "registry": true, + "raw": "aws4@^1.6.0", "name": "aws4", - "rawSpec": "^1.2.1", - "spec": ">=1.2.1 <2.0.0", - "type": "range" + "escapedName": "aws4", + "rawSpec": "^1.6.0", + "saveSpec": null, + "fetchSpec": "^1.6.0" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.5.0.tgz", - "_shasum": "0a29ffb79c31c9e712eeb087e8e7a64b4a56d755", - "_shrinkwrap": null, - "_spec": "aws4@^1.2.1", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/request", + "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "_shasum": "83ef5ca860b2b32e4a0deedee8c771b9db57471e", + "_spec": "aws4@^1.6.0", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/request", "author": { "name": "Michael Hart", "email": "michael.hart.au@gmail.com", @@ -53,18 +30,13 @@ "bugs": { "url": "https://github.com/mhart/aws4/issues" }, - "dependencies": {}, + "bundleDependencies": false, + "deprecated": false, "description": "Signs and prepares requests using AWS Signature Version 4", "devDependencies": { "mocha": "^2.4.5", "should": "^8.2.2" }, - "directories": {}, - "dist": { - "shasum": "0a29ffb79c31c9e712eeb087e8e7a64b4a56d755", - "tarball": "https://registry.npmjs.org/aws4/-/aws4-1.5.0.tgz" - }, - "gitHead": "ba136334ee08884c6042c8578a22e376233eef34", "homepage": "https://github.com/mhart/aws4#readme", "keywords": [ "amazon", @@ -120,15 +92,7 @@ ], "license": "MIT", "main": "aws4.js", - "maintainers": [ - { - "name": "hichaelmart", - "email": "michael.hart.au@gmail.com" - } - ], "name": "aws4", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/mhart/aws4.git" @@ -136,5 +100,5 @@ "scripts": { "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list" }, - "version": "1.5.0" + "version": "1.6.0" } diff --git a/node_modules/bcrypt-pbkdf/index.js b/node_modules/bcrypt-pbkdf/index.js index ea29aa9..b1b5ad4 100644 --- a/node_modules/bcrypt-pbkdf/index.js +++ b/node_modules/bcrypt-pbkdf/index.js @@ -29,10 +29,7 @@ var crypto_hash_sha512 = require('tweetnacl').lowlevel.crypto_hash; * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Niels Provos. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR diff --git a/node_modules/bcrypt-pbkdf/package.json b/node_modules/bcrypt-pbkdf/package.json index 1246720..f60ccfc 100644 --- a/node_modules/bcrypt-pbkdf/package.json +++ b/node_modules/bcrypt-pbkdf/package.json @@ -1,72 +1,36 @@ { - "_args": [ - [ - { - "raw": "bcrypt-pbkdf@^1.0.0", - "scope": null, - "escapedName": "bcrypt-pbkdf", - "name": "bcrypt-pbkdf", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/sshpk" - ] - ], - "_from": "bcrypt-pbkdf@>=1.0.0 <2.0.0", - "_id": "bcrypt-pbkdf@1.0.0", - "_inCache": true, + "_from": "bcrypt-pbkdf@^1.0.0", + "_id": "bcrypt-pbkdf@1.0.1", + "_inBundle": false, + "_integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", "_location": "/bcrypt-pbkdf", - "_nodeVersion": "0.12.15", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/bcrypt-pbkdf-1.0.0.tgz_1471381825814_0.06877309852279723" - }, - "_npmUser": { - "name": "arekinath", - "email": "alex@cooperi.net" - }, - "_npmVersion": "3.10.3", "_phantomChildren": {}, "_requested": { + "type": "range", + "registry": true, "raw": "bcrypt-pbkdf@^1.0.0", - "scope": null, - "escapedName": "bcrypt-pbkdf", "name": "bcrypt-pbkdf", + "escapedName": "bcrypt-pbkdf", "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" + "saveSpec": null, + "fetchSpec": "^1.0.0" }, "_requiredBy": [ "/sshpk" ], - "_resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.0.tgz", - "_shasum": "3ca76b85241c7170bf7d9703e7b9aa74630040d4", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "_shasum": "63bc5dcb61331b92bc05fd528953c33462a06f8d", "_spec": "bcrypt-pbkdf@^1.0.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/sshpk", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/sshpk", + "bundleDependencies": false, "dependencies": { "tweetnacl": "^0.14.3" }, + "deprecated": false, "description": "Port of the OpenBSD bcrypt_pbkdf function to pure JS", "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "3ca76b85241c7170bf7d9703e7b9aa74630040d4", - "tarball": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.0.tgz" - }, - "gitHead": "e88be37d3cd25395b4aa496ac468b33671368be6", - "license": "BSD-4-Clause", + "license": "BSD-3-Clause", "main": "index.js", - "maintainers": [ - { - "name": "arekinath", - "email": "alex@cooperi.net" - } - ], "name": "bcrypt-pbkdf", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "scripts": {}, - "version": "1.0.0" + "version": "1.0.1" } diff --git a/node_modules/boom/.npmignore b/node_modules/boom/.npmignore deleted file mode 100644 index 77ba16c..0000000 --- a/node_modules/boom/.npmignore +++ /dev/null @@ -1,18 +0,0 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov - diff --git a/node_modules/boom/.travis.yml b/node_modules/boom/.travis.yml deleted file mode 100755 index dd1b24f..0000000 --- a/node_modules/boom/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js - -node_js: - - 0.10 - - 4.0 - -sudo: false - diff --git a/node_modules/boom/CONTRIBUTING.md b/node_modules/boom/CONTRIBUTING.md deleted file mode 100644 index 8928361..0000000 --- a/node_modules/boom/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md). diff --git a/node_modules/boom/LICENSE b/node_modules/boom/LICENSE index 3946889..94b91cb 100755 --- a/node_modules/boom/LICENSE +++ b/node_modules/boom/LICENSE @@ -1,4 +1,5 @@ -Copyright (c) 2012-2014, Walmart and other contributors. +Copyright (c) 2012-2017, Project contributors. +Copyright (c) 2012-2014, Walmart. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -25,4 +26,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * * -The complete list of contributors can be found at: https://github.com/hapijs/boom/graphs/contributors \ No newline at end of file +The complete list of contributors can be found at: https://github.com/hapijs/boom/graphs/contributors diff --git a/node_modules/boom/README.md b/node_modules/boom/README.md index cbd91c9..6452491 100755 --- a/node_modules/boom/README.md +++ b/node_modules/boom/README.md @@ -2,11 +2,54 @@ HTTP-friendly error objects -[![Build Status](https://secure.travis-ci.org/hapijs/boom.png)](http://travis-ci.org/hapijs/boom) +[![Build Status](https://secure.travis-ci.org/hapijs/boom.svg)](http://travis-ci.org/hapijs/boom) [![Current Version](https://img.shields.io/npm/v/boom.svg)](https://www.npmjs.com/package/boom) Lead Maintainer: [Adam Bretz](https://github.com/arb) + + +- [Boom](#boom) + - [Helper Methods](#helper-methods) + - [`wrap(error, [statusCode], [message])`](#wraperror-statuscode-message) + - [`create(statusCode, [message], [data])`](#createstatuscode-message-data) + - [HTTP 4xx Errors](#http-4xx-errors) + - [`Boom.badRequest([message], [data])`](#boombadrequestmessage-data) + - [`Boom.unauthorized([message], [scheme], [attributes])`](#boomunauthorizedmessage-scheme-attributes) + - [`Boom.paymentRequired([message], [data])`](#boompaymentrequiredmessage-data) + - [`Boom.forbidden([message], [data])`](#boomforbiddenmessage-data) + - [`Boom.notFound([message], [data])`](#boomnotfoundmessage-data) + - [`Boom.methodNotAllowed([message], [data], [allow])`](#boommethodnotallowedmessage-data-allow) + - [`Boom.notAcceptable([message], [data])`](#boomnotacceptablemessage-data) + - [`Boom.proxyAuthRequired([message], [data])`](#boomproxyauthrequiredmessage-data) + - [`Boom.clientTimeout([message], [data])`](#boomclienttimeoutmessage-data) + - [`Boom.conflict([message], [data])`](#boomconflictmessage-data) + - [`Boom.resourceGone([message], [data])`](#boomresourcegonemessage-data) + - [`Boom.lengthRequired([message], [data])`](#boomlengthrequiredmessage-data) + - [`Boom.preconditionFailed([message], [data])`](#boompreconditionfailedmessage-data) + - [`Boom.entityTooLarge([message], [data])`](#boomentitytoolargemessage-data) + - [`Boom.uriTooLong([message], [data])`](#boomuritoolongmessage-data) + - [`Boom.unsupportedMediaType([message], [data])`](#boomunsupportedmediatypemessage-data) + - [`Boom.rangeNotSatisfiable([message], [data])`](#boomrangenotsatisfiablemessage-data) + - [`Boom.expectationFailed([message], [data])`](#boomexpectationfailedmessage-data) + - [`Boom.teapot([message], [data])`](#boomteapotmessage-data) + - [`Boom.badData([message], [data])`](#boombaddatamessage-data) + - [`Boom.locked([message], [data])`](#boomlockedmessage-data) + - [`Boom.preconditionRequired([message], [data])`](#boompreconditionrequiredmessage-data) + - [`Boom.tooManyRequests([message], [data])`](#boomtoomanyrequestsmessage-data) + - [`Boom.illegal([message], [data])`](#boomillegalmessage-data) + - [HTTP 5xx Errors](#http-5xx-errors) + - [`Boom.badImplementation([message], [data])` - (*alias: `internal`*)](#boombadimplementationmessage-data---alias-internal) + - [`Boom.notImplemented([message], [data])`](#boomnotimplementedmessage-data) + - [`Boom.badGateway([message], [data])`](#boombadgatewaymessage-data) + - [`Boom.serverUnavailable([message], [data])`](#boomserverunavailablemessage-data) + - [`Boom.gatewayTimeout([message], [data])`](#boomgatewaytimeoutmessage-data) + - [F.A.Q.](#faq) + + + +# Boom + **boom** provides a set of utilities for returning HTTP errors. Each utility returns a `Boom` error response object (instance of `Error`) which includes the following properties: - `isBoom` - if `true`, indicates this is a `Boom` object instance. @@ -27,41 +70,6 @@ object (instance of `Error`) which includes the following properties: The `Boom` object also supports the following method: - `reformat()` - rebuilds `error.output` using the other object properties. -## Overview - -- Helper methods - - [`wrap(error, [statusCode], [message])`](#wraperror-statuscode-message) - - [`create(statusCode, [message], [data])`](#createstatuscode-message-data) -- HTTP 4xx Errors - - 400: [`Boom.badRequest([message], [data])`](#boombadrequestmessage-data) - - 401: [`Boom.unauthorized([message], [scheme], [attributes])`](#boomunauthorizedmessage-scheme-attributes) - - 403: [`Boom.forbidden([message], [data])`](#boomforbiddenmessage-data) - - 404: [`Boom.notFound([message], [data])`](#boomnotfoundmessage-data) - - 405: [`Boom.methodNotAllowed([message], [data])`](#boommethodnotallowedmessage-data) - - 406: [`Boom.notAcceptable([message], [data])`](#boomnotacceptablemessage-data) - - 407: [`Boom.proxyAuthRequired([message], [data])`](#boomproxyauthrequiredmessage-data) - - 408: [`Boom.clientTimeout([message], [data])`](#boomclienttimeoutmessage-data) - - 409: [`Boom.conflict([message], [data])`](#boomconflictmessage-data) - - 410: [`Boom.resourceGone([message], [data])`](#boomresourcegonemessage-data) - - 411: [`Boom.lengthRequired([message], [data])`](#boomlengthrequiredmessage-data) - - 412: [`Boom.preconditionFailed([message], [data])`](#boompreconditionfailedmessage-data) - - 413: [`Boom.entityTooLarge([message], [data])`](#boomentitytoolargemessage-data) - - 414: [`Boom.uriTooLong([message], [data])`](#boomuritoolongmessage-data) - - 415: [`Boom.unsupportedMediaType([message], [data])`](#boomunsupportedmediatypemessage-data) - - 416: [`Boom.rangeNotSatisfiable([message], [data])`](#boomrangenotsatisfiablemessage-data) - - 417: [`Boom.expectationFailed([message], [data])`](#boomexpectationfailedmessage-data) - - 422: [`Boom.badData([message], [data])`](#boombaddatamessage-data) - - 428: [`Boom.preconditionRequired([message], [data])`](#boompreconditionrequiredmessage-data) - - 429: [`Boom.tooManyRequests([message], [data])`](#boomtoomanyrequestsmessage-data) -- HTTP 5xx Errors - - 500: [`Boom.badImplementation([message], [data])`](#boombadimplementationmessage-data) - - 501: [`Boom.notImplemented([message], [data])`](#boomnotimplementedmessage-data) - - 502: [`Boom.badGateway([message], [data])`](#boombadgatewaymessage-data) - - 503: [`Boom.serverTimeout([message], [data])`](#boomservertimeoutmessage-data) - - 504: [`Boom.gatewayTimeout([message], [data])`](#boomgatewaytimeoutmessage-data) -- [FAQ](#faq) - - ## Helper Methods ### `wrap(error, [statusCode], [message])` @@ -118,8 +126,8 @@ Returns a 401 Unauthorized error where: - an authentication scheme name - an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header. - `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used - when `schema` is a string, otherwise it is ignored. Every key/value pair will be included in the - 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the `attributes` key. + when `scheme` is a string, otherwise it is ignored. Every key/value pair will be included in the + 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the `attributes` key. Alternatively value can be a string which is use to set the value of the scheme, for example setting the token value for negotiate header. If string is used message parameter must be null. `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header will not be present and `isMissing` will be true on the error object. @@ -161,6 +169,23 @@ Generates the following response: } ``` +```js +Boom.unauthorized(null, 'Negotiate', 'VGhpcyBpcyBhIHRlc3QgdG9rZW4='); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "attributes": "VGhpcyBpcyBhIHRlc3QgdG9rZW4=" +}, +"headers" { + "WWW-Authenticate": "Negotiate VGhpcyBpcyBhIHRlc3QgdG9rZW4=" +} +``` + ```js Boom.unauthorized('invalid password', 'sample', { ttl: 0, cache: null, foo: 'bar' }); ``` @@ -184,6 +209,26 @@ Generates the following response: } ``` +### `Boom.paymentRequired([message], [data])` + +Returns a 402 Payment Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.paymentRequired('bandwidth used'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 402, + "error": "Payment Required", + "message": "bandwidth used" +} +``` + ### `Boom.forbidden([message], [data])` Returns a 403 Forbidden error where: @@ -224,11 +269,12 @@ Generates the following response payload: } ``` -### `Boom.methodNotAllowed([message], [data])` +### `Boom.methodNotAllowed([message], [data], [allow])` Returns a 405 Method Not Allowed error where: - `message` - optional message. - `data` - optional additional error data. +- `allow` - optional string or array of strings (to be combined and separated by ', ') which is set to the 'Allow' header. ```js Boom.methodNotAllowed('that method is not allowed'); @@ -482,6 +528,26 @@ Generates the following response payload: } ``` +### `Boom.teapot([message], [data])` + +Returns a 418 I'm a Teapot error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.teapot('sorry, no coffee...'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 418, + "error": "I'm a Teapot", + "message": "Sorry, no coffee..." +} +``` + ### `Boom.badData([message], [data])` Returns a 422 Unprocessable Entity error where: @@ -502,6 +568,26 @@ Generates the following response payload: } ``` +### `Boom.locked([message], [data])` + +Returns a 423 Locked error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.locked('this resource has been locked'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 423, + "error": "Locked", + "message": "this resource has been locked" +} +``` + ### `Boom.preconditionRequired([message], [data])` Returns a 428 Precondition Required error where: @@ -542,11 +628,31 @@ Generates the following response payload: } ``` +### `Boom.illegal([message], [data])` + +Returns a 451 Unavailable For Legal Reasons error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.illegal('you are not permitted to view this resource for legal reasons'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 451, + "error": "Unavailable For Legal Reasons", + "message": "you are not permitted to view this resource for legal reasons" +} +``` + ## HTTP 5xx Errors All 500 errors hide your message from the end user. Your message is recorded in the server log. -### `Boom.badImplementation([message], [data])` +### `Boom.badImplementation([message], [data])` - (*alias: `internal`*) Returns a 500 Internal Server Error error where: - `message` - optional message. @@ -606,14 +712,14 @@ Generates the following response payload: } ``` -### `Boom.serverTimeout([message], [data])` +### `Boom.serverUnavailable([message], [data])` Returns a 503 Service Unavailable error where: - `message` - optional message. - `data` - optional additional error data. ```js -Boom.serverTimeout('unavailable'); +Boom.serverUnavailable('unavailable'); ``` Generates the following response payload: @@ -647,6 +753,8 @@ Generates the following response payload: ## F.A.Q. -###### How do I include extra information in my responses? `output.payload` is missing `data`, what gives? +**Q** How do I include extra information in my responses? `output.payload` is missing `data`, what gives? -There is a reason the values passed back in the response payloads are pretty locked down. It's mostly for security and to not leak any important information back to the client. This means you will need to put in a little more effort to include extra information about your custom error. Check out the ["Error transformation"](https://github.com/hapijs/hapi/blob/master/API.md#error-transformation) section in the hapi documentation. +**A** There is a reason the values passed back in the response payloads are pretty locked down. It's mostly for security and to not leak any important information back to the client. This means you will need to put in a little more effort to include extra information about your custom error. Check out the ["Error transformation"](https://github.com/hapijs/hapi/blob/master/API.md#error-transformation) section in the hapi documentation. + +--- diff --git a/node_modules/boom/images/boom.png b/node_modules/boom/images/boom.png deleted file mode 100755 index 373bc13..0000000 Binary files a/node_modules/boom/images/boom.png and /dev/null differ diff --git a/node_modules/boom/lib/index.js b/node_modules/boom/lib/index.js index 6bdea69..17ed027 100755 --- a/node_modules/boom/lib/index.js +++ b/node_modules/boom/lib/index.js @@ -1,16 +1,80 @@ +'use strict'; + // Load modules -var Http = require('http'); -var Hoek = require('hoek'); +const Hoek = require('hoek'); // Declare internals -var internals = {}; +const internals = { + STATUS_CODES: Object.setPrototypeOf({ + '100': 'Continue', + '101': 'Switching Protocols', + '102': 'Processing', + '200': 'OK', + '201': 'Created', + '202': 'Accepted', + '203': 'Non-Authoritative Information', + '204': 'No Content', + '205': 'Reset Content', + '206': 'Partial Content', + '207': 'Multi-Status', + '300': 'Multiple Choices', + '301': 'Moved Permanently', + '302': 'Moved Temporarily', + '303': 'See Other', + '304': 'Not Modified', + '305': 'Use Proxy', + '307': 'Temporary Redirect', + '400': 'Bad Request', + '401': 'Unauthorized', + '402': 'Payment Required', + '403': 'Forbidden', + '404': 'Not Found', + '405': 'Method Not Allowed', + '406': 'Not Acceptable', + '407': 'Proxy Authentication Required', + '408': 'Request Time-out', + '409': 'Conflict', + '410': 'Gone', + '411': 'Length Required', + '412': 'Precondition Failed', + '413': 'Request Entity Too Large', + '414': 'Request-URI Too Large', + '415': 'Unsupported Media Type', + '416': 'Requested Range Not Satisfiable', + '417': 'Expectation Failed', + '418': 'I\'m a teapot', + '422': 'Unprocessable Entity', + '423': 'Locked', + '424': 'Failed Dependency', + '425': 'Unordered Collection', + '426': 'Upgrade Required', + '428': 'Precondition Required', + '429': 'Too Many Requests', + '431': 'Request Header Fields Too Large', + '451': 'Unavailable For Legal Reasons', + '500': 'Internal Server Error', + '501': 'Not Implemented', + '502': 'Bad Gateway', + '503': 'Service Unavailable', + '504': 'Gateway Time-out', + '505': 'HTTP Version Not Supported', + '506': 'Variant Also Negotiates', + '507': 'Insufficient Storage', + '509': 'Bandwidth Limit Exceeded', + '510': 'Not Extended', + '511': 'Network Authentication Required' + }, null) +}; + exports.wrap = function (error, statusCode, message) { Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object'); + Hoek.assert(!error.isBoom || (!statusCode && !message), 'Cannot provide statusCode or message with boom error'); + return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message)); }; @@ -20,18 +84,27 @@ exports.create = function (statusCode, message, data) { return internals.create(statusCode, message, data, exports.create); }; + internals.create = function (statusCode, message, data, ctor) { - var error = new Error(message ? message : undefined); // Avoids settings null message + if (message instanceof Error) { + if (data) { + message.data = data; + } + return exports.wrap(message, statusCode); + } + + const error = new Error(message ? message : undefined); // Avoids settings null message Error.captureStackTrace(error, ctor); // Filter the stack to our external API error.data = data || null; internals.initialize(error, statusCode); return error; }; + internals.initialize = function (error, statusCode, message) { - var numberCode = parseInt(statusCode, 10); + const numberCode = parseInt(statusCode, 10); Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode); error.isBoom = true; @@ -67,7 +140,7 @@ internals.initialize = function (error, statusCode, message) { internals.reformat = function () { this.output.payload.statusCode = this.output.statusCode; - this.output.payload.error = Http.STATUS_CODES[this.output.statusCode] || 'Unknown'; + this.output.payload.error = internals.STATUS_CODES[this.output.statusCode] || 'Unknown'; if (this.output.statusCode === 500) { this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user @@ -88,15 +161,13 @@ exports.badRequest = function (message, data) { exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[]) - var err = internals.create(401, message, undefined, exports.unauthorized); + const err = internals.create(401, message, undefined, exports.unauthorized); if (!scheme) { return err; } - var wwwAuthenticate = ''; - var i = 0; - var il = 0; + let wwwAuthenticate = ''; if (typeof scheme === 'string') { @@ -109,29 +180,36 @@ exports.unauthorized = function (message, scheme, attributes) { // Or f } if (attributes) { - var names = Object.keys(attributes); - for (i = 0, il = names.length; i < il; ++i) { - var name = names[i]; - if (i) { - wwwAuthenticate += ','; - } + if (typeof attributes === 'string') { + wwwAuthenticate = wwwAuthenticate + ' ' + Hoek.escapeHeaderAttribute(attributes); + err.output.payload.attributes = attributes; + } + else { + const names = Object.keys(attributes); + for (let i = 0; i < names.length; ++i) { + const name = names[i]; + if (i) { + wwwAuthenticate = wwwAuthenticate + ','; + } - var value = attributes[name]; - if (value === null || - value === undefined) { // Value can be zero + let value = attributes[name]; + if (value === null || + value === undefined) { // Value can be zero - value = ''; + value = ''; + } + wwwAuthenticate = wwwAuthenticate + ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; + err.output.payload.attributes[name] = value; } - wwwAuthenticate += ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; - err.output.payload.attributes[name] = value; } } + if (message) { if (attributes) { - wwwAuthenticate += ','; + wwwAuthenticate = wwwAuthenticate + ','; } - wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"'; + wwwAuthenticate = wwwAuthenticate + ' error="' + Hoek.escapeHeaderAttribute(message) + '"'; err.output.payload.attributes.error = message; } else { @@ -142,13 +220,13 @@ exports.unauthorized = function (message, scheme, attributes) { // Or f // function (message, wwwAuthenticate[]) - var wwwArray = scheme; - for (i = 0, il = wwwArray.length; i < il; ++i) { + const wwwArray = scheme; + for (let i = 0; i < wwwArray.length; ++i) { if (i) { - wwwAuthenticate += ', '; + wwwAuthenticate = wwwAuthenticate + ', '; } - wwwAuthenticate += wwwArray[i]; + wwwAuthenticate = wwwAuthenticate + wwwArray[i]; } } @@ -158,6 +236,12 @@ exports.unauthorized = function (message, scheme, attributes) { // Or f }; +exports.paymentRequired = function (message, data) { + + return internals.create(402, message, data, exports.paymentRequired); +}; + + exports.forbidden = function (message, data) { return internals.create(403, message, data, exports.forbidden); @@ -170,9 +254,19 @@ exports.notFound = function (message, data) { }; -exports.methodNotAllowed = function (message, data) { +exports.methodNotAllowed = function (message, data, allow) { - return internals.create(405, message, data, exports.methodNotAllowed); + const err = internals.create(405, message, data, exports.methodNotAllowed); + + if (typeof allow === 'string') { + allow = [allow]; + } + + if (Array.isArray(allow)) { + err.output.headers.Allow = allow.join(', '); + } + + return err; }; @@ -247,12 +341,25 @@ exports.expectationFailed = function (message, data) { return internals.create(417, message, data, exports.expectationFailed); }; + +exports.teapot = function (message, data) { + + return internals.create(418, message, data, exports.teapot); +}; + + exports.badData = function (message, data) { return internals.create(422, message, data, exports.badData); }; +exports.locked = function (message, data) { + + return internals.create(423, message, data, exports.locked); +}; + + exports.preconditionRequired = function (message, data) { return internals.create(428, message, data, exports.preconditionRequired); @@ -265,6 +372,12 @@ exports.tooManyRequests = function (message, data) { }; +exports.illegal = function (message, data) { + + return internals.create(451, message, data, exports.illegal); +}; + + // 5xx Server Errors exports.internal = function (message, data, statusCode) { @@ -272,12 +385,14 @@ exports.internal = function (message, data, statusCode) { return internals.serverError(message, data, statusCode, exports.internal); }; + internals.serverError = function (message, data, statusCode, ctor) { - var error; + let error; if (data instanceof Error) { error = exports.wrap(data, statusCode, message); - } else { + } + else { error = internals.create(statusCode || 500, message, undefined, ctor); error.data = data; } @@ -298,9 +413,9 @@ exports.badGateway = function (message, data) { }; -exports.serverTimeout = function (message, data) { +exports.serverUnavailable = function (message, data) { - return internals.serverError(message, data, 503, exports.serverTimeout); + return internals.serverError(message, data, 503, exports.serverUnavailable); }; @@ -312,7 +427,7 @@ exports.gatewayTimeout = function (message, data) { exports.badImplementation = function (message, data) { - var err = internals.serverError(message, data, 500, exports.badImplementation); + const err = internals.serverError(message, data, 500, exports.badImplementation); err.isDeveloperError = true; return err; }; diff --git a/node_modules/boom/package.json b/node_modules/boom/package.json index 0281ecb..4c1225a 100644 --- a/node_modules/boom/package.json +++ b/node_modules/boom/package.json @@ -1,67 +1,44 @@ { - "_args": [ - [ - { - "raw": "boom@2.x.x", - "scope": null, - "escapedName": "boom", - "name": "boom", - "rawSpec": "2.x.x", - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/hawk" - ] - ], - "_from": "boom@>=2.0.0 <3.0.0", - "_id": "boom@2.10.1", - "_inCache": true, + "_from": "boom@4.x.x", + "_id": "boom@4.3.1", + "_inBundle": false, + "_integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", "_location": "/boom", - "_nodeVersion": "0.10.40", - "_npmUser": { - "name": "arb", - "email": "arbretz@gmail.com" - }, - "_npmVersion": "2.11.1", "_phantomChildren": {}, "_requested": { - "raw": "boom@2.x.x", - "scope": null, - "escapedName": "boom", + "type": "range", + "registry": true, + "raw": "boom@4.x.x", "name": "boom", - "rawSpec": "2.x.x", - "spec": ">=2.0.0 <3.0.0", - "type": "range" + "escapedName": "boom", + "rawSpec": "4.x.x", + "saveSpec": null, + "fetchSpec": "4.x.x" }, "_requiredBy": [ - "/cryptiles", "/hawk" ], - "_resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "_shasum": "39c8918ceff5799f83f9492a848f625add0c766f", - "_shrinkwrap": null, - "_spec": "boom@2.x.x", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/hawk", + "_resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "_shasum": "4f8a3005cb4a7e3889f749030fd25b96e01d2e31", + "_spec": "boom@4.x.x", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/hawk", "bugs": { "url": "https://github.com/hapijs/boom/issues" }, + "bundleDependencies": false, "dependencies": { - "hoek": "2.x.x" + "hoek": "4.x.x" }, + "deprecated": false, "description": "HTTP-friendly error objects", "devDependencies": { - "code": "1.x.x", - "lab": "7.x.x" - }, - "directories": {}, - "dist": { - "shasum": "39c8918ceff5799f83f9492a848f625add0c766f", - "tarball": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + "code": "4.x.x", + "lab": "13.x.x", + "markdown-toc": "0.12.x" }, "engines": { - "node": ">=0.10.40" + "node": ">=4.0.0" }, - "gitHead": "ff1a662a86b39426cdd18f4441b112d307a34a6f", "homepage": "https://github.com/hapijs/boom#readme", "keywords": [ "error", @@ -69,30 +46,16 @@ ], "license": "BSD-3-Clause", "main": "lib/index.js", - "maintainers": [ - { - "name": "hueniverse", - "email": "eran@hueniverse.com" - }, - { - "name": "wyatt", - "email": "wpreul@gmail.com" - }, - { - "name": "arb", - "email": "arbretz@gmail.com" - } - ], "name": "boom", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/hapijs/boom.git" }, "scripts": { - "test": "lab -a code -t 100 -L", - "test-cov-html": "lab -a code -r html -o coverage.html -L" + "test": "lab -a code -t 100 -L -v", + "test-cov-html": "lab -a code -r html -o coverage.html -L", + "toc": "node generate-toc.js", + "version": "npm run toc && git add README.md" }, - "version": "2.10.1" + "version": "4.3.1" } diff --git a/node_modules/boom/test/index.js b/node_modules/boom/test/index.js deleted file mode 100755 index 79a59e9..0000000 --- a/node_modules/boom/test/index.js +++ /dev/null @@ -1,654 +0,0 @@ -// Load modules - -var Code = require('code'); -var Boom = require('../lib'); -var Lab = require('lab'); - - -// Declare internals - -var internals = {}; - - -// Test shortcuts - -var lab = exports.lab = Lab.script(); -var describe = lab.describe; -var it = lab.it; -var expect = Code.expect; - - -it('returns the same object when already boom', function (done) { - - var error = Boom.badRequest(); - var wrapped = Boom.wrap(error); - expect(error).to.equal(wrapped); - done(); -}); - -it('returns an error with info when constructed using another error', function (done) { - - var error = new Error('ka-boom'); - error.xyz = 123; - var err = Boom.wrap(error); - expect(err.xyz).to.equal(123); - expect(err.message).to.equal('ka-boom'); - expect(err.output).to.deep.equal({ - statusCode: 500, - payload: { - statusCode: 500, - error: 'Internal Server Error', - message: 'An internal server error occurred' - }, - headers: {} - }); - expect(err.data).to.equal(null); - done(); -}); - -it('does not override data when constructed using another error', function (done) { - - var error = new Error('ka-boom'); - error.data = { useful: 'data' }; - var err = Boom.wrap(error); - expect(err.data).to.equal(error.data); - done(); -}); - -it('sets new message when none exists', function (done) { - - var error = new Error(); - var wrapped = Boom.wrap(error, 400, 'something bad'); - expect(wrapped.message).to.equal('something bad'); - done(); -}); - -it('throws when statusCode is not a number', function (done) { - - expect(function () { - - Boom.create('x'); - }).to.throw('First argument must be a number (400+): x'); - done(); -}); - -it('will cast a number-string to an integer', function (done) { - - var codes = [ - { input: '404', result: 404 }, - { input: '404.1', result: 404 }, - { input: 400, result: 400 }, - { input: 400.123, result: 400 }]; - for (var i = 0, il = codes.length; i < il; ++i) { - var code = codes[i]; - var err = Boom.create(code.input); - expect(err.output.statusCode).to.equal(code.result); - } - - done(); -}); - -it('throws when statusCode is not finite', function (done) { - - expect(function () { - - Boom.create(1 / 0); - }).to.throw('First argument must be a number (400+): null'); - done(); -}); - -it('sets error code to unknown', function (done) { - - var err = Boom.create(999); - expect(err.output.payload.error).to.equal('Unknown'); - done(); -}); - -describe('create()', function () { - - it('does not sets null message', function (done) { - - var error = Boom.unauthorized(null); - expect(error.output.payload.message).to.not.exist(); - expect(error.isServer).to.be.false(); - done(); - }); - - it('sets message and data', function (done) { - - var error = Boom.badRequest('Missing data', { type: 'user' }); - expect(error.data.type).to.equal('user'); - expect(error.output.payload.message).to.equal('Missing data'); - done(); - }); -}); - -describe('isBoom()', function () { - - it('returns true for Boom object', function (done) { - - expect(Boom.badRequest().isBoom).to.equal(true); - done(); - }); - - it('returns false for Error object', function (done) { - - expect((new Error()).isBoom).to.not.exist(); - done(); - }); -}); - -describe('badRequest()', function () { - - it('returns a 400 error statusCode', function (done) { - - var error = Boom.badRequest(); - - expect(error.output.statusCode).to.equal(400); - expect(error.isServer).to.be.false(); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.badRequest('my message').message).to.equal('my message'); - done(); - }); - - it('sets the message to HTTP status if none provided', function (done) { - - expect(Boom.badRequest().message).to.equal('Bad Request'); - done(); - }); -}); - -describe('unauthorized()', function () { - - it('returns a 401 error statusCode', function (done) { - - var err = Boom.unauthorized(); - expect(err.output.statusCode).to.equal(401); - expect(err.output.headers).to.deep.equal({}); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.unauthorized('my message').message).to.equal('my message'); - done(); - }); - - it('returns a WWW-Authenticate header when passed a scheme', function (done) { - - var err = Boom.unauthorized('boom', 'Test'); - expect(err.output.statusCode).to.equal(401); - expect(err.output.headers['WWW-Authenticate']).to.equal('Test error="boom"'); - done(); - }); - - it('returns a WWW-Authenticate header set to the schema array value', function (done) { - - var err = Boom.unauthorized(null, ['Test','one','two']); - expect(err.output.statusCode).to.equal(401); - expect(err.output.headers['WWW-Authenticate']).to.equal('Test, one, two'); - done(); - }); - - it('returns a WWW-Authenticate header when passed a scheme and attributes', function (done) { - - var err = Boom.unauthorized('boom', 'Test', { a: 1, b: 'something', c: null, d: 0 }); - expect(err.output.statusCode).to.equal(401); - expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0", error="boom"'); - expect(err.output.payload.attributes).to.deep.equal({ a: 1, b: 'something', c: '', d: 0, error: 'boom' }); - done(); - }); - - it('returns a WWW-Authenticate header when passed attributes, missing error', function (done) { - - var err = Boom.unauthorized(null, 'Test', { a: 1, b: 'something', c: null, d: 0 }); - expect(err.output.statusCode).to.equal(401); - expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0"'); - expect(err.isMissing).to.equal(true); - done(); - }); - - it('sets the isMissing flag when error message is empty', function (done) { - - var err = Boom.unauthorized('', 'Basic'); - expect(err.isMissing).to.equal(true); - done(); - }); - - it('does not set the isMissing flag when error message is not empty', function (done) { - - var err = Boom.unauthorized('message', 'Basic'); - expect(err.isMissing).to.equal(undefined); - done(); - }); - - it('sets a WWW-Authenticate when passed as an array', function (done) { - - var err = Boom.unauthorized('message', ['Basic', 'Example e="1"', 'Another x="3", y="4"']); - expect(err.output.headers['WWW-Authenticate']).to.equal('Basic, Example e="1", Another x="3", y="4"'); - done(); - }); -}); - - -describe('methodNotAllowed()', function () { - - it('returns a 405 error statusCode', function (done) { - - expect(Boom.methodNotAllowed().output.statusCode).to.equal(405); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.methodNotAllowed('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('notAcceptable()', function () { - - it('returns a 406 error statusCode', function (done) { - - expect(Boom.notAcceptable().output.statusCode).to.equal(406); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.notAcceptable('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('proxyAuthRequired()', function () { - - it('returns a 407 error statusCode', function (done) { - - expect(Boom.proxyAuthRequired().output.statusCode).to.equal(407); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.proxyAuthRequired('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('clientTimeout()', function () { - - it('returns a 408 error statusCode', function (done) { - - expect(Boom.clientTimeout().output.statusCode).to.equal(408); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.clientTimeout('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('conflict()', function () { - - it('returns a 409 error statusCode', function (done) { - - expect(Boom.conflict().output.statusCode).to.equal(409); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.conflict('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('resourceGone()', function () { - - it('returns a 410 error statusCode', function (done) { - - expect(Boom.resourceGone().output.statusCode).to.equal(410); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.resourceGone('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('lengthRequired()', function () { - - it('returns a 411 error statusCode', function (done) { - - expect(Boom.lengthRequired().output.statusCode).to.equal(411); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.lengthRequired('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('preconditionFailed()', function () { - - it('returns a 412 error statusCode', function (done) { - - expect(Boom.preconditionFailed().output.statusCode).to.equal(412); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.preconditionFailed('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('entityTooLarge()', function () { - - it('returns a 413 error statusCode', function (done) { - - expect(Boom.entityTooLarge().output.statusCode).to.equal(413); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.entityTooLarge('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('uriTooLong()', function () { - - it('returns a 414 error statusCode', function (done) { - - expect(Boom.uriTooLong().output.statusCode).to.equal(414); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.uriTooLong('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('unsupportedMediaType()', function () { - - it('returns a 415 error statusCode', function (done) { - - expect(Boom.unsupportedMediaType().output.statusCode).to.equal(415); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.unsupportedMediaType('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('rangeNotSatisfiable()', function () { - - it('returns a 416 error statusCode', function (done) { - - expect(Boom.rangeNotSatisfiable().output.statusCode).to.equal(416); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.rangeNotSatisfiable('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('expectationFailed()', function () { - - it('returns a 417 error statusCode', function (done) { - - expect(Boom.expectationFailed().output.statusCode).to.equal(417); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.expectationFailed('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('badData()', function () { - - it('returns a 422 error statusCode', function (done) { - - expect(Boom.badData().output.statusCode).to.equal(422); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.badData('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('preconditionRequired()', function () { - - it('returns a 428 error statusCode', function (done) { - - expect(Boom.preconditionRequired().output.statusCode).to.equal(428); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.preconditionRequired('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('tooManyRequests()', function () { - - it('returns a 429 error statusCode', function (done) { - - expect(Boom.tooManyRequests().output.statusCode).to.equal(429); - done(); - }); - - it('sets the message with the passed-in message', function (done) { - - expect(Boom.tooManyRequests('my message').message).to.equal('my message'); - done(); - }); -}); - -describe('serverTimeout()', function () { - - it('returns a 503 error statusCode', function (done) { - - expect(Boom.serverTimeout().output.statusCode).to.equal(503); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.serverTimeout('my message').message).to.equal('my message'); - done(); - }); -}); - -describe('forbidden()', function () { - - it('returns a 403 error statusCode', function (done) { - - expect(Boom.forbidden().output.statusCode).to.equal(403); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.forbidden('my message').message).to.equal('my message'); - done(); - }); -}); - -describe('notFound()', function () { - - it('returns a 404 error statusCode', function (done) { - - expect(Boom.notFound().output.statusCode).to.equal(404); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.notFound('my message').message).to.equal('my message'); - done(); - }); -}); - -describe('internal()', function () { - - it('returns a 500 error statusCode', function (done) { - - expect(Boom.internal().output.statusCode).to.equal(500); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - var err = Boom.internal('my message'); - expect(err.message).to.equal('my message'); - expect(err.isServer).to.true(); - expect(err.output.payload.message).to.equal('An internal server error occurred'); - done(); - }); - - it('passes data on the callback if its passed in', function (done) { - - expect(Boom.internal('my message', { my: 'data' }).data.my).to.equal('data'); - done(); - }); - - it('returns an error with composite message', function (done) { - - try { - JSON.parse('{'); - } - catch (err) { - var boom = Boom.internal('Someting bad', err); - expect(boom.message).to.equal('Someting bad: Unexpected end of input'); - expect(boom.isServer).to.be.true(); - done(); - } - }); -}); - -describe('notImplemented()', function () { - - it('returns a 501 error statusCode', function (done) { - - expect(Boom.notImplemented().output.statusCode).to.equal(501); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.notImplemented('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('badGateway()', function () { - - it('returns a 502 error statusCode', function (done) { - - expect(Boom.badGateway().output.statusCode).to.equal(502); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.badGateway('my message').message).to.equal('my message'); - done(); - }); -}); - -describe('gatewayTimeout()', function () { - - it('returns a 504 error statusCode', function (done) { - - expect(Boom.gatewayTimeout().output.statusCode).to.equal(504); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.gatewayTimeout('my message').message).to.equal('my message'); - done(); - }); -}); - -describe('badImplementation()', function () { - - it('returns a 500 error statusCode', function (done) { - - var err = Boom.badImplementation(); - expect(err.output.statusCode).to.equal(500); - expect(err.isDeveloperError).to.equal(true); - expect(err.isServer).to.be.true(); - done(); - }); -}); - -describe('stack trace', function () { - - it('should omit lib', function (done) { - - ['badRequest', 'unauthorized', 'forbidden', 'notFound', 'methodNotAllowed', - 'notAcceptable', 'proxyAuthRequired', 'clientTimeout', 'conflict', - 'resourceGone', 'lengthRequired', 'preconditionFailed', 'entityTooLarge', - 'uriTooLong', 'unsupportedMediaType', 'rangeNotSatisfiable', 'expectationFailed', - 'badData', 'preconditionRequired', 'tooManyRequests', - - // 500s - 'internal', 'notImplemented', 'badGateway', 'serverTimeout', 'gatewayTimeout', - 'badImplementation' - ].forEach(function (name) { - - var err = Boom[name](); - expect(err.stack).to.not.match(/\/lib\/index\.js/); - }); - - done(); - }); -}); diff --git a/node_modules/caseless/index.js b/node_modules/caseless/index.js index d86a70e..b194734 100644 --- a/node_modules/caseless/index.js +++ b/node_modules/caseless/index.js @@ -36,6 +36,7 @@ Caseless.prototype.get = function (name) { } Caseless.prototype.swap = function (name) { var has = this.has(name) + if (has === name) return if (!has) throw new Error('There is no header than matches "'+name+'"') this.dict[name] = this.dict[has] delete this.dict[has] diff --git a/node_modules/caseless/package.json b/node_modules/caseless/package.json index cfed067..edaa276 100644 --- a/node_modules/caseless/package.json +++ b/node_modules/caseless/package.json @@ -1,46 +1,27 @@ { - "_args": [ - [ - { - "raw": "caseless@~0.11.0", - "scope": null, - "escapedName": "caseless", - "name": "caseless", - "rawSpec": "~0.11.0", - "spec": ">=0.11.0 <0.12.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/request" - ] - ], - "_from": "caseless@>=0.11.0 <0.12.0", - "_id": "caseless@0.11.0", - "_inCache": true, + "_from": "caseless@~0.12.0", + "_id": "caseless@0.12.0", + "_inBundle": false, + "_integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "_location": "/caseless", - "_nodeVersion": "1.8.1", - "_npmUser": { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, - "_npmVersion": "2.8.3", "_phantomChildren": {}, "_requested": { - "raw": "caseless@~0.11.0", - "scope": null, - "escapedName": "caseless", + "type": "range", + "registry": true, + "raw": "caseless@~0.12.0", "name": "caseless", - "rawSpec": "~0.11.0", - "spec": ">=0.11.0 <0.12.0", - "type": "range" + "escapedName": "caseless", + "rawSpec": "~0.12.0", + "saveSpec": null, + "fetchSpec": "~0.12.0" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "_shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", - "_shrinkwrap": null, - "_spec": "caseless@~0.11.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/request", + "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "_shasum": "1b681c21ff84033c826543090689420d187151dc", + "_spec": "caseless@~0.12.0", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/request", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com" @@ -48,17 +29,12 @@ "bugs": { "url": "https://github.com/mikeal/caseless/issues" }, - "dependencies": {}, + "bundleDependencies": false, + "deprecated": false, "description": "Caseless object set/get/has, very useful when working with HTTP headers.", "devDependencies": { "tape": "^2.10.2" }, - "directories": {}, - "dist": { - "shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", - "tarball": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" - }, - "gitHead": "c578232a02cc2b46b6da8851caf57fdbfac89ff5", "homepage": "https://github.com/mikeal/caseless#readme", "keywords": [ "headers", @@ -67,23 +43,7 @@ ], "license": "Apache-2.0", "main": "index.js", - "maintainers": [ - { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, - { - "name": "nylen", - "email": "jnylen@gmail.com" - }, - { - "name": "simov", - "email": "simeonvelichkov@gmail.com" - } - ], "name": "caseless", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/mikeal/caseless.git" @@ -92,5 +52,5 @@ "test": "node test.js" }, "test": "node test.js", - "version": "0.11.0" + "version": "0.12.0" } diff --git a/node_modules/caseless/test.js b/node_modules/caseless/test.js index 084bbaf..f55196c 100644 --- a/node_modules/caseless/test.js +++ b/node_modules/caseless/test.js @@ -38,3 +38,30 @@ tape('set get has', function (t) { t.equal(c.get('tva'), 'test1') }) + +tape('swap', function (t) { + var headers = {} + , c = caseless(headers) + ; + t.plan(4) + // No Header to Swap. + t.throws(function () { + c.swap('content-type') + }) + // Set Header. + c.set('content-type', 'application/json') + // Swap Header With Itself. + c.swap('content-type') + // Does Not Delete Itself. + t.ok(c.has('content-type')) + // Swap Header With a Different Header. + c.swap('Content-Type') + // Still Has Header. + t.ok(c.has('Content-Type')) + // Delete Header. + c.del('Content-Type') + // No Header to Swap. + t.throws(function () { + c.swap('content-type') + }) +}) diff --git a/node_modules/chalk/index.js b/node_modules/chalk/index.js deleted file mode 100644 index 2d85a91..0000000 --- a/node_modules/chalk/index.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; -var escapeStringRegexp = require('escape-string-regexp'); -var ansiStyles = require('ansi-styles'); -var stripAnsi = require('strip-ansi'); -var hasAnsi = require('has-ansi'); -var supportsColor = require('supports-color'); -var defineProps = Object.defineProperties; -var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); - -function Chalk(options) { - // detect mode if not set manually - this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; -} - -// use bright blue on Windows as the normal blue color is illegible -if (isSimpleWindowsTerm) { - ansiStyles.blue.open = '\u001b[94m'; -} - -var styles = (function () { - var ret = {}; - - Object.keys(ansiStyles).forEach(function (key) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); - - ret[key] = { - get: function () { - return build.call(this, this._styles.concat(key)); - } - }; - }); - - return ret; -})(); - -var proto = defineProps(function chalk() {}, styles); - -function build(_styles) { - var builder = function () { - return applyStyle.apply(builder, arguments); - }; - - builder._styles = _styles; - builder.enabled = this.enabled; - // __proto__ is used because we must return a function, but there is - // no way to create a function with a different prototype. - /* eslint-disable no-proto */ - builder.__proto__ = proto; - - return builder; -} - -function applyStyle() { - // support varags, but simply cast to string in case there's only one arg - var args = arguments; - var argsLen = args.length; - var str = argsLen !== 0 && String(arguments[0]); - - if (argsLen > 1) { - // don't slice `arguments`, it prevents v8 optimizations - for (var a = 1; a < argsLen; a++) { - str += ' ' + args[a]; - } - } - - if (!this.enabled || !str) { - return str; - } - - var nestedStyles = this._styles; - var i = nestedStyles.length; - - // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, - // see https://github.com/chalk/chalk/issues/58 - // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. - var originalDim = ansiStyles.dim.open; - if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { - ansiStyles.dim.open = ''; - } - - while (i--) { - var code = ansiStyles[nestedStyles[i]]; - - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - str = code.open + str.replace(code.closeRe, code.open) + code.close; - } - - // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. - ansiStyles.dim.open = originalDim; - - return str; -} - -function init() { - var ret = {}; - - Object.keys(styles).forEach(function (name) { - ret[name] = { - get: function () { - return build.call(this, [name]); - } - }; - }); - - return ret; -} - -defineProps(Chalk.prototype, init()); - -module.exports = new Chalk(); -module.exports.styles = ansiStyles; -module.exports.hasColor = hasAnsi; -module.exports.stripColor = stripAnsi; -module.exports.supportsColor = supportsColor; diff --git a/node_modules/chalk/license b/node_modules/chalk/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/chalk/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json deleted file mode 100644 index 541d291..0000000 --- a/node_modules/chalk/package.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "chalk@^1.1.1", - "scope": null, - "escapedName": "chalk", - "name": "chalk", - "rawSpec": "^1.1.1", - "spec": ">=1.1.1 <2.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/har-validator" - ] - ], - "_from": "chalk@>=1.1.1 <2.0.0", - "_id": "chalk@1.1.3", - "_inCache": true, - "_location": "/chalk", - "_nodeVersion": "0.10.32", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/chalk-1.1.3.tgz_1459210604109_0.3892582862172276" - }, - "_npmUser": { - "name": "qix", - "email": "i.am.qix@gmail.com" - }, - "_npmVersion": "2.14.2", - "_phantomChildren": {}, - "_requested": { - "raw": "chalk@^1.1.1", - "scope": null, - "escapedName": "chalk", - "name": "chalk", - "rawSpec": "^1.1.1", - "spec": ">=1.1.1 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/har-validator" - ], - "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "_shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", - "_shrinkwrap": null, - "_spec": "chalk@^1.1.1", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/har-validator", - "bugs": { - "url": "https://github.com/chalk/chalk/issues" - }, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "description": "Terminal string styling done right. Much color.", - "devDependencies": { - "coveralls": "^2.11.2", - "matcha": "^0.6.0", - "mocha": "*", - "nyc": "^3.0.0", - "require-uncached": "^1.0.2", - "resolve-from": "^1.0.0", - "semver": "^4.3.3", - "xo": "*" - }, - "directories": {}, - "dist": { - "shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", - "tarball": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "gitHead": "0d8d8c204eb87a4038219131ad4d8369c9f59d24", - "homepage": "https://github.com/chalk/chalk#readme", - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "maintainers": [ - { - "name": "qix", - "email": "i.am.qix@gmail.com" - }, - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "unicorn", - "email": "sindresorhus+unicorn@gmail.com" - } - ], - "name": "chalk", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/chalk.git" - }, - "scripts": { - "bench": "matcha benchmark.js", - "coverage": "nyc npm test && nyc report", - "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls", - "test": "xo && mocha" - }, - "version": "1.1.3", - "xo": { - "envs": [ - "node", - "mocha" - ] - } -} diff --git a/node_modules/chalk/readme.md b/node_modules/chalk/readme.md deleted file mode 100644 index 5cf111e..0000000 --- a/node_modules/chalk/readme.md +++ /dev/null @@ -1,213 +0,0 @@ -

-
-
- chalk -
-
-
-

- -> Terminal string styling done right - -[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) -[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master) -[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) - - -[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. - -**Chalk is a clean and focused alternative.** - -![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png) - - -## Why - -- Highly performant -- Doesn't extend `String.prototype` -- Expressive API -- Ability to nest styles -- Clean and focused -- Auto-detects color support -- Actively maintained -- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015 - - -## Install - -``` -$ npm install --save chalk -``` - - -## Usage - -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. - -```js -var chalk = require('chalk'); - -// style a string -chalk.blue('Hello world!'); - -// combine styled and normal strings -chalk.blue('Hello') + 'World' + chalk.red('!'); - -// compose multiple styles using the chainable API -chalk.blue.bgRed.bold('Hello world!'); - -// pass in multiple arguments -chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'); - -// nest styles -chalk.red('Hello', chalk.underline.bgBlue('world') + '!'); - -// nest styles of the same type even (color, underline, background) -chalk.green( - 'I am a green line ' + - chalk.blue.underline.bold('with a blue substring') + - ' that becomes green again!' -); -``` - -Easily define your own themes. - -```js -var chalk = require('chalk'); -var error = chalk.bold.red; -console.log(error('Error!')); -``` - -Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). - -```js -var name = 'Sindre'; -console.log(chalk.green('Hello %s'), name); -//=> Hello Sindre -``` - - -## API - -### chalk.` diff --git a/node_modules/ejs/test/fixtures/include.css.html b/node_modules/ejs/test/fixtures/include.css.html deleted file mode 100644 index 9e6e33e..0000000 --- a/node_modules/ejs/test/fixtures/include.css.html +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/include.ejs b/node_modules/ejs/test/fixtures/include.ejs deleted file mode 100644 index f2295ee..0000000 --- a/node_modules/ejs/test/fixtures/include.ejs +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/include.html b/node_modules/ejs/test/fixtures/include.html deleted file mode 100644 index 5431d7c..0000000 --- a/node_modules/ejs/test/fixtures/include.html +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/include_cache.ejs b/node_modules/ejs/test/fixtures/include_cache.ejs deleted file mode 100644 index 439193c..0000000 --- a/node_modules/ejs/test/fixtures/include_cache.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- include('../tmp/include') %> diff --git a/node_modules/ejs/test/fixtures/include_cache.html b/node_modules/ejs/test/fixtures/include_cache.html deleted file mode 100644 index 63bf29c..0000000 --- a/node_modules/ejs/test/fixtures/include_cache.html +++ /dev/null @@ -1 +0,0 @@ -

Old

diff --git a/node_modules/ejs/test/fixtures/include_preprocessor.css.ejs b/node_modules/ejs/test/fixtures/include_preprocessor.css.ejs deleted file mode 100644 index 2535b6c..0000000 --- a/node_modules/ejs/test/fixtures/include_preprocessor.css.ejs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/include_preprocessor.css.html b/node_modules/ejs/test/fixtures/include_preprocessor.css.html deleted file mode 100644 index 9e6e33e..0000000 --- a/node_modules/ejs/test/fixtures/include_preprocessor.css.html +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/include_preprocessor.ejs b/node_modules/ejs/test/fixtures/include_preprocessor.ejs deleted file mode 100644 index f2728c5..0000000 --- a/node_modules/ejs/test/fixtures/include_preprocessor.ejs +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/include_preprocessor.html b/node_modules/ejs/test/fixtures/include_preprocessor.html deleted file mode 100644 index 5431d7c..0000000 --- a/node_modules/ejs/test/fixtures/include_preprocessor.html +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/include_preprocessor_cache.ejs b/node_modules/ejs/test/fixtures/include_preprocessor_cache.ejs deleted file mode 100644 index ae60923..0000000 --- a/node_modules/ejs/test/fixtures/include_preprocessor_cache.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- include ../tmp/include_preprocessor %> diff --git a/node_modules/ejs/test/fixtures/include_preprocessor_cache.html b/node_modules/ejs/test/fixtures/include_preprocessor_cache.html deleted file mode 100644 index 63bf29c..0000000 --- a/node_modules/ejs/test/fixtures/include_preprocessor_cache.html +++ /dev/null @@ -1 +0,0 @@ -

Old

diff --git a/node_modules/ejs/test/fixtures/include_preprocessor_line_slurp.ejs b/node_modules/ejs/test/fixtures/include_preprocessor_line_slurp.ejs deleted file mode 100644 index fd1765c..0000000 --- a/node_modules/ejs/test/fixtures/include_preprocessor_line_slurp.ejs +++ /dev/null @@ -1 +0,0 @@ -<% include include_preprocessor_line_slurp_child %> \ No newline at end of file diff --git a/node_modules/ejs/test/fixtures/include_preprocessor_line_slurp.html b/node_modules/ejs/test/fixtures/include_preprocessor_line_slurp.html deleted file mode 100644 index 7ab7998..0000000 --- a/node_modules/ejs/test/fixtures/include_preprocessor_line_slurp.html +++ /dev/null @@ -1,5 +0,0 @@ -
-12 -3 -45 -
\ No newline at end of file diff --git a/node_modules/ejs/test/fixtures/include_preprocessor_line_slurp_child.ejs b/node_modules/ejs/test/fixtures/include_preprocessor_line_slurp_child.ejs deleted file mode 100644 index 1c4a7c6..0000000 --- a/node_modules/ejs/test/fixtures/include_preprocessor_line_slurp_child.ejs +++ /dev/null @@ -1,5 +0,0 @@ -
-1 <%_ if (true) { _%> 2 - 3 -4 <%_ } _%> 5 -
\ No newline at end of file diff --git a/node_modules/ejs/test/fixtures/includes/bom.ejs b/node_modules/ejs/test/fixtures/includes/bom.ejs deleted file mode 100644 index cc198ba..0000000 --- a/node_modules/ejs/test/fixtures/includes/bom.ejs +++ /dev/null @@ -1 +0,0 @@ -

This is a file with BOM.

diff --git a/node_modules/ejs/test/fixtures/includes/menu-item.ejs b/node_modules/ejs/test/fixtures/includes/menu-item.ejs deleted file mode 100644 index 5a1e2ef..0000000 --- a/node_modules/ejs/test/fixtures/includes/menu-item.ejs +++ /dev/null @@ -1 +0,0 @@ -
  • <% include menu/item %>
  • diff --git a/node_modules/ejs/test/fixtures/includes/menu/item.ejs b/node_modules/ejs/test/fixtures/includes/menu/item.ejs deleted file mode 100644 index cd85b3d..0000000 --- a/node_modules/ejs/test/fixtures/includes/menu/item.ejs +++ /dev/null @@ -1 +0,0 @@ -<%= title %> diff --git a/node_modules/ejs/test/fixtures/literal.ejs b/node_modules/ejs/test/fixtures/literal.ejs deleted file mode 100644 index 9f6bf81..0000000 --- a/node_modules/ejs/test/fixtures/literal.ejs +++ /dev/null @@ -1,3 +0,0 @@ -
    There should be a space followed by a less-than sign and then two more
    -spaces in the next line:
    - <   .
    diff --git a/node_modules/ejs/test/fixtures/literal.html b/node_modules/ejs/test/fixtures/literal.html deleted file mode 100644 index 95acd44..0000000 --- a/node_modules/ejs/test/fixtures/literal.html +++ /dev/null @@ -1,3 +0,0 @@ -
    There should be a space followed by a less-than sign and then two more
    -spaces in the next line:
    - <  .
    diff --git a/node_modules/ejs/test/fixtures/menu.ejs b/node_modules/ejs/test/fixtures/menu.ejs deleted file mode 100644 index 0309990..0000000 --- a/node_modules/ejs/test/fixtures/menu.ejs +++ /dev/null @@ -1,15 +0,0 @@ -<%- include('includes/menu-item', { - url: '/foo' -, title: 'Foo' -}); -%> - -<%- include('includes/menu-item', { - url: '/bar' -, title: 'Bar' -}); -%> - -<%- include('includes/menu-item', { - url: '/baz' -, title: 'Baz' -}); -%> - diff --git a/node_modules/ejs/test/fixtures/menu.html b/node_modules/ejs/test/fixtures/menu.html deleted file mode 100644 index eef5777..0000000 --- a/node_modules/ejs/test/fixtures/menu.html +++ /dev/null @@ -1,9 +0,0 @@ -
  • Foo -
  • - -
  • Bar -
  • - -
  • Baz -
  • - diff --git a/node_modules/ejs/test/fixtures/menu_preprocessor.ejs b/node_modules/ejs/test/fixtures/menu_preprocessor.ejs deleted file mode 100644 index cca1d02..0000000 --- a/node_modules/ejs/test/fixtures/menu_preprocessor.ejs +++ /dev/null @@ -1,11 +0,0 @@ -<% var url = '/foo' -%> -<% var title = 'Foo' -%> -<% include includes/menu-item -%> - -<% var url = '/bar' -%> -<% var title = 'Bar' -%> -<% include includes/menu-item -%> - -<% var url = '/baz' -%> -<% var title = 'Baz' -%> -<% include includes/menu-item -%> diff --git a/node_modules/ejs/test/fixtures/menu_preprocessor.html b/node_modules/ejs/test/fixtures/menu_preprocessor.html deleted file mode 100644 index 651b60e..0000000 --- a/node_modules/ejs/test/fixtures/menu_preprocessor.html +++ /dev/null @@ -1,8 +0,0 @@ -
  • Foo -
  • - -
  • Bar -
  • - -
  • Baz -
  • diff --git a/node_modules/ejs/test/fixtures/menu_var.ejs b/node_modules/ejs/test/fixtures/menu_var.ejs deleted file mode 100644 index a421dcb..0000000 --- a/node_modules/ejs/test/fixtures/menu_var.ejs +++ /dev/null @@ -1,15 +0,0 @@ -<%- include(varPath, { - url: '/foo' -, title: 'Foo' -}); -%> - -<%- include(varPath, { - url: '/bar' -, title: 'Bar' -}); -%> - -<%- include(varPath, { - url: '/baz' -, title: 'Baz' -}); -%> - diff --git a/node_modules/ejs/test/fixtures/messed.ejs b/node_modules/ejs/test/fixtures/messed.ejs deleted file mode 100644 index 37aca11..0000000 --- a/node_modules/ejs/test/fixtures/messed.ejs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/messed.html b/node_modules/ejs/test/fixtures/messed.html deleted file mode 100644 index 52d3562..0000000 --- a/node_modules/ejs/test/fixtures/messed.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/newlines.ejs b/node_modules/ejs/test/fixtures/newlines.ejs deleted file mode 100644 index 83ffe98..0000000 --- a/node_modules/ejs/test/fixtures/newlines.ejs +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/newlines.html b/node_modules/ejs/test/fixtures/newlines.html deleted file mode 100644 index 4557edb..0000000 --- a/node_modules/ejs/test/fixtures/newlines.html +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/newlines.mixed.ejs b/node_modules/ejs/test/fixtures/newlines.mixed.ejs deleted file mode 100644 index 5895057..0000000 --- a/node_modules/ejs/test/fixtures/newlines.mixed.ejs +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/newlines.mixed.html b/node_modules/ejs/test/fixtures/newlines.mixed.html deleted file mode 100644 index cd88a97..0000000 --- a/node_modules/ejs/test/fixtures/newlines.mixed.html +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/no.newlines.ejs b/node_modules/ejs/test/fixtures/no.newlines.ejs deleted file mode 100644 index c7a6dc9..0000000 --- a/node_modules/ejs/test/fixtures/no.newlines.ejs +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/no.newlines.error.ejs b/node_modules/ejs/test/fixtures/no.newlines.error.ejs deleted file mode 100644 index bf1d71e..0000000 --- a/node_modules/ejs/test/fixtures/no.newlines.error.ejs +++ /dev/null @@ -1,5 +0,0 @@ -AAA -<% var data = "test"; -%> -BBB -<%= qdata %> -CCC diff --git a/node_modules/ejs/test/fixtures/no.newlines.html b/node_modules/ejs/test/fixtures/no.newlines.html deleted file mode 100644 index 2285700..0000000 --- a/node_modules/ejs/test/fixtures/no.newlines.html +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/node_modules/ejs/test/fixtures/no.semicolons.ejs b/node_modules/ejs/test/fixtures/no.semicolons.ejs deleted file mode 100644 index d583134..0000000 --- a/node_modules/ejs/test/fixtures/no.semicolons.ejs +++ /dev/null @@ -1,8 +0,0 @@ -This document does not use semicolons in scriptlets. -<% - var a = 'b' - var b = 'c' - var c - c = b -%> -The value of c is: <%= c %> diff --git a/node_modules/ejs/test/fixtures/no.semicolons.html b/node_modules/ejs/test/fixtures/no.semicolons.html deleted file mode 100644 index 524f8c6..0000000 --- a/node_modules/ejs/test/fixtures/no.semicolons.html +++ /dev/null @@ -1,3 +0,0 @@ -This document does not use semicolons in scriptlets. - -The value of c is: c diff --git a/node_modules/ejs/test/fixtures/para.ejs b/node_modules/ejs/test/fixtures/para.ejs deleted file mode 100644 index 28f5df8..0000000 --- a/node_modules/ejs/test/fixtures/para.ejs +++ /dev/null @@ -1 +0,0 @@ -

    hey

    diff --git a/node_modules/ejs/test/fixtures/pet.ejs b/node_modules/ejs/test/fixtures/pet.ejs deleted file mode 100644 index 09dd230..0000000 --- a/node_modules/ejs/test/fixtures/pet.ejs +++ /dev/null @@ -1 +0,0 @@ -
  • <@= pet.name @>
  • diff --git a/node_modules/ejs/test/fixtures/rmWhitespace.ejs b/node_modules/ejs/test/fixtures/rmWhitespace.ejs deleted file mode 100644 index 5da0d89..0000000 --- a/node_modules/ejs/test/fixtures/rmWhitespace.ejs +++ /dev/null @@ -1,14 +0,0 @@ - - -A very long piece of text very long piece of text very long piece of -text very long piece <% var f = 'f' %>of text very long piece of -tex t very long piece of<% %>text very long -adsffadsfadsfad<%= f %> - -piece of text. -<% var a = 'a' %> -Text again. -<% var b = 'b' %> -<% var c = 'c' -var d = 'd' %> -Another text. <%= c %> diff --git a/node_modules/ejs/test/fixtures/rmWhitespace.html b/node_modules/ejs/test/fixtures/rmWhitespace.html deleted file mode 100644 index 4beb5fa..0000000 --- a/node_modules/ejs/test/fixtures/rmWhitespace.html +++ /dev/null @@ -1,8 +0,0 @@ - - -A very long piece of text very long piece of text very long piece of -text very long piece of text very long piece of -text very long piece oftext very long -adsffadsfadsfadfpiece of text. -Text again. -Another text. c \ No newline at end of file diff --git a/node_modules/ejs/test/fixtures/single-quote.ejs b/node_modules/ejs/test/fixtures/single-quote.ejs deleted file mode 100644 index b520c84..0000000 --- a/node_modules/ejs/test/fixtures/single-quote.ejs +++ /dev/null @@ -1 +0,0 @@ -

    <%= 'loki' %>'s wheelchair

    diff --git a/node_modules/ejs/test/fixtures/single-quote.html b/node_modules/ejs/test/fixtures/single-quote.html deleted file mode 100644 index d642750..0000000 --- a/node_modules/ejs/test/fixtures/single-quote.html +++ /dev/null @@ -1 +0,0 @@ -

    loki's wheelchair

    diff --git a/node_modules/ejs/test/fixtures/space-and-tab-slurp.ejs b/node_modules/ejs/test/fixtures/space-and-tab-slurp.ejs deleted file mode 100644 index 7622457..0000000 --- a/node_modules/ejs/test/fixtures/space-and-tab-slurp.ejs +++ /dev/null @@ -1,5 +0,0 @@ -
      - <%_ users.forEach(function(user){ _%> -
    • <%= user.name %>
    • - <%_ }) _%> -
    diff --git a/node_modules/ejs/test/fixtures/space-and-tab-slurp.html b/node_modules/ejs/test/fixtures/space-and-tab-slurp.html deleted file mode 100644 index cfb6582..0000000 --- a/node_modules/ejs/test/fixtures/space-and-tab-slurp.html +++ /dev/null @@ -1,5 +0,0 @@ -
      -
    • geddy
    • -
    • neil
    • -
    • alex
    • -
    diff --git a/node_modules/ejs/test/fixtures/strict.ejs b/node_modules/ejs/test/fixtures/strict.ejs deleted file mode 100644 index 408ebcf..0000000 --- a/node_modules/ejs/test/fixtures/strict.ejs +++ /dev/null @@ -1,5 +0,0 @@ -<% -// Unspecified execution context should be `undefined` in strict mode -var isReallyStrict = !((function () { return this; })()) --%> -<%= isReallyStrict -%> diff --git a/node_modules/ejs/test/fixtures/style.css b/node_modules/ejs/test/fixtures/style.css deleted file mode 100644 index f9c16e6..0000000 --- a/node_modules/ejs/test/fixtures/style.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - foo: '<%= value %>'; -} diff --git a/node_modules/ejs/test/fixtures/user-no-with.ejs b/node_modules/ejs/test/fixtures/user-no-with.ejs deleted file mode 100644 index 1822e24..0000000 --- a/node_modules/ejs/test/fixtures/user-no-with.ejs +++ /dev/null @@ -1 +0,0 @@ -

    <$= locals.name $>

    diff --git a/node_modules/ejs/test/fixtures/user.ejs b/node_modules/ejs/test/fixtures/user.ejs deleted file mode 100644 index 66f9adc..0000000 --- a/node_modules/ejs/test/fixtures/user.ejs +++ /dev/null @@ -1 +0,0 @@ -

    <$= name $>

    diff --git a/node_modules/ejs/test/fixtures/with-context.ejs b/node_modules/ejs/test/fixtures/with-context.ejs deleted file mode 100644 index 412a9be..0000000 --- a/node_modules/ejs/test/fixtures/with-context.ejs +++ /dev/null @@ -1 +0,0 @@ -<%= this.foo %> diff --git a/node_modules/ejs/test/mocha.opts b/node_modules/ejs/test/mocha.opts deleted file mode 100644 index e30264f..0000000 --- a/node_modules/ejs/test/mocha.opts +++ /dev/null @@ -1,3 +0,0 @@ ---ui tdd ---reporter spec ---check-leaks diff --git a/node_modules/ejs/test/tmp/include.ejs b/node_modules/ejs/test/tmp/include.ejs deleted file mode 100644 index 595b6c0..0000000 --- a/node_modules/ejs/test/tmp/include.ejs +++ /dev/null @@ -1 +0,0 @@ -

    New

    \ No newline at end of file diff --git a/node_modules/ejs/test/tmp/include_preprocessor.ejs b/node_modules/ejs/test/tmp/include_preprocessor.ejs deleted file mode 100644 index 595b6c0..0000000 --- a/node_modules/ejs/test/tmp/include_preprocessor.ejs +++ /dev/null @@ -1 +0,0 @@ -

    New

    \ No newline at end of file diff --git a/node_modules/ejs/test/tmp/renderFile.ejs b/node_modules/ejs/test/tmp/renderFile.ejs deleted file mode 100644 index 595b6c0..0000000 --- a/node_modules/ejs/test/tmp/renderFile.ejs +++ /dev/null @@ -1 +0,0 @@ -

    New

    \ No newline at end of file diff --git a/node_modules/escape-string-regexp/index.js b/node_modules/escape-string-regexp/index.js deleted file mode 100644 index 7834bf9..0000000 --- a/node_modules/escape-string-regexp/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; - -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(matchOperatorsRe, '\\$&'); -}; diff --git a/node_modules/escape-string-regexp/license b/node_modules/escape-string-regexp/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/escape-string-regexp/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/escape-string-regexp/package.json b/node_modules/escape-string-regexp/package.json deleted file mode 100644 index c9d8fb4..0000000 --- a/node_modules/escape-string-regexp/package.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "escape-string-regexp@^1.0.2", - "scope": null, - "escapedName": "escape-string-regexp", - "name": "escape-string-regexp", - "rawSpec": "^1.0.2", - "spec": ">=1.0.2 <2.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/chalk" - ] - ], - "_from": "escape-string-regexp@>=1.0.2 <2.0.0", - "_id": "escape-string-regexp@1.0.5", - "_inCache": true, - "_location": "/escape-string-regexp", - "_nodeVersion": "4.2.6", - "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/escape-string-regexp-1.0.5.tgz_1456059312074_0.7245344955008477" - }, - "_npmUser": { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - }, - "_npmVersion": "2.14.12", - "_phantomChildren": {}, - "_requested": { - "raw": "escape-string-regexp@^1.0.2", - "scope": null, - "escapedName": "escape-string-regexp", - "name": "escape-string-regexp", - "rawSpec": "^1.0.2", - "spec": ">=1.0.2 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/chalk" - ], - "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", - "_shrinkwrap": null, - "_spec": "escape-string-regexp@^1.0.2", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/chalk", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/escape-string-regexp/issues" - }, - "dependencies": {}, - "description": "Escape RegExp special characters", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "directories": {}, - "dist": { - "shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", - "tarball": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" - }, - "engines": { - "node": ">=0.8.0" - }, - "files": [ - "index.js" - ], - "gitHead": "db124a3e1aae9d692c4899e42a5c6c3e329eaa20", - "homepage": "https://github.com/sindresorhus/escape-string-regexp", - "keywords": [ - "escape", - "regex", - "regexp", - "re", - "regular", - "expression", - "string", - "str", - "special", - "characters" - ], - "license": "MIT", - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "name": "escape-string-regexp", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/escape-string-regexp.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.5" -} diff --git a/node_modules/escape-string-regexp/readme.md b/node_modules/escape-string-regexp/readme.md deleted file mode 100644 index 87ac82d..0000000 --- a/node_modules/escape-string-regexp/readme.md +++ /dev/null @@ -1,27 +0,0 @@ -# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) - -> Escape RegExp special characters - - -## Install - -``` -$ npm install --save escape-string-regexp -``` - - -## Usage - -```js -const escapeStringRegexp = require('escape-string-regexp'); - -const escapedString = escapeStringRegexp('how much $ for a unicorn?'); -//=> 'how much \$ for a unicorn\?' - -new RegExp(escapedString); -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/extend/.eslintrc b/node_modules/extend/.eslintrc index d49f173..90b3193 100644 --- a/node_modules/extend/.eslintrc +++ b/node_modules/extend/.eslintrc @@ -1,192 +1,17 @@ { - "env": { - "browser": false, - "node": true, - "amd": false, - "mocha": false, - "jasmine": false - }, + "root": true, + + "extends": "@ljharb", "rules": { - "accessor-pairs": [2, { getWithoutSet: false, setWithoutGet: true }], - "array-bracket-spacing": [2, "never", { - "singleValue": false, - "objectsInArrays": false, - "arraysInArrays": false - }], - "block-scoped-var": [0], - "brace-style": [2, "1tbs", { "allowSingleLine": true }], - "camelcase": [2], - "comma-dangle": [2, "never"], - "comma-spacing": [2], - "comma-style": [2, "last"], "complexity": [2, 15], - "computed-property-spacing": [2, "never"], - "consistent-return": [2], - "consistent-this": [0, "that"], - "constructor-super": [2], - "curly": [2, "all"], - "default-case": [2], - "dot-notation": [2, { "allowKeywords": true }], - "eol-last": [2], - "eqeqeq": [2], - "func-names": [0], - "func-style": [2, "expression"], - "generator-star-spacing": [2, { "before": false, "after": true }], - "global-strict": [0, "never"], - "guard-for-in": [0], - "handle-callback-err": [0], - "key-spacing": [2, { "beforeColon": false, "afterColon": true }], - "linebreak-style": [2, "unix"], - "lines-around-comment": [2, { - "beforeBlockComment": false, - "afterBlockComment": false, - "beforeLineComment": false, - "beforeLineComment": false, - "allowBlockStart": true, - "allowBlockEnd": true - }], - "quotes": [2, "single", "avoid-escape"], + "eqeqeq": [2, "allow-null"], + "func-name-matching": [1], "max-depth": [1, 4], - "max-len": [0, 80, 4], - "max-nested-callbacks": [2, 2], - "max-params": [2, 2], - "max-statements": [2, 21], - "new-parens": [2], - "new-cap": [2], - "newline-after-var": [0], - "no-alert": [2], - "no-array-constructor": [2], - "no-bitwise": [0], - "no-caller": [2], - "no-catch-shadow": [2], - "no-cond-assign": [2], - "no-console": [2], - "no-constant-condition": [2], - "no-continue": [2], - "no-control-regex": [2], - "no-debugger": [2], - "no-delete-var": [2], - "no-div-regex": [0], - "no-dupe-args": [2], - "no-dupe-keys": [2], - "no-duplicate-case": [2], - "no-else-return": [0], - "no-empty": [2], - "no-empty-character-class": [2], - "no-empty-label": [2], - "no-eq-null": [0], - "no-eval": [2], - "no-ex-assign": [2], - "no-extend-native": [2], - "no-extra-bind": [2], - "no-extra-boolean-cast": [2], - "no-extra-parens": [0], - "no-extra-semi": [2], - "no-fallthrough": [2], - "no-floating-decimal": [2], - "no-func-assign": [2], - "no-implied-eval": [2], - "no-inline-comments": [0], - "no-inner-declarations": [2, "functions"], - "no-invalid-regexp": [2], - "no-irregular-whitespace": [2], - "no-iterator": [2], - "no-label-var": [2], - "no-labels": [2], - "no-lone-blocks": [2], - "no-lonely-if": [2], - "no-loop-func": [2], - "no-mixed-requires": [0, false], - "no-mixed-spaces-and-tabs": [2, false], - "no-multi-spaces": [2], - "no-multi-str": [2], - "no-multiple-empty-lines": [2, {"max": 1}], - "no-native-reassign": [2], - "no-negated-in-lhs": [2], - "no-nested-ternary": [0], - "no-new": [2], - "no-new-func": [2], - "no-new-object": [2], - "no-new-require": [0], - "no-new-wrappers": [2], - "no-obj-calls": [2], - "no-octal": [2], - "no-octal-escape": [2], - "no-param-reassign": [2], - "no-path-concat": [0], - "no-plusplus": [0], - "no-process-env": [0], - "no-process-exit": [2], - "no-proto": [2], - "no-redeclare": [2], - "no-regex-spaces": [2], - "no-reserved-keys": [2], - "no-restricted-modules": [0], - "no-return-assign": [2, "always"], - "no-script-url": [2], - "no-self-compare": [0], - "no-sequences": [2], - "no-shadow": [2], - "no-shadow-restricted-names": [2], - "no-space-before-semi": [2], - "no-spaced-func": [2], - "no-sparse-arrays": [2], - "no-sync": [0], - "no-ternary": [0], - "no-this-before-super": [2], - "no-throw-literal": [2], - "no-trailing-spaces": [2, { "skipBlankLines": false }], - "no-undef": [2], - "no-undef-init": [2], - "no-undefined": [0], - "no-underscore-dangle": [2], - "no-unexpected-multiline": [2], - "no-unneeded-ternary": [2], - "no-unreachable": [2], - "no-unused-expressions": [2], - "no-unused-vars": [2, { "vars": "all", "args": "after-used" }], - "no-use-before-define": [2], - "no-void": [0], - "no-warning-comments": [0, { "terms": ["todo", "fixme", "xxx"], "location": "start" }], - "no-with": [2], - "no-wrap-func": [2], - "object-curly-spacing": [2, "always"], - "object-shorthand": [2, "never"], - "one-var": [0], - "operator-assignment": [0, "always"], - "operator-linebreak": [2, "none"], - "padded-blocks": [0], - "prefer-const": [0], - "quote-props": [0], - "radix": [0], - "semi": [2], - "semi-spacing": [2, { "before": false, "after": true }], - "sort-vars": [0], - "space-after-keywords": [2, "always"], - "space-before-function-paren": [2, { "anonymous": "always", "named": "never" }], - "space-before-blocks": [0, "always"], - "space-in-brackets": [0, "never", { - "singleValue": true, - "arraysInArrays": false, - "arraysInObjects": false, - "objectsInArrays": true, - "objectsInObjects": true, - "propertyName": false - }], - "space-in-parens": [2, "never"], - "space-infix-ops": [2], - "space-return-throw-case": [2], - "space-unary-ops": [2, { "words": true, "nonwords": false }], - "spaced-comment": [2, "always"], - "spaced-line-comment": [0, "always"], - "strict": [2, "global"], - "use-isnan": [2], - "valid-jsdoc": [0], - "valid-typeof": [2], - "vars-on-top": [0], - "wrap-iife": [2], - "wrap-regex": [2], - "yoda": [2, "never", { "exceptRange": true, "onlyEquality": false }] + "max-statements": [2, 26], + "no-extra-parens": [1], + "no-magic-numbers": [0], + "no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"], + "sort-keys": [0], } } diff --git a/node_modules/extend/.jscs.json b/node_modules/extend/.jscs.json index 7e84b28..0284c86 100644 --- a/node_modules/extend/.jscs.json +++ b/node_modules/extend/.jscs.json @@ -1,4 +1,6 @@ { + "es3": true, + "additionalRules": [], "requireSemicolons": true, @@ -7,12 +9,29 @@ "disallowIdentifierNames": [], - "requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"], + "requireCurlyBraces": { + "allExcept": [], + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] + }, "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], "disallowSpaceAfterKeywords": [], + "disallowSpaceBeforeComma": true, + "disallowSpaceAfterComma": false, + "disallowSpaceBeforeSemicolon": true, + + "disallowNodeTypes": [ + "DebuggerStatement", + "LabeledStatement", + "SwitchCase", + "SwitchStatement", + "WithStatement" + ], + + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, @@ -25,7 +44,7 @@ "disallowSpacesInsideArrayBrackets": true, - "disallowQuotedKeysInObjects": "allButReserved", + "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, "disallowSpaceAfterObjectKeys": true, @@ -60,7 +79,7 @@ "disallowMultipleLineStrings": true, - "requireDotNotation": true, + "requireDotNotation": { "allExcept": ["keywords"] }, "requireParenthesesAroundIIFE": true, @@ -99,6 +118,58 @@ "maximum": 6 }, - "requirePaddingNewLinesAfterUseStrict": true + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": false, + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + }, + + "requireImportAlphabetized": false, + + "requireSpaceBeforeObjectValues": true, + "requireSpaceBeforeDestructuredValues": true, + + "disallowSpacesInsideTemplateStringPlaceholders": true, + + "disallowArrayDestructuringReturn": false, + + "requireNewlineBeforeSingleStatementsInIf": false, + + "disallowUnusedVariables": true, + + "requireSpacesInsideImportedObjectBraces": true, + + "requireUseStrict": true } diff --git a/node_modules/extend/.travis.yml b/node_modules/extend/.travis.yml index ebef644..6bf696c 100644 --- a/node_modules/extend/.travis.yml +++ b/node_modules/extend/.travis.yml @@ -1,44 +1,179 @@ language: node_js +os: + - linux node_js: - - "iojs-v2.3" - - "iojs-v2.2" - - "iojs-v2.1" - - "iojs-v2.0" + - "7.9" + - "6.10" + - "5.12" + - "4.8" + - "iojs-v3.3" + - "iojs-v2.5" - "iojs-v1.8" - - "iojs-v1.7" - - "iojs-v1.6" - - "iojs-v1.5" - - "iojs-v1.4" - - "iojs-v1.3" - - "iojs-v1.2" - - "iojs-v1.1" - - "iojs-v1.0" - "0.12" - - "0.11" - "0.10" - - "0.9" - "0.8" - - "0.6" - - "0.4" before_install: - - '[ "${TRAVIS_NODE_VERSION}" = "0.6" ] || npm install -g npm@1.4.28 && npm install -g npm' + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' + - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' + - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' + - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' sudo: false +env: + - TEST=true matrix: fast_finish: true - allow_failures: + include: + - node_js: "node" + env: PRETEST=true + - node_js: "node" + env: COVERAGE=true + - node_js: "7.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.3" + env: TEST=true ALLOW_FAILURE=true - node_js: "iojs-v2.2" + env: TEST=true ALLOW_FAILURE=true - node_js: "iojs-v2.1" + env: TEST=true ALLOW_FAILURE=true - node_js: "iojs-v2.0" + env: TEST=true ALLOW_FAILURE=true - node_js: "iojs-v1.7" + env: TEST=true ALLOW_FAILURE=true - node_js: "iojs-v1.6" + env: TEST=true ALLOW_FAILURE=true - node_js: "iojs-v1.5" + env: TEST=true ALLOW_FAILURE=true - node_js: "iojs-v1.4" + env: TEST=true ALLOW_FAILURE=true - node_js: "iojs-v1.3" + env: TEST=true ALLOW_FAILURE=true - node_js: "iojs-v1.2" + env: TEST=true ALLOW_FAILURE=true - node_js: "iojs-v1.1" + env: TEST=true ALLOW_FAILURE=true - node_js: "iojs-v1.0" + env: TEST=true ALLOW_FAILURE=true - node_js: "0.11" + env: TEST=true ALLOW_FAILURE=true - node_js: "0.9" - - node_js: "0.8" + env: TEST=true ALLOW_FAILURE=true - node_js: "0.6" + env: TEST=true ALLOW_FAILURE=true - node_js: "0.4" + env: TEST=true ALLOW_FAILURE=true + ##- node_js: "7" + #env: TEST=true + #os: osx + #- node_js: "6" + #env: TEST=true + #os: osx + #- node_js: "5" + #env: TEST=true + #os: osx + #- node_js: "4" + #env: TEST=true + #os: osx + #- node_js: "iojs" + #env: TEST=true + #os: osx + #- node_js: "0.12" + #env: TEST=true + #os: osx + #- node_js: "0.10" + #env: TEST=true + #os: osx + #- node_js: "0.8" + #env: TEST=true + #os: osx + allow_failures: + - os: osx + - env: TEST=true ALLOW_FAILURE=true diff --git a/node_modules/extend/CHANGELOG.md b/node_modules/extend/CHANGELOG.md index ee0cfd6..0fe5287 100644 --- a/node_modules/extend/CHANGELOG.md +++ b/node_modules/extend/CHANGELOG.md @@ -1,3 +1,11 @@ +3.0.1 / 2017-04-27 +================== + * [Fix] deep extending should work with a non-object (#46) + * [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config` + * [Tests] up to `node` `v7.9`, `v6.10`, `v4.8`; improve matrix + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. + * [Docs] Add example to readme (#34) + 3.0.0 / 2015-07-01 ================== * [Possible breaking change] Use global "strict" directive (#32) diff --git a/node_modules/extend/README.md b/node_modules/extend/README.md index 632fb0f..5b8249a 100644 --- a/node_modules/extend/README.md +++ b/node_modules/extend/README.md @@ -6,6 +6,18 @@ `node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true. +Notes: + +* Since Node.js >= 4, + [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) + now offers the same functionality natively (but without the "deep copy" option). + See [ECMAScript 2015 (ES6) in Node.js](https://nodejs.org/en/docs/es6). +* Some native implementations of `Object.assign` in both Node.js and many + browsers (since NPM modules are for the browser too) may not be fully + spec-compliant. + Check [`object.assign`](https://www.npmjs.com/package/object.assign) module for + a compliant candidate. + ## Installation This package is available on [npm][npm-url] as: `extend` @@ -20,6 +32,13 @@ npm install extend *Extend one object with one or more others, returning the modified object.* +**Example:** + +``` js +var extend = require('extend'); +extend(targetObject, object1, object2); +``` + Keep in mind that the target object will be modified, and will be returned from extend(). If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s). @@ -54,7 +73,7 @@ Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jon [github-justmoon]: https://github.com/justmoon [github-insin]: https://github.com/insin [github-ljharb]: https://github.com/ljharb -[npm-version-png]: http://vb.teelaun.ch/justmoon/node-extend.svg +[npm-version-png]: http://versionbadg.es/justmoon/node-extend.svg [deps-svg]: https://david-dm.org/justmoon/node-extend.svg [deps-url]: https://david-dm.org/justmoon/node-extend [dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg diff --git a/node_modules/extend/index.js b/node_modules/extend/index.js index f5ec75d..bbe53f6 100644 --- a/node_modules/extend/index.js +++ b/node_modules/extend/index.js @@ -26,17 +26,17 @@ var isPlainObject = function isPlainObject(obj) { // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; - for (key in obj) {/**/} + for (key in obj) { /**/ } return typeof key === 'undefined' || hasOwn.call(obj, key); }; module.exports = function extend() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0], - i = 1, - length = arguments.length, - deep = false; + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; // Handle a deep copy situation if (typeof target === 'boolean') { @@ -44,7 +44,8 @@ module.exports = function extend() { target = arguments[1] || {}; // skip the boolean and the target i = 2; - } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) { + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { target = {}; } @@ -83,4 +84,3 @@ module.exports = function extend() { // Return the modified object return target; }; - diff --git a/node_modules/extend/package.json b/node_modules/extend/package.json index 43e85a3..1b27fd0 100644 --- a/node_modules/extend/package.json +++ b/node_modules/extend/package.json @@ -1,46 +1,27 @@ { - "_args": [ - [ - { - "raw": "extend@~3.0.0", - "scope": null, - "escapedName": "extend", - "name": "extend", - "rawSpec": "~3.0.0", - "spec": ">=3.0.0 <3.1.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/request" - ] - ], - "_from": "extend@>=3.0.0 <3.1.0", - "_id": "extend@3.0.0", - "_inCache": true, + "_from": "extend@~3.0.1", + "_id": "extend@3.0.1", + "_inBundle": false, + "_integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", "_location": "/extend", - "_nodeVersion": "2.3.1", - "_npmUser": { - "name": "ljharb", - "email": "ljharb@gmail.com" - }, - "_npmVersion": "2.11.3", "_phantomChildren": {}, "_requested": { - "raw": "extend@~3.0.0", - "scope": null, - "escapedName": "extend", + "type": "range", + "registry": true, + "raw": "extend@~3.0.1", "name": "extend", - "rawSpec": "~3.0.0", - "spec": ">=3.0.0 <3.1.0", - "type": "range" + "escapedName": "extend", + "rawSpec": "~3.0.1", + "saveSpec": null, + "fetchSpec": "~3.0.1" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", - "_shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4", - "_shrinkwrap": null, - "_spec": "extend@~3.0.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/request", + "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "_shasum": "a755ea7bc1adfcc5a31ce7e762dbaadc5e636444", + "_spec": "extend@~3.0.1", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/request", "author": { "name": "Stefan Thomas", "email": "justmoon@members.fsf.org", @@ -49,6 +30,7 @@ "bugs": { "url": "https://github.com/justmoon/node-extend/issues" }, + "bundleDependencies": false, "contributors": [ { "name": "Jordan Harband", @@ -56,19 +38,15 @@ } ], "dependencies": {}, + "deprecated": false, "description": "Port of jQuery.extend for node.js and the browser", "devDependencies": { + "@ljharb/eslint-config": "^11.0.0", "covert": "^1.1.0", - "eslint": "^0.24.0", - "jscs": "^1.13.1", - "tape": "^4.0.0" + "eslint": "^3.19.0", + "jscs": "^3.0.7", + "tape": "^4.6.3" }, - "directories": {}, - "dist": { - "shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4", - "tarball": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz" - }, - "gitHead": "148e7270cab2e9413af2cd0cab147070d755ed6d", "homepage": "https://github.com/justmoon/node-extend#readme", "keywords": [ "extend", @@ -77,19 +55,7 @@ ], "license": "MIT", "main": "index", - "maintainers": [ - { - "name": "justmoon", - "email": "justmoon@members.fsf.org" - }, - { - "name": "ljharb", - "email": "ljharb@gmail.com" - } - ], "name": "extend", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/justmoon/node-extend.git" @@ -100,7 +66,10 @@ "eslint": "eslint *.js */*.js", "jscs": "jscs *.js */*.js", "lint": "npm run jscs && npm run eslint", - "test": "npm run lint && node test/index.js && npm run coverage-quiet" + "posttest": "npm run coverage-quiet", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node test" }, - "version": "3.0.0" + "version": "3.0.1" } diff --git a/node_modules/extsprintf/.gitmodules b/node_modules/extsprintf/.gitmodules index 4e0f5e2..e69de29 100644 --- a/node_modules/extsprintf/.gitmodules +++ b/node_modules/extsprintf/.gitmodules @@ -1,6 +0,0 @@ -[submodule "deps/jsstyle"] - path = deps/jsstyle - url = git://github.com/davepacheco/jsstyle -[submodule "deps/javascriptlint"] - path = deps/javascriptlint - url = git://github.com/davepacheco/javascriptlint diff --git a/node_modules/extsprintf/Makefile b/node_modules/extsprintf/Makefile index 1deeb5f..db84518 100644 --- a/node_modules/extsprintf/Makefile +++ b/node_modules/extsprintf/Makefile @@ -11,7 +11,9 @@ # # Files # -JS_FILES := $(shell find lib -name '*.js') +JSL = jsl +JSSTYLE = jsstyle +JS_FILES := $(shell find examples lib -name '*.js') JSL_FILES_NODE = $(JS_FILES) JSSTYLE_FILES = $(JS_FILES) JSL_CONF_NODE = jsl.node.conf @@ -19,5 +21,4 @@ JSL_CONF_NODE = jsl.node.conf # Default target is "check" check: -include ./Makefile.deps include ./Makefile.targ diff --git a/node_modules/extsprintf/Makefile.deps b/node_modules/extsprintf/Makefile.deps deleted file mode 100644 index 2811bde..0000000 --- a/node_modules/extsprintf/Makefile.deps +++ /dev/null @@ -1,39 +0,0 @@ -# -*- mode: makefile -*- -# -# Copyright (c) 2012, Joyent, Inc. All rights reserved. -# -# Makefile.deps: Makefile for including common tools as dependencies -# -# NOTE: This makefile comes from the "eng" repo. It's designed to be dropped -# into other repos as-is without requiring any modifications. If you find -# yourself changing this file, you should instead update the original copy in -# eng.git and then update your repo to use the new version. -# -# This file is separate from Makefile.targ so that teams can choose -# independently whether to use the common targets in Makefile.targ and the -# common tools here. -# - -# -# javascriptlint -# -JSL_EXEC ?= deps/javascriptlint/build/install/jsl -JSL ?= python2.6 $(JSL_EXEC) - -$(JSL_EXEC): | deps/javascriptlint/.git - cd deps/javascriptlint && make install - -# -# jsstyle -# -JSSTYLE_EXEC ?= deps/jsstyle/jsstyle -JSSTYLE ?= $(JSSTYLE_EXEC) - -$(JSSTYLE_EXEC): | deps/jsstyle/.git - -# -# restdown -# -RESTDOWN_EXEC ?= deps/restdown/bin/restdown -RESTDOWN ?= python2.6 $(RESTDOWN_EXEC) -$(RESTDOWN_EXEC): | deps/restdown/.git diff --git a/node_modules/extsprintf/README.md b/node_modules/extsprintf/README.md index 702e4e2..b22998d 100644 --- a/node_modules/extsprintf/README.md +++ b/node_modules/extsprintf/README.md @@ -37,3 +37,10 @@ Now, use it: outputs: hello world + +# Also supported + +**printf**: same args as sprintf, but prints the result to stdout + +**fprintf**: same args as sprintf, preceded by a Node stream. Prints the result +to the given stream. diff --git a/node_modules/extsprintf/examples/simple.js b/node_modules/extsprintf/examples/simple.js deleted file mode 100644 index 9f342f5..0000000 --- a/node_modules/extsprintf/examples/simple.js +++ /dev/null @@ -1,2 +0,0 @@ -var mod_extsprintf = require('extsprintf'); -console.log(mod_extsprintf.sprintf('hello %25s', 'world')); diff --git a/node_modules/extsprintf/lib/extsprintf.js b/node_modules/extsprintf/lib/extsprintf.js index 61ff891..ed883d3 100644 --- a/node_modules/extsprintf/lib/extsprintf.js +++ b/node_modules/extsprintf/lib/extsprintf.js @@ -9,6 +9,8 @@ var mod_util = require('util'); * Public interface */ exports.sprintf = jsSprintf; +exports.printf = jsPrintf; +exports.fprintf = jsFprintf; /* * Stripped down version of s[n]printf(3c). We make a best effort to throw an @@ -107,6 +109,10 @@ function jsSprintf(fmt) arg.toString()); break; + case 'x': + ret += doPad(pad, width, left, arg.toString(16)); + break; + case 'j': /* non-standard */ if (width === 0) width = 10; @@ -127,6 +133,17 @@ function jsSprintf(fmt) return (ret); } +function jsPrintf() { + var args = Array.prototype.slice.call(arguments); + args.unshift(process.stdout); + jsFprintf.apply(null, args); +} + +function jsFprintf(stream) { + var args = Array.prototype.slice.call(arguments, 1); + return (stream.write(jsSprintf.apply(this, args))); +} + function doPad(chr, width, left, str) { var ret = str; diff --git a/node_modules/extsprintf/package.json b/node_modules/extsprintf/package.json index 5f08216..dcc81d4 100644 --- a/node_modules/extsprintf/package.json +++ b/node_modules/extsprintf/package.json @@ -1,74 +1,44 @@ { - "_args": [ - [ - { - "raw": "extsprintf@1.0.2", - "scope": null, - "escapedName": "extsprintf", - "name": "extsprintf", - "rawSpec": "1.0.2", - "spec": "1.0.2", - "type": "version" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/jsprim" - ] - ], - "_from": "extsprintf@1.0.2", - "_id": "extsprintf@1.0.2", - "_inCache": true, + "_from": "extsprintf@1.3.0", + "_id": "extsprintf@1.3.0", + "_inBundle": false, + "_integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", "_location": "/extsprintf", - "_npmUser": { - "name": "dap", - "email": "dap@cs.brown.edu" - }, - "_npmVersion": "1.1.65", "_phantomChildren": {}, "_requested": { - "raw": "extsprintf@1.0.2", - "scope": null, - "escapedName": "extsprintf", + "type": "version", + "registry": true, + "raw": "extsprintf@1.3.0", "name": "extsprintf", - "rawSpec": "1.0.2", - "spec": "1.0.2", - "type": "version" + "escapedName": "extsprintf", + "rawSpec": "1.3.0", + "saveSpec": null, + "fetchSpec": "1.3.0" }, "_requiredBy": [ "/jsprim", "/verror" ], - "_resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", - "_shasum": "e1080e0658e300b06294990cc70e1502235fd550", - "_shrinkwrap": null, - "_spec": "extsprintf@1.0.2", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/jsprim", + "_resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "_shasum": "96918440e3041a7a414f8c52e3c574eb3c3e1e05", + "_spec": "extsprintf@1.3.0", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/jsprim", "bugs": { "url": "https://github.com/davepacheco/node-extsprintf/issues" }, - "dependencies": {}, + "bundleDependencies": false, + "deprecated": false, "description": "extended POSIX-style sprintf", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "e1080e0658e300b06294990cc70e1502235fd550", - "tarball": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" - }, "engines": [ "node >=0.6.0" ], "homepage": "https://github.com/davepacheco/node-extsprintf#readme", + "license": "MIT", "main": "./lib/extsprintf.js", - "maintainers": [ - { - "name": "dap", - "email": "dap@cs.brown.edu" - } - ], "name": "extsprintf", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/davepacheco/node-extsprintf.git" }, - "version": "1.0.2" + "version": "1.3.0" } diff --git a/node_modules/forever-agent/package.json b/node_modules/forever-agent/package.json index 3870492..3862c6f 100644 --- a/node_modules/forever-agent/package.json +++ b/node_modules/forever-agent/package.json @@ -1,45 +1,27 @@ { - "_args": [ - [ - { - "raw": "forever-agent@~0.6.1", - "scope": null, - "escapedName": "forever-agent", - "name": "forever-agent", - "rawSpec": "~0.6.1", - "spec": ">=0.6.1 <0.7.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/request" - ] - ], - "_from": "forever-agent@>=0.6.1 <0.7.0", + "_from": "forever-agent@~0.6.1", "_id": "forever-agent@0.6.1", - "_inCache": true, + "_inBundle": false, + "_integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", "_location": "/forever-agent", - "_npmUser": { - "name": "simov", - "email": "simeonvelichkov@gmail.com" - }, - "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { + "type": "range", + "registry": true, "raw": "forever-agent@~0.6.1", - "scope": null, - "escapedName": "forever-agent", "name": "forever-agent", + "escapedName": "forever-agent", "rawSpec": "~0.6.1", - "spec": ">=0.6.1 <0.7.0", - "type": "range" + "saveSpec": null, + "fetchSpec": "~0.6.1" }, "_requiredBy": [ "/request" ], "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", - "_shrinkwrap": null, "_spec": "forever-agent@~0.6.1", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/request", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/request", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com", @@ -48,41 +30,21 @@ "bugs": { "url": "https://github.com/mikeal/forever-agent/issues" }, + "bundleDependencies": false, "dependencies": {}, + "deprecated": false, "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", - "tarball": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" - }, "engines": { "node": "*" }, - "gitHead": "1b3b6163f2b3c2c4122bbfa288c1325c0df9871d", - "homepage": "https://github.com/mikeal/forever-agent", + "homepage": "https://github.com/mikeal/forever-agent#readme", "license": "Apache-2.0", "main": "index.js", - "maintainers": [ - { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, - { - "name": "nylen", - "email": "jnylen@gmail.com" - }, - { - "name": "simov", - "email": "simeonvelichkov@gmail.com" - } - ], "name": "forever-agent", "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "url": "git+https://github.com/mikeal/forever-agent.git" }, - "scripts": {}, "version": "0.6.1" } diff --git a/node_modules/form-data/README.md b/node_modules/form-data/README.md index 642a9d1..518ee84 100644 --- a/node_modules/form-data/README.md +++ b/node_modules/form-data/README.md @@ -6,11 +6,11 @@ The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface] [xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface -[![Linux Build](https://img.shields.io/travis/form-data/form-data/v2.1.2.svg?label=linux:0.12-6.x)](https://travis-ci.org/form-data/form-data) -[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v2.1.2.svg?label=macos:0.12-6.x)](https://travis-ci.org/form-data/form-data) -[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/form-data/v2.1.2.svg?label=windows:0.12-6.x)](https://ci.appveyor.com/project/alexindigo/form-data) +[![Linux Build](https://img.shields.io/travis/form-data/form-data/v2.3.1.svg?label=linux:0.12-8.x)](https://travis-ci.org/form-data/form-data) +[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v2.3.1.svg?label=macos:0.12-8.x)](https://travis-ci.org/form-data/form-data) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/form-data/v2.3.1.svg?label=windows:0.12-8.x)](https://ci.appveyor.com/project/alexindigo/form-data) -[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v2.1.2.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) +[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v2.3.1.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) [![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data) [![bitHound Overall Score](https://www.bithound.io/github/form-data/form-data/badges/score.svg)](https://www.bithound.io/github/form-data/form-data) @@ -75,6 +75,20 @@ form.submit('http://example.org/', function(err, res) { For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. +### Custom options + +You can provide custom options, such as `maxDataSize`: + +``` javascript +var FormData = require('form-data'); + +var form = new FormData({ maxDataSize: 20971520 }); +form.append('my_field', 'my value'); +form.append('my_buffer', /* something big */); +``` + +List of available options could be found in [combined-stream](https://github.com/felixge/node-combined-stream/blob/master/lib/combined_stream.js#L7-L15) + ### Alternative submission methods You can use node's http client interface: @@ -132,8 +146,9 @@ someModule.stream(function(err, stdout, stderr) { var form = new FormData(); form.append('file', stdout, { - filename: 'unicycle.jpg', - contentType: 'image/jpg', + filename: 'unicycle.jpg', // ... or: + filepath: 'photos/toys/unicycle.jpg', + contentType: 'image/jpeg', knownLength: 19806 }); @@ -144,6 +159,8 @@ someModule.stream(function(err, stdout, stderr) { }); ``` +The `filepath` property overrides `filename` and may contain a relative path. This is typically used when uploading [multiple files from a directory](https://wicg.github.io/entries-api/#dom-htmlinputelement-webkitdirectory). + For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: ``` javascript diff --git a/node_modules/form-data/lib/form_data.js b/node_modules/form-data/lib/form_data.js index d2cc924..3a1bb82 100644 --- a/node_modules/form-data/lib/form_data.js +++ b/node_modules/form-data/lib/form_data.js @@ -21,8 +21,9 @@ util.inherits(FormData, CombinedStream); * and file uploads to other web applications. * * @constructor + * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream */ -function FormData() { +function FormData(options) { if (!(this instanceof FormData)) { return new FormData(); } @@ -32,6 +33,11 @@ function FormData() { this._valuesToMeasure = []; CombinedStream.call(this); + + options = options || {}; + for (var option in options) { + this[option] = options[option]; + } } FormData.LINE_BREAK = '\r\n'; @@ -186,6 +192,7 @@ FormData.prototype._multiPartHeader = function(field, value, options) { var header; for (var prop in headers) { + if (!headers.hasOwnProperty(prop)) continue; header = headers[prop]; // skip nullish headers. @@ -209,20 +216,25 @@ FormData.prototype._multiPartHeader = function(field, value, options) { FormData.prototype._getContentDisposition = function(value, options) { - var contentDisposition; + var filename + , contentDisposition + ; - // custom filename takes precedence - // fs- and request- streams have path property - // formidable and the browser add a name property. - var filename = options.filename || value.name || value.path; - - // or try http response - if (!filename && value.readable && value.hasOwnProperty('httpVersion')) { - filename = value.client._httpMessage.path; + if (typeof options.filepath === 'string') { + // custom filepath for relative paths + filename = path.normalize(options.filepath).replace(/\\/g, '/'); + } else if (options.filename || value.name || value.path) { + // custom filename take precedence + // formidable and the browser add a name property + // fs- and request- streams have path property + filename = path.basename(options.filename || value.name || value.path); + } else if (value.readable && value.hasOwnProperty('httpVersion')) { + // or try http response + filename = path.basename(value.client._httpMessage.path); } if (filename) { - contentDisposition = 'filename="' + path.basename(filename) + '"'; + contentDisposition = 'filename="' + filename + '"'; } return contentDisposition; @@ -248,9 +260,9 @@ FormData.prototype._getContentType = function(value, options) { contentType = value.headers['content-type']; } - // or guess it from the filename - if (!contentType && options.filename) { - contentType = mime.lookup(options.filename); + // or guess it from the filepath or filename + if (!contentType && (options.filepath || options.filename)) { + contentType = mime.lookup(options.filepath || options.filename); } // fallback to the default content type if `value` is not simple value @@ -388,7 +400,8 @@ FormData.prototype.submit = function(params, cb) { options = populate({ port: params.port, path: params.pathname, - host: params.hostname + host: params.hostname, + protocol: params.protocol }, defaults); // use custom params @@ -438,3 +451,7 @@ FormData.prototype._error = function(err) { this.emit('error', err); } }; + +FormData.prototype.toString = function () { + return '[object FormData]'; +}; diff --git a/node_modules/form-data/package.json b/node_modules/form-data/package.json index 049e04d..7ba02d6 100644 --- a/node_modules/form-data/package.json +++ b/node_modules/form-data/package.json @@ -1,50 +1,27 @@ { - "_args": [ - [ - { - "raw": "form-data@~2.1.1", - "scope": null, - "escapedName": "form-data", - "name": "form-data", - "rawSpec": "~2.1.1", - "spec": ">=2.1.1 <2.2.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/request" - ] - ], - "_from": "form-data@>=2.1.1 <2.2.0", - "_id": "form-data@2.1.2", - "_inCache": true, + "_from": "form-data@~2.3.1", + "_id": "form-data@2.3.1", + "_inBundle": false, + "_integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=", "_location": "/form-data", - "_nodeVersion": "6.4.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/form-data-2.1.2.tgz_1478577739404_0.6574864208232611" - }, - "_npmUser": { - "name": "alexindigo", - "email": "iam@alexindigo.com" - }, - "_npmVersion": "3.10.3", "_phantomChildren": {}, "_requested": { - "raw": "form-data@~2.1.1", - "scope": null, - "escapedName": "form-data", + "type": "range", + "registry": true, + "raw": "form-data@~2.3.1", "name": "form-data", - "rawSpec": "~2.1.1", - "spec": ">=2.1.1 <2.2.0", - "type": "range" + "escapedName": "form-data", + "rawSpec": "~2.3.1", + "saveSpec": null, + "fetchSpec": "~2.3.1" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", - "_shasum": "89c3534008b97eada4cbb157d58f6f5df025eae4", - "_shrinkwrap": null, - "_spec": "form-data@~2.1.1", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/request", + "_resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz", + "_shasum": "6fb94fbd71885306d73d15cc497fe4cc4ecd44bf", + "_spec": "form-data@~2.3.1", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/request", "author": { "name": "Felix Geisendörfer", "email": "felix@debuggable.com", @@ -54,11 +31,13 @@ "bugs": { "url": "https://github.com/form-data/form-data/issues" }, + "bundleDependencies": false, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.5", "mime-types": "^2.1.12" }, + "deprecated": false, "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", "devDependencies": { "browserify": "^13.1.1", @@ -80,44 +59,18 @@ "rimraf": "^2.5.4", "tape": "^4.6.2" }, - "directories": {}, - "dist": { - "shasum": "89c3534008b97eada4cbb157d58f6f5df025eae4", - "tarball": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz" - }, "engines": { "node": ">= 0.12" }, - "gitHead": "03444d21961a7a44cdc2eae11ee3630f6969023d", "homepage": "https://github.com/form-data/form-data#readme", "license": "MIT", "main": "./lib/form_data", - "maintainers": [ - { - "name": "alexindigo", - "email": "iam@alexindigo.com" - }, - { - "name": "dylanpiercey", - "email": "pierceydylan@gmail.com" - }, - { - "name": "felixge", - "email": "felix@debuggable.com" - }, - { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - } - ], "name": "form-data", - "optionalDependencies": {}, "pre-commit": [ "lint", "ci-test", "check" ], - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/form-data/form-data.git" @@ -141,5 +94,5 @@ "test": "istanbul cover test/run.js", "update-readme": "sed -i.bak 's/\\/master\\.svg/\\/v'$(npm --silent run get-version)'.svg/g' README.md" }, - "version": "2.1.2" + "version": "2.3.1" } diff --git a/node_modules/generate-function/.npmignore b/node_modules/generate-function/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/generate-function/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/generate-function/.travis.yml b/node_modules/generate-function/.travis.yml deleted file mode 100644 index 6e5919d..0000000 --- a/node_modules/generate-function/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/node_modules/generate-function/README.md b/node_modules/generate-function/README.md deleted file mode 100644 index 693bff8..0000000 --- a/node_modules/generate-function/README.md +++ /dev/null @@ -1,72 +0,0 @@ -# generate-function - -Module that helps you write generated functions in Node - -``` -npm install generate-function -``` - -[![build status](http://img.shields.io/travis/mafintosh/generate-function.svg?style=flat)](http://travis-ci.org/mafintosh/generate-function) - -## Disclamer - -Writing code that generates code is hard. -You should only use this if you really, really, really need this for performance reasons (like schema validators / parsers etc). - -## Usage - -``` js -var genfun = require('generate-function') - -var addNumber = function(val) { - var fn = genfun() - ('function add(n) {') - ('return n + %d', val) // supports format strings to insert values - ('}') - - return fn.toFunction() // will compile the function -} - -var add2 = addNumber(2) - -console.log('1+2=', add2(1)) -console.log(add2.toString()) // prints the generated function -``` - -If you need to close over variables in your generated function pass them to `toFunction(scope)` - -``` js -var multiply = function(a, b) { - return a * b -} - -var addAndMultiplyNumber = function(val) { - var fn = genfun() - ('function(n) {') - ('if (typeof n !== "number") {') // ending a line with { will indent the source - ('throw new Error("argument should be a number")') - ('}') - ('var result = multiply(%d, n+%d)', val, val) - ('return result') - ('}') - - // use fn.toString() if you want to see the generated source - - return fn.toFunction({ - multiply: multiply - }) -} - -var addAndMultiply2 = addAndMultiplyNumber(2) - -console.log('(3 + 2) * 2 =', addAndMultiply2(3)) -``` - -## Related - -See [generate-object-property](https://github.com/mafintosh/generate-object-property) if you need to safely generate code that -can be used to reference an object property - -## License - -MIT \ No newline at end of file diff --git a/node_modules/generate-function/example.js b/node_modules/generate-function/example.js deleted file mode 100644 index 8d1fee1..0000000 --- a/node_modules/generate-function/example.js +++ /dev/null @@ -1,27 +0,0 @@ -var genfun = require('./') - -var multiply = function(a, b) { - return a * b -} - -var addAndMultiplyNumber = function(val) { - var fn = genfun() - ('function(n) {') - ('if (typeof n !== "number") {') // ending a line with { will indent the source - ('throw new Error("argument should be a number")') - ('}') - ('var result = multiply(%d, n+%d)', val, val) - ('return result') - ('}') - - // use fn.toString() if you want to see the generated source - - return fn.toFunction({ - multiply: multiply - }) -} - -var addAndMultiply2 = addAndMultiplyNumber(2) - -console.log(addAndMultiply2.toString()) -console.log('(3 + 2) * 2 =', addAndMultiply2(3)) \ No newline at end of file diff --git a/node_modules/generate-function/index.js b/node_modules/generate-function/index.js deleted file mode 100644 index 37e064b..0000000 --- a/node_modules/generate-function/index.js +++ /dev/null @@ -1,61 +0,0 @@ -var util = require('util') - -var INDENT_START = /[\{\[]/ -var INDENT_END = /[\}\]]/ - -module.exports = function() { - var lines = [] - var indent = 0 - - var push = function(str) { - var spaces = '' - while (spaces.length < indent*2) spaces += ' ' - lines.push(spaces+str) - } - - var line = function(fmt) { - if (!fmt) return line - - if (INDENT_END.test(fmt.trim()[0]) && INDENT_START.test(fmt[fmt.length-1])) { - indent-- - push(util.format.apply(util, arguments)) - indent++ - return line - } - if (INDENT_START.test(fmt[fmt.length-1])) { - push(util.format.apply(util, arguments)) - indent++ - return line - } - if (INDENT_END.test(fmt.trim()[0])) { - indent-- - push(util.format.apply(util, arguments)) - return line - } - - push(util.format.apply(util, arguments)) - return line - } - - line.toString = function() { - return lines.join('\n') - } - - line.toFunction = function(scope) { - var src = 'return ('+line.toString()+')' - - var keys = Object.keys(scope || {}).map(function(key) { - return key - }) - - var vals = keys.map(function(key) { - return scope[key] - }) - - return Function.apply(null, keys.concat(src)).apply(null, vals) - } - - if (arguments.length) line.apply(null, arguments) - - return line -} diff --git a/node_modules/generate-function/package.json b/node_modules/generate-function/package.json deleted file mode 100644 index 40b2873..0000000 --- a/node_modules/generate-function/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "generate-function@^2.0.0", - "scope": null, - "escapedName": "generate-function", - "name": "generate-function", - "rawSpec": "^2.0.0", - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/is-my-json-valid" - ] - ], - "_from": "generate-function@>=2.0.0 <3.0.0", - "_id": "generate-function@2.0.0", - "_inCache": true, - "_location": "/generate-function", - "_npmUser": { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - }, - "_npmVersion": "1.4.23", - "_phantomChildren": {}, - "_requested": { - "raw": "generate-function@^2.0.0", - "scope": null, - "escapedName": "generate-function", - "name": "generate-function", - "rawSpec": "^2.0.0", - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/is-my-json-valid" - ], - "_resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "_shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", - "_shrinkwrap": null, - "_spec": "generate-function@^2.0.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/is-my-json-valid", - "author": { - "name": "Mathias Buus" - }, - "bugs": { - "url": "https://github.com/mafintosh/generate-function/issues" - }, - "dependencies": {}, - "description": "Module that helps you write generated functions in Node", - "devDependencies": { - "tape": "^2.13.4" - }, - "directories": {}, - "dist": { - "shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", - "tarball": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz" - }, - "gitHead": "3d5fc8de5859be95f58e3af9bfb5f663edd95149", - "homepage": "https://github.com/mafintosh/generate-function", - "keywords": [ - "generate", - "code", - "generation", - "function", - "performance" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - } - ], - "name": "generate-function", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/generate-function.git" - }, - "scripts": { - "test": "tape test.js" - }, - "version": "2.0.0" -} diff --git a/node_modules/generate-function/test.js b/node_modules/generate-function/test.js deleted file mode 100644 index 2768893..0000000 --- a/node_modules/generate-function/test.js +++ /dev/null @@ -1,33 +0,0 @@ -var tape = require('tape') -var genfun = require('./') - -tape('generate add function', function(t) { - var fn = genfun() - ('function add(n) {') - ('return n + %d', 42) - ('}') - - t.same(fn.toString(), 'function add(n) {\n return n + 42\n}', 'code is indented') - t.same(fn.toFunction()(10), 52, 'function works') - t.end() -}) - -tape('generate function + closed variables', function(t) { - var fn = genfun() - ('function add(n) {') - ('return n + %d + number', 42) - ('}') - - var notGood = fn.toFunction() - var good = fn.toFunction({number:10}) - - try { - notGood(10) - t.ok(false, 'function should not work') - } catch (err) { - t.same(err.message, 'number is not defined', 'throws reference error') - } - - t.same(good(11), 63, 'function with closed var works') - t.end() -}) \ No newline at end of file diff --git a/node_modules/generate-object-property/.npmignore b/node_modules/generate-object-property/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/generate-object-property/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/generate-object-property/.travis.yml b/node_modules/generate-object-property/.travis.yml deleted file mode 100644 index 6e5919d..0000000 --- a/node_modules/generate-object-property/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/node_modules/generate-object-property/LICENSE b/node_modules/generate-object-property/LICENSE deleted file mode 100644 index 757562e..0000000 --- a/node_modules/generate-object-property/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -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/generate-object-property/README.md b/node_modules/generate-object-property/README.md deleted file mode 100644 index 0ee0461..0000000 --- a/node_modules/generate-object-property/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# generate-object-property - -Generate safe JS code that can used to reference a object property - - npm install generate-object-property - -[![build status](http://img.shields.io/travis/mafintosh/generate-object-property.svg?style=flat)](http://travis-ci.org/mafintosh/generate-object-property) - -## Usage - -``` js -var gen = require('generate-object-property'); -console.log(gen('a','b')); // prints a.b -console.log(gen('a', 'foo-bar')); // prints a["foo-bar"] -``` - -## License - -MIT \ No newline at end of file diff --git a/node_modules/generate-object-property/index.js b/node_modules/generate-object-property/index.js deleted file mode 100644 index 5dc9f77..0000000 --- a/node_modules/generate-object-property/index.js +++ /dev/null @@ -1,12 +0,0 @@ -var isProperty = require('is-property') - -var gen = function(obj, prop) { - return isProperty(prop) ? obj+'.'+prop : obj+'['+JSON.stringify(prop)+']' -} - -gen.valid = isProperty -gen.property = function (prop) { - return isProperty(prop) ? prop : JSON.stringify(prop) -} - -module.exports = gen diff --git a/node_modules/generate-object-property/package.json b/node_modules/generate-object-property/package.json deleted file mode 100644 index 463e83e..0000000 --- a/node_modules/generate-object-property/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "generate-object-property@^1.1.0", - "scope": null, - "escapedName": "generate-object-property", - "name": "generate-object-property", - "rawSpec": "^1.1.0", - "spec": ">=1.1.0 <2.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/is-my-json-valid" - ] - ], - "_from": "generate-object-property@>=1.1.0 <2.0.0", - "_id": "generate-object-property@1.2.0", - "_inCache": true, - "_location": "/generate-object-property", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - }, - "_npmVersion": "2.9.0", - "_phantomChildren": {}, - "_requested": { - "raw": "generate-object-property@^1.1.0", - "scope": null, - "escapedName": "generate-object-property", - "name": "generate-object-property", - "rawSpec": "^1.1.0", - "spec": ">=1.1.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/is-my-json-valid" - ], - "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", - "_shrinkwrap": null, - "_spec": "generate-object-property@^1.1.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/is-my-json-valid", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "bugs": { - "url": "https://github.com/mafintosh/generate-object-property/issues" - }, - "dependencies": { - "is-property": "^1.0.0" - }, - "description": "Generate safe JS code that can used to reference a object property", - "devDependencies": { - "tape": "^2.13.0" - }, - "directories": {}, - "dist": { - "shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", - "tarball": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz" - }, - "gitHead": "0dd7d411018de54b2eae63b424c15b3e50bd678c", - "homepage": "https://github.com/mafintosh/generate-object-property", - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - } - ], - "name": "generate-object-property", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/generate-object-property.git" - }, - "scripts": { - "test": "tape test.js" - }, - "version": "1.2.0" -} diff --git a/node_modules/generate-object-property/test.js b/node_modules/generate-object-property/test.js deleted file mode 100644 index 6c299c6..0000000 --- a/node_modules/generate-object-property/test.js +++ /dev/null @@ -1,12 +0,0 @@ -var tape = require('tape') -var gen = require('./') - -tape('valid', function(t) { - t.same(gen('a', 'b'), 'a.b') - t.end() -}) - -tape('invalid', function(t) { - t.same(gen('a', '-b'), 'a["-b"]') - t.end() -}) \ No newline at end of file diff --git a/node_modules/getpass/node_modules/assert-plus/AUTHORS b/node_modules/getpass/node_modules/assert-plus/AUTHORS deleted file mode 100644 index 1923524..0000000 --- a/node_modules/getpass/node_modules/assert-plus/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -Dave Eddy -Fred Kuo -Lars-Magnus Skog -Mark Cavage -Patrick Mooney -Rob Gulewich diff --git a/node_modules/getpass/node_modules/assert-plus/CHANGES.md b/node_modules/getpass/node_modules/assert-plus/CHANGES.md deleted file mode 100644 index 57d92bf..0000000 --- a/node_modules/getpass/node_modules/assert-plus/CHANGES.md +++ /dev/null @@ -1,14 +0,0 @@ -# assert-plus Changelog - -## 1.0.0 - -- *BREAKING* assert.number (and derivatives) now accept Infinity as valid input -- Add assert.finite check. Previous assert.number callers should use this if - they expect Infinity inputs to throw. - -## 0.2.0 - -- Fix `assert.object(null)` so it throws -- Fix optional/arrayOf exports for non-type-of asserts -- Add optiona/arrayOf exports for Stream/Date/Regex/uuid -- Add basic unit test coverage diff --git a/node_modules/getpass/node_modules/assert-plus/README.md b/node_modules/getpass/node_modules/assert-plus/README.md deleted file mode 100644 index ec200d1..0000000 --- a/node_modules/getpass/node_modules/assert-plus/README.md +++ /dev/null @@ -1,162 +0,0 @@ -# assert-plus - -This library is a super small wrapper over node's assert module that has two -things: (1) the ability to disable assertions with the environment variable -NODE\_NDEBUG, and (2) some API wrappers for argument testing. Like -`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks -like this: - -```javascript - var assert = require('assert-plus'); - - function fooAccount(options, callback) { - assert.object(options, 'options'); - assert.number(options.id, 'options.id'); - assert.bool(options.isManager, 'options.isManager'); - assert.string(options.name, 'options.name'); - assert.arrayOfString(options.email, 'options.email'); - assert.func(callback, 'callback'); - - // Do stuff - callback(null, {}); - } -``` - -# API - -All methods that *aren't* part of node's core assert API are simply assumed to -take an argument, and then a string 'name' that's not a message; `AssertionError` -will be thrown if the assertion fails with a message like: - - AssertionError: foo (string) is required - at test (/home/mark/work/foo/foo.js:3:9) - at Object. (/home/mark/work/foo/foo.js:15:1) - at Module._compile (module.js:446:26) - at Object..js (module.js:464:10) - at Module.load (module.js:353:31) - at Function._load (module.js:311:12) - at Array.0 (module.js:484:10) - at EventEmitter._tickCallback (node.js:190:38) - -from: - -```javascript - function test(foo) { - assert.string(foo, 'foo'); - } -``` - -There you go. You can check that arrays are of a homogeneous type with `Arrayof$Type`: - -```javascript - function test(foo) { - assert.arrayOfString(foo, 'foo'); - } -``` - -You can assert IFF an argument is not `undefined` (i.e., an optional arg): - -```javascript - assert.optionalString(foo, 'foo'); -``` - -Lastly, you can opt-out of assertion checking altogether by setting the -environment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have -lots of assertions, and don't want to pay `typeof ()` taxes to v8 in -production. Be advised: The standard functions re-exported from `assert` are -also disabled in assert-plus if NDEBUG is specified. Using them directly from -the `assert` module avoids this behavior. - -The complete list of APIs is: - -* assert.array -* assert.bool -* assert.buffer -* assert.func -* assert.number -* assert.finite -* assert.object -* assert.string -* assert.stream -* assert.date -* assert.regexp -* assert.uuid -* assert.arrayOfArray -* assert.arrayOfBool -* assert.arrayOfBuffer -* assert.arrayOfFunc -* assert.arrayOfNumber -* assert.arrayOfFinite -* assert.arrayOfObject -* assert.arrayOfString -* assert.arrayOfStream -* assert.arrayOfDate -* assert.arrayOfRegexp -* assert.arrayOfUuid -* assert.optionalArray -* assert.optionalBool -* assert.optionalBuffer -* assert.optionalFunc -* assert.optionalNumber -* assert.optionalFinite -* assert.optionalObject -* assert.optionalString -* assert.optionalStream -* assert.optionalDate -* assert.optionalRegexp -* assert.optionalUuid -* assert.optionalArrayOfArray -* assert.optionalArrayOfBool -* assert.optionalArrayOfBuffer -* assert.optionalArrayOfFunc -* assert.optionalArrayOfNumber -* assert.optionalArrayOfFinite -* assert.optionalArrayOfObject -* assert.optionalArrayOfString -* assert.optionalArrayOfStream -* assert.optionalArrayOfDate -* assert.optionalArrayOfRegexp -* assert.optionalArrayOfUuid -* assert.AssertionError -* assert.fail -* assert.ok -* assert.equal -* assert.notEqual -* assert.deepEqual -* assert.notDeepEqual -* assert.strictEqual -* assert.notStrictEqual -* assert.throws -* assert.doesNotThrow -* assert.ifError - -# Installation - - npm install assert-plus - -## License - -The MIT License (MIT) -Copyright (c) 2012 Mark Cavage - -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. - -## Bugs - -See . diff --git a/node_modules/getpass/node_modules/assert-plus/assert.js b/node_modules/getpass/node_modules/assert-plus/assert.js deleted file mode 100644 index 26f944e..0000000 --- a/node_modules/getpass/node_modules/assert-plus/assert.js +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) 2012, Mark Cavage. All rights reserved. -// Copyright 2015 Joyent, Inc. - -var assert = require('assert'); -var Stream = require('stream').Stream; -var util = require('util'); - - -///--- Globals - -/* JSSTYLED */ -var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; - - -///--- Internal - -function _capitalize(str) { - return (str.charAt(0).toUpperCase() + str.slice(1)); -} - -function _toss(name, expected, oper, arg, actual) { - throw new assert.AssertionError({ - message: util.format('%s (%s) is required', name, expected), - actual: (actual === undefined) ? typeof (arg) : actual(arg), - expected: expected, - operator: oper || '===', - stackStartFunction: _toss.caller - }); -} - -function _getClass(arg) { - return (Object.prototype.toString.call(arg).slice(8, -1)); -} - -function noop() { - // Why even bother with asserts? -} - - -///--- Exports - -var types = { - bool: { - check: function (arg) { return typeof (arg) === 'boolean'; } - }, - func: { - check: function (arg) { return typeof (arg) === 'function'; } - }, - string: { - check: function (arg) { return typeof (arg) === 'string'; } - }, - object: { - check: function (arg) { - return typeof (arg) === 'object' && arg !== null; - } - }, - number: { - check: function (arg) { - return typeof (arg) === 'number' && !isNaN(arg); - } - }, - finite: { - check: function (arg) { - return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); - } - }, - buffer: { - check: function (arg) { return Buffer.isBuffer(arg); }, - operator: 'Buffer.isBuffer' - }, - array: { - check: function (arg) { return Array.isArray(arg); }, - operator: 'Array.isArray' - }, - stream: { - check: function (arg) { return arg instanceof Stream; }, - operator: 'instanceof', - actual: _getClass - }, - date: { - check: function (arg) { return arg instanceof Date; }, - operator: 'instanceof', - actual: _getClass - }, - regexp: { - check: function (arg) { return arg instanceof RegExp; }, - operator: 'instanceof', - actual: _getClass - }, - uuid: { - check: function (arg) { - return typeof (arg) === 'string' && UUID_REGEXP.test(arg); - }, - operator: 'isUUID' - } -}; - -function _setExports(ndebug) { - var keys = Object.keys(types); - var out; - - /* re-export standard assert */ - if (process.env.NODE_NDEBUG) { - out = noop; - } else { - out = function (arg, msg) { - if (!arg) { - _toss(msg, 'true', arg); - } - }; - } - - /* standard checks */ - keys.forEach(function (k) { - if (ndebug) { - out[k] = noop; - return; - } - var type = types[k]; - out[k] = function (arg, msg) { - if (!type.check(arg)) { - _toss(msg, k, type.operator, arg, type.actual); - } - }; - }); - - /* optional checks */ - keys.forEach(function (k) { - var name = 'optional' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - out[name] = function (arg, msg) { - if (arg === undefined || arg === null) { - return; - } - if (!type.check(arg)) { - _toss(msg, k, type.operator, arg, type.actual); - } - }; - }); - - /* arrayOf checks */ - keys.forEach(function (k) { - var name = 'arrayOf' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - var expected = '[' + k + ']'; - out[name] = function (arg, msg) { - if (!Array.isArray(arg)) { - _toss(msg, expected, type.operator, arg, type.actual); - } - var i; - for (i = 0; i < arg.length; i++) { - if (!type.check(arg[i])) { - _toss(msg, expected, type.operator, arg, type.actual); - } - } - }; - }); - - /* optionalArrayOf checks */ - keys.forEach(function (k) { - var name = 'optionalArrayOf' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - var expected = '[' + k + ']'; - out[name] = function (arg, msg) { - if (arg === undefined || arg === null) { - return; - } - if (!Array.isArray(arg)) { - _toss(msg, expected, type.operator, arg, type.actual); - } - var i; - for (i = 0; i < arg.length; i++) { - if (!type.check(arg[i])) { - _toss(msg, expected, type.operator, arg, type.actual); - } - } - }; - }); - - /* re-export built-in assertions */ - Object.keys(assert).forEach(function (k) { - if (k === 'AssertionError') { - out[k] = assert[k]; - return; - } - if (ndebug) { - out[k] = noop; - return; - } - out[k] = assert[k]; - }); - - /* export ourselves (for unit tests _only_) */ - out._setExports = _setExports; - - return out; -} - -module.exports = _setExports(process.env.NODE_NDEBUG); diff --git a/node_modules/getpass/node_modules/assert-plus/package.json b/node_modules/getpass/node_modules/assert-plus/package.json deleted file mode 100644 index 432b880..0000000 --- a/node_modules/getpass/node_modules/assert-plus/package.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "assert-plus@^1.0.0", - "scope": null, - "escapedName": "assert-plus", - "name": "assert-plus", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/getpass" - ] - ], - "_from": "assert-plus@>=1.0.0 <2.0.0", - "_id": "assert-plus@1.0.0", - "_inCache": true, - "_location": "/getpass/assert-plus", - "_nodeVersion": "0.10.40", - "_npmUser": { - "name": "pfmooney", - "email": "patrick.f.mooney@gmail.com" - }, - "_npmVersion": "3.3.9", - "_phantomChildren": {}, - "_requested": { - "raw": "assert-plus@^1.0.0", - "scope": null, - "escapedName": "assert-plus", - "name": "assert-plus", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/getpass" - ], - "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "_shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", - "_shrinkwrap": null, - "_spec": "assert-plus@^1.0.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/getpass", - "author": { - "name": "Mark Cavage", - "email": "mcavage@gmail.com" - }, - "bugs": { - "url": "https://github.com/mcavage/node-assert-plus/issues" - }, - "contributors": [ - { - "name": "Dave Eddy", - "email": "dave@daveeddy.com" - }, - { - "name": "Fred Kuo", - "email": "fred.kuo@joyent.com" - }, - { - "name": "Lars-Magnus Skog", - "email": "ralphtheninja@riseup.net" - }, - { - "name": "Mark Cavage", - "email": "mcavage@gmail.com" - }, - { - "name": "Patrick Mooney", - "email": "pmooney@pfmooney.com" - }, - { - "name": "Rob Gulewich", - "email": "robert.gulewich@joyent.com" - } - ], - "dependencies": {}, - "description": "Extra assertions on top of node's assert module", - "devDependencies": { - "faucet": "0.0.1", - "tape": "4.2.2" - }, - "directories": {}, - "dist": { - "shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", - "tarball": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" - }, - "engines": { - "node": ">=0.8" - }, - "homepage": "https://github.com/mcavage/node-assert-plus#readme", - "license": "MIT", - "main": "./assert.js", - "maintainers": [ - { - "name": "mcavage", - "email": "mcavage@gmail.com" - }, - { - "name": "pfmooney", - "email": "patrick.f.mooney@gmail.com" - } - ], - "name": "assert-plus", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/mcavage/node-assert-plus.git" - }, - "scripts": { - "test": "tape tests/*.js | ./node_modules/.bin/faucet" - }, - "version": "1.0.0" -} diff --git a/node_modules/getpass/package.json b/node_modules/getpass/package.json index 42167d1..3270625 100644 --- a/node_modules/getpass/package.json +++ b/node_modules/getpass/package.json @@ -1,50 +1,27 @@ { - "_args": [ - [ - { - "raw": "getpass@^0.1.1", - "scope": null, - "escapedName": "getpass", - "name": "getpass", - "rawSpec": "^0.1.1", - "spec": ">=0.1.1 <0.2.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/sshpk" - ] - ], - "_from": "getpass@>=0.1.1 <0.2.0", - "_id": "getpass@0.1.6", - "_inCache": true, + "_from": "getpass@^0.1.1", + "_id": "getpass@0.1.7", + "_inBundle": false, + "_integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "_location": "/getpass", - "_nodeVersion": "0.12.9", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/getpass-0.1.6.tgz_1461907090215_0.6450737570412457" - }, - "_npmUser": { - "name": "arekinath", - "email": "alex@cooperi.net" - }, - "_npmVersion": "2.14.9", "_phantomChildren": {}, "_requested": { + "type": "range", + "registry": true, "raw": "getpass@^0.1.1", - "scope": null, - "escapedName": "getpass", "name": "getpass", + "escapedName": "getpass", "rawSpec": "^0.1.1", - "spec": ">=0.1.1 <0.2.0", - "type": "range" + "saveSpec": null, + "fetchSpec": "^0.1.1" }, "_requiredBy": [ "/sshpk" ], - "_resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", - "_shasum": "283ffd9fc1256840875311c1b60e8c40187110e6", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "_shasum": "5eff8e3e684d569ae4cb2b1282604e8ba62149fa", "_spec": "getpass@^0.1.1", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/sshpk", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/sshpk", "author": { "name": "Alex Wilson", "email": "alex.wilson@joyent.com" @@ -52,33 +29,16 @@ "bugs": { "url": "https://github.com/arekinath/node-getpass/issues" }, + "bundleDependencies": false, "dependencies": { "assert-plus": "^1.0.0" }, + "deprecated": false, "description": "getpass for node.js", - "devDependencies": { - "json": "^9.0.3", - "pty.js": "^0.3.0", - "tape": "^4.4.0" - }, - "directories": {}, - "dist": { - "shasum": "283ffd9fc1256840875311c1b60e8c40187110e6", - "tarball": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz" - }, - "gitHead": "e7fdf43ad60aa520f894d41856852aa320f36646", "homepage": "https://github.com/arekinath/node-getpass#readme", "license": "MIT", "main": "lib/index.js", - "maintainers": [ - { - "name": "arekinath", - "email": "alex@cooperi.net" - } - ], "name": "getpass", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/arekinath/node-getpass.git" @@ -86,5 +46,5 @@ "scripts": { "test": "tape test/*.test.js" }, - "version": "0.1.6" + "version": "0.1.7" } diff --git a/node_modules/graceful-readlink/.npmignore b/node_modules/graceful-readlink/.npmignore deleted file mode 100644 index 3ac7d16..0000000 --- a/node_modules/graceful-readlink/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.idea/ -.DS_Store -node_modules/ diff --git a/node_modules/graceful-readlink/.travis.yml b/node_modules/graceful-readlink/.travis.yml deleted file mode 100644 index baf9be7..0000000 --- a/node_modules/graceful-readlink/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.12" - - "io.js" diff --git a/node_modules/graceful-readlink/LICENSE b/node_modules/graceful-readlink/LICENSE deleted file mode 100644 index d1f842f..0000000 --- a/node_modules/graceful-readlink/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Zhiye Li - -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/graceful-readlink/README.md b/node_modules/graceful-readlink/README.md deleted file mode 100644 index fc63b50..0000000 --- a/node_modules/graceful-readlink/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# graceful-readlink -[![NPM Version](http://img.shields.io/npm/v/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink) -[![NPM Downloads](https://img.shields.io/npm/dm/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink) - - -## Usage - -```js -var readlinkSync = require('graceful-readlink').readlinkSync; -console.log(readlinkSync(f)); -// output -// the file pointed to when `f` is a symbolic link -// the `f` itself when `f` is not a symbolic link -``` -## Licence - -MIT License diff --git a/node_modules/graceful-readlink/index.js b/node_modules/graceful-readlink/index.js deleted file mode 100644 index 7e9fc70..0000000 --- a/node_modules/graceful-readlink/index.js +++ /dev/null @@ -1,12 +0,0 @@ -var fs = require('fs') - , lstat = fs.lstatSync; - -exports.readlinkSync = function (p) { - if (lstat(p).isSymbolicLink()) { - return fs.readlinkSync(p); - } else { - return p; - } -}; - - diff --git a/node_modules/graceful-readlink/package.json b/node_modules/graceful-readlink/package.json deleted file mode 100644 index 783a829..0000000 --- a/node_modules/graceful-readlink/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "graceful-readlink@>= 1.0.0", - "scope": null, - "escapedName": "graceful-readlink", - "name": "graceful-readlink", - "rawSpec": ">= 1.0.0", - "spec": ">=1.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/commander" - ] - ], - "_from": "graceful-readlink@>=1.0.0", - "_id": "graceful-readlink@1.0.1", - "_inCache": true, - "_location": "/graceful-readlink", - "_nodeVersion": "0.11.14", - "_npmUser": { - "name": "zhiyelee", - "email": "zhiyelee@gmail.com" - }, - "_npmVersion": "2.1.17", - "_phantomChildren": {}, - "_requested": { - "raw": "graceful-readlink@>= 1.0.0", - "scope": null, - "escapedName": "graceful-readlink", - "name": "graceful-readlink", - "rawSpec": ">= 1.0.0", - "spec": ">=1.0.0", - "type": "range" - }, - "_requiredBy": [ - "/commander" - ], - "_resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "_shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725", - "_shrinkwrap": null, - "_spec": "graceful-readlink@>= 1.0.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/commander", - "author": { - "name": "zhiyelee" - }, - "bugs": { - "url": "https://github.com/zhiyelee/graceful-readlink/issues" - }, - "dependencies": {}, - "description": "graceful fs.readlink", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725", - "tarball": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz" - }, - "gitHead": "f6655275bebef706fb63fd01b5f062a7052419a5", - "homepage": "https://github.com/zhiyelee/graceful-readlink", - "keywords": [ - "fs.readlink", - "readlink" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "zhiyelee", - "email": "zhiyelee@gmail.com" - } - ], - "name": "graceful-readlink", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/zhiyelee/graceful-readlink.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "version": "1.0.1" -} diff --git a/node_modules/har-validator/README.md b/node_modules/har-validator/README.md index 91526e6..fc69634 100644 --- a/node_modules/har-validator/README.md +++ b/node_modules/har-validator/README.md @@ -1,291 +1,45 @@ -# HAR Validator [![version][npm-version]][npm-url] [![License][npm-license]][license-url] +# HAR Validator [![version][npm-version]][npm-url] [![License][license-image]][license-url] -Extremely fast HTTP Archive ([HAR](http://www.softwareishard.com/blog/har-12-spec/)) validator using JSON Schema. +> Extremely fast HTTP Archive ([HAR](https://github.com/ahmadnassri/har-spec/blob/master/versions/1.2.md)) validator using JSON Schema. [![Build Status][travis-image]][travis-url] [![Downloads][npm-downloads]][npm-url] [![Code Climate][codeclimate-quality]][codeclimate-url] [![Coverage Status][codeclimate-coverage]][codeclimate-url] +[![Dependency Status][dependencyci-image]][dependencyci-url] [![Dependencies][david-image]][david-url] ## Install -```shell -# to use in cli -npm install --global har-validator - -# to use as a module -npm install --save har-validator +```bash +npm install --only=production --save har-validator ``` -## Usage +## CLI Usage -``` - - Usage: har-validator [options] - - Options: - - -h, --help output usage information - -V, --version output the version number - -s, --schema [name] validate schema name (log, request, response, etc ...) - -``` - -###### Example - -```shell -har-validator har.json - -har-validator --schema request request.json -``` +Please refer to [`har-cli`](https://github.com/ahmadnassri/har-cli) for more info. ## API -**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. *For backward comptability with `v1.x` an [async/callback API](#callback-api) is provided* +**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. *For backward compatibility with `v1.x` an [async/callback API](docs/async.md) is also provided* -### Validate(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a full [HAR](http://www.softwareishard.com/blog/har-12-spec/) object - -```js -validate(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.log(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [log](http://www.softwareishard.com/blog/har-12-spec/#log) object - -```js -validate.log(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.cache(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [cache](http://www.softwareishard.com/blog/har-12-spec/#cache) object - -```js -validate.cache(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.cacheEntry(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a ["beforeRequest" or "afterRequest"](http://www.softwareishard.com/blog/har-12-spec/#cache) objects - -```js -validate.cacheEntry(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.content(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [content](http://www.softwareishard.com/blog/har-12-spec/#content) object - -```js -validate.content(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.cookie(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [cookie](http://www.softwareishard.com/blog/har-12-spec/#cookies) object - -```js -validate.cookie(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.creator(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [creator](http://www.softwareishard.com/blog/har-12-spec/#creator) object - -```js -validate.creator(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.entry(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - an [entry](http://www.softwareishard.com/blog/har-12-spec/#entries) object - -```js -validate.entry(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.log(data) - -alias of [`Validate(data)`](#validate-data-callback-) - -### Validate.page(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [page](http://www.softwareishard.com/blog/har-12-spec/#pages) object - -```js -validate.page(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.pageTimings(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [pageTimings](http://www.softwareishard.com/blog/har-12-spec/#pageTimings) object - -```js -validate.pageTimings(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.postData(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [postData](http://www.softwareishard.com/blog/har-12-spec/#postData) object - -```js -validate.postData(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.record(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [record](http://www.softwareishard.com/blog/har-12-spec/#headers) object - -```js -validate.record(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.request(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [request](http://www.softwareishard.com/blog/har-12-spec/#request) object - -```js -validate.request(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.response(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [response](http://www.softwareishard.com/blog/har-12-spec/#response) object - -```js -validate.cacheEntry(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.timings(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [timings](http://www.softwareishard.com/blog/har-12-spec/#timings) object - -```js -validate.timings(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` +- [async API](docs/async.md) +- [callback API](docs/async.md) +- [Promise API](docs/promise.md) *(default)* ---- +> :copyright: [ahmadnassri.com](https://www.ahmadnassri.com/)  ·  +> License: [ISC][license-url]  ·  +> Github: [@ahmadnassri](https://github.com/ahmadnassri)  ·  +> Twitter: [@ahmadnassri](https://twitter.com/ahmadnassri) -## Callback API - -### Validate(data [, callback]) - -> Returns `true` or `false`. - -```js -var HAR = require('./har.json'); -var validate = require('har-validator/lib/async'); - -validate(HAR, function (e, valid) { - if (e) console.log(e.errors) - - if (valid) console.log('horray!'); -}); - -``` -The async API provides exactly the same methods as the [Promise API](#promise-api) - ----- - -## Support - -Donations are welcome to help support the continuous development of this project. - -[![Gratipay][gratipay-image]][gratipay-url] -[![PayPal][paypal-image]][paypal-url] -[![Flattr][flattr-image]][flattr-url] -[![Bitcoin][bitcoin-image]][bitcoin-url] - -## License - -[ISC License](LICENSE) © [Ahmad Nassri](https://www.ahmadnassri.com/) - -[license-url]: https://github.com/ahmadnassri/har-validator/blob/master/LICENSE +[license-url]: http://choosealicense.com/licenses/isc/ +[license-image]: https://img.shields.io/github/license/ahmadnassri/har-validator.svg?style=flat-square [travis-url]: https://travis-ci.org/ahmadnassri/har-validator [travis-image]: https://img.shields.io/travis/ahmadnassri/har-validator.svg?style=flat-square [npm-url]: https://www.npmjs.com/package/har-validator -[npm-license]: https://img.shields.io/npm/l/har-validator.svg?style=flat-square [npm-version]: https://img.shields.io/npm/v/har-validator.svg?style=flat-square [npm-downloads]: https://img.shields.io/npm/dm/har-validator.svg?style=flat-square @@ -296,14 +50,5 @@ Donations are welcome to help support the continuous development of this project [david-url]: https://david-dm.org/ahmadnassri/har-validator [david-image]: https://img.shields.io/david/ahmadnassri/har-validator.svg?style=flat-square -[gratipay-url]: https://www.gratipay.com/ahmadnassri/ -[gratipay-image]: https://img.shields.io/gratipay/ahmadnassri.svg?style=flat-square - -[paypal-url]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UJ2B2BTK9VLRS&on0=project&os0=har-validator -[paypal-image]: http://img.shields.io/badge/paypal-donate-green.svg?style=flat-square - -[flattr-url]: https://flattr.com/submit/auto?user_id=ahmadnassri&url=https://github.com/ahmadnassri/har-validator&title=har-validator&language=&tags=github&category=software -[flattr-image]: http://img.shields.io/badge/flattr-donate-green.svg?style=flat-square - -[bitcoin-image]: http://img.shields.io/badge/bitcoin-1Nb46sZRVG3or7pNaDjthcGJpWhvoPpCxy-green.svg?style=flat-square -[bitcoin-url]: https://www.coinbase.com/checkouts/ae383ae6bb931a2fa5ad11cec115191e?name=har-validator +[dependencyci-url]: https://dependencyci.com/github/ahmadnassri/har-validator +[dependencyci-image]: https://dependencyci.com/github/ahmadnassri/har-validator/badge?style=flat-square diff --git a/node_modules/har-validator/bin/har-validator b/node_modules/har-validator/bin/har-validator deleted file mode 100755 index fd7cc0d..0000000 --- a/node_modules/har-validator/bin/har-validator +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env node - -'use strict' - -var chalk = require('chalk') -var cmd = require('commander') -var fs = require('fs') -var path = require('path') -var pkg = require('../package.json') -var Promise = require('pinkie-promise') -var validate = require('..') -var ValidationError = require('../lib/error') - -cmd - .version(pkg.version) - .usage('[options] ') - .option('-s, --schema [name]', 'validate schema name (log, request, response, etc ...)') - .parse(process.argv) - -if (!cmd.args.length) { - cmd.help() -} - -cmd.args.map(function (fileName) { - var file = chalk.yellow.italic(path.basename(fileName)) - - new Promise(function (resolve, reject) { - fs.readFile(fileName, function (err, data) { - return err === null ? resolve(data) : reject(err) - }) - }) - - .then(JSON.parse) - - .then(cmd.schema ? validate[cmd.schema] : validate) - - .then(function (data) { - console.log('%s [%s] is valid', chalk.green('✓'), file) - }) - - .catch(function (err) { - if (err instanceof SyntaxError) { - return console.error('%s [%s] failed to read JSON: %s', chalk.red('✖'), file, chalk.red(err.message)) - } - - if (err instanceof ValidationError) { - err.errors.forEach(function (details) { - console.error('%s [%s] failed validation: (%s: %s) %s', chalk.red('✖'), file, chalk.cyan.italic(details.field), chalk.magenta.italic(details.value), chalk.red(details.message)) - }) - - return - } - - console.error('%s [%s] an unknown error has occured: %s', chalk.red('✖'), file, chalk.red(err.message)) - }) -}) diff --git a/node_modules/har-validator/lib/async.js b/node_modules/har-validator/lib/async.js index 77b99a7..fc41667 100644 --- a/node_modules/har-validator/lib/async.js +++ b/node_modules/har-validator/lib/async.js @@ -1,14 +1,98 @@ -'use strict' +var Ajv = require('ajv') +var HARError = require('./error') +var schemas = require('har-schema') -var runner = require('./runner') -var schemas = require('./schemas') +var ajv -module.exports = function (data, cb) { - return runner(schemas.har, data, cb) +function validate (name, data, next) { + data = data || {} + + // validator config + ajv = ajv || new Ajv({ + allErrors: true, + schemas: schemas + }) + + var validate = ajv.getSchema(name + '.json') + + var valid = validate(data) + + // callback? + if (typeof next === 'function') { + return next(!valid ? new HARError(validate.errors) : null, valid) + } + + return valid } -Object.keys(schemas).map(function (name) { - module.exports[name] = function (data, cb) { - return runner(schemas[name], data, cb) - } -}) +exports.afterRequest = function (data, next) { + return validate('afterRequest', data, next) +} + +exports.beforeRequest = function (data, next) { + return validate('beforeRequest', data, next) +} + +exports.browser = function (data, next) { + return validate('browser', data, next) +} + +exports.cache = function (data, next) { + return validate('cache', data, next) +} + +exports.content = function (data, next) { + return validate('content', data, next) +} + +exports.cookie = function (data, next) { + return validate('cookie', data, next) +} + +exports.creator = function (data, next) { + return validate('creator', data, next) +} + +exports.entry = function (data, next) { + return validate('entry', data, next) +} + +exports.har = function (data, next) { + return validate('har', data, next) +} + +exports.header = function (data, next) { + return validate('header', data, next) +} + +exports.log = function (data, next) { + return validate('log', data, next) +} + +exports.page = function (data, next) { + return validate('page', data, next) +} + +exports.pageTimings = function (data, next) { + return validate('pageTimings', data, next) +} + +exports.postData = function (data, next) { + return validate('postData', data, next) +} + +exports.query = function (data, next) { + return validate('query', data, next) +} + +exports.request = function (data, next) { + return validate('request', data, next) +} + +exports.response = function (data, next) { + return validate('response', data, next) +} + +exports.timings = function (data, next) { + return validate('timings', data, next) +} diff --git a/node_modules/har-validator/lib/error.js b/node_modules/har-validator/lib/error.js index fc08a87..f2618dc 100644 --- a/node_modules/har-validator/lib/error.js +++ b/node_modules/har-validator/lib/error.js @@ -1,10 +1,17 @@ -'use strict' +function HARError (errors) { + var message = 'validation failed' -function ValidationError (errors) { - this.name = 'ValidationError' + this.name = 'HARError' + this.message = message this.errors = errors + + if (typeof Error.captureStackTrace === 'function') { + Error.captureStackTrace(this, this.constructor) + } else { + this.stack = (new Error(message)).stack + } } -ValidationError.prototype = Error.prototype +HARError.prototype = Error.prototype -module.exports = ValidationError +module.exports = HARError diff --git a/node_modules/har-validator/lib/index.js b/node_modules/har-validator/lib/index.js deleted file mode 100644 index e8351b8..0000000 --- a/node_modules/har-validator/lib/index.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict' - -var Promise = require('pinkie-promise') -var runner = require('./runner') -var schemas = require('./schemas') - -var promisify = function (schema) { - return function (data) { - return new Promise(function (resolve, reject) { - runner(schema, data, function (err, valid) { - return err === null ? resolve(data) : reject(err) - }) - }) - } -} - -module.exports = promisify(schemas.har) - -// utility methods for all parts of the schema -Object.keys(schemas).map(function (name) { - module.exports[name] = promisify(schemas[name]) -}) diff --git a/node_modules/har-validator/lib/runner.js b/node_modules/har-validator/lib/runner.js deleted file mode 100644 index f0ed484..0000000 --- a/node_modules/har-validator/lib/runner.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict' - -var schemas = require('./schemas') -var ValidationError = require('./error') -var validator = require('is-my-json-valid') - -module.exports = function (schema, data, cb) { - // default value - var valid = false - - // validator config - var validate = validator(schema, { - greedy: true, - verbose: true, - schemas: schemas - }) - - // execute is-my-json-valid - if (data !== undefined) { - valid = validate(data) - } - - // callback? - if (typeof cb === 'function') { - return cb(validate.errors ? new ValidationError(validate.errors) : null, valid) - } - - return valid -} diff --git a/node_modules/har-validator/lib/schemas/cache.json b/node_modules/har-validator/lib/schemas/cache.json deleted file mode 100644 index a3ab682..0000000 --- a/node_modules/har-validator/lib/schemas/cache.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "properties": { - "beforeRequest": { - "$ref": "#cacheEntry" - }, - "afterRequest": { - "$ref": "#cacheEntry" - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/cacheEntry.json b/node_modules/har-validator/lib/schemas/cacheEntry.json deleted file mode 100644 index a397439..0000000 --- a/node_modules/har-validator/lib/schemas/cacheEntry.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "oneOf": [{ - "type": "object", - "optional": true, - "required": [ - "lastAccess", - "eTag", - "hitCount" - ], - "properties": { - "expires": { - "type": "string" - }, - "lastAccess": { - "type": "string" - }, - "eTag": { - "type": "string" - }, - "hitCount": { - "type": "integer" - }, - "comment": { - "type": "string" - } - } - }, { - "type": null, - "additionalProperties": false - }] -} diff --git a/node_modules/har-validator/lib/schemas/content.json b/node_modules/har-validator/lib/schemas/content.json deleted file mode 100644 index 3710d79..0000000 --- a/node_modules/har-validator/lib/schemas/content.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "type": "object", - "required": [ - "size", - "mimeType" - ], - "properties": { - "size": { - "type": "integer" - }, - "compression": { - "type": "integer" - }, - "mimeType": { - "type": "string" - }, - "text": { - "type": "string" - }, - "encoding": { - "type": "string" - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/cookie.json b/node_modules/har-validator/lib/schemas/cookie.json deleted file mode 100644 index 5768181..0000000 --- a/node_modules/har-validator/lib/schemas/cookie.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "type": "object", - "required": [ - "name", - "value" - ], - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - }, - "path": { - "type": "string" - }, - "domain": { - "type": "string" - }, - "expires": { - "type": ["string", "null"], - "format": "date-time" - }, - "httpOnly": { - "type": "boolean" - }, - "secure": { - "type": "boolean" - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/creator.json b/node_modules/har-validator/lib/schemas/creator.json deleted file mode 100644 index 5058600..0000000 --- a/node_modules/har-validator/lib/schemas/creator.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "object", - "required": [ - "name", - "version" - ], - "properties": { - "name": { - "type": "string" - }, - "version": { - "type": "string" - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/entry.json b/node_modules/har-validator/lib/schemas/entry.json deleted file mode 100644 index 8a9c022..0000000 --- a/node_modules/har-validator/lib/schemas/entry.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "type": "object", - "optional": true, - "required": [ - "startedDateTime", - "time", - "request", - "response", - "cache", - "timings" - ], - "properties": { - "pageref": { - "type": "string" - }, - "startedDateTime": { - "type": "string", - "format": "date-time", - "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))" - }, - "time": { - "type": "number", - "min": 0 - }, - "request": { - "$ref": "#request" - }, - "response": { - "$ref": "#response" - }, - "cache": { - "$ref": "#cache" - }, - "timings": { - "$ref": "#timings" - }, - "serverIPAddress": { - "type": "string", - "oneOf": [ - { "format": "ipv4" }, - { "format": "ipv6" } - ] - }, - "connection": { - "type": "string" - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/har.json b/node_modules/har-validator/lib/schemas/har.json deleted file mode 100644 index b542782..0000000 --- a/node_modules/har-validator/lib/schemas/har.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "type": "object", - "required": [ - "log" - ], - "properties": { - "log": { - "$ref": "#log" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/index.js b/node_modules/har-validator/lib/schemas/index.js deleted file mode 100644 index 7b6db7d..0000000 --- a/node_modules/har-validator/lib/schemas/index.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict' - -var schemas = { - cache: require('./cache.json'), - cacheEntry: require('./cacheEntry.json'), - content: require('./content.json'), - cookie: require('./cookie.json'), - creator: require('./creator.json'), - entry: require('./entry.json'), - har: require('./har.json'), - log: require('./log.json'), - page: require('./page.json'), - pageTimings: require('./pageTimings.json'), - postData: require('./postData.json'), - record: require('./record.json'), - request: require('./request.json'), - response: require('./response.json'), - timings: require('./timings.json') -} - -// is-my-json-valid does not provide meaningful error messages for external schemas -// this is a workaround -schemas.cache.properties.beforeRequest = schemas.cacheEntry -schemas.cache.properties.afterRequest = schemas.cacheEntry - -schemas.page.properties.pageTimings = schemas.pageTimings - -schemas.request.properties.cookies.items = schemas.cookie -schemas.request.properties.headers.items = schemas.record -schemas.request.properties.queryString.items = schemas.record -schemas.request.properties.postData = schemas.postData - -schemas.response.properties.cookies.items = schemas.cookie -schemas.response.properties.headers.items = schemas.record -schemas.response.properties.content = schemas.content - -schemas.entry.properties.request = schemas.request -schemas.entry.properties.response = schemas.response -schemas.entry.properties.cache = schemas.cache -schemas.entry.properties.timings = schemas.timings - -schemas.log.properties.creator = schemas.creator -schemas.log.properties.browser = schemas.creator -schemas.log.properties.pages.items = schemas.page -schemas.log.properties.entries.items = schemas.entry - -schemas.har.properties.log = schemas.log - -module.exports = schemas diff --git a/node_modules/har-validator/lib/schemas/log.json b/node_modules/har-validator/lib/schemas/log.json deleted file mode 100644 index 0c91d38..0000000 --- a/node_modules/har-validator/lib/schemas/log.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "type": "object", - "required": [ - "version", - "creator", - "entries" - ], - "properties": { - "version": { - "type": "string" - }, - "creator": { - "$ref": "#creator" - }, - "browser": { - "$ref": "#creator" - }, - "pages": { - "type": "array", - "items": { - "$ref": "#page" - } - }, - "entries": { - "type": "array", - "items": { - "$ref": "#entry" - } - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/page.json b/node_modules/har-validator/lib/schemas/page.json deleted file mode 100644 index ef64abe..0000000 --- a/node_modules/har-validator/lib/schemas/page.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "type": "object", - "optional": true, - "required": [ - "startedDateTime", - "id", - "title", - "pageTimings" - ], - "properties": { - "startedDateTime": { - "type": "string", - "format": "date-time", - "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))" - }, - "id": { - "type": "string", - "unique": true - }, - "title": { - "type": "string" - }, - "pageTimings": { - "$ref": "#pageTimings" - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/pageTimings.json b/node_modules/har-validator/lib/schemas/pageTimings.json deleted file mode 100644 index adc83cc..0000000 --- a/node_modules/har-validator/lib/schemas/pageTimings.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "object", - "properties": { - "onContentLoad": { - "type": "number", - "min": -1 - }, - "onLoad": { - "type": "number", - "min": -1 - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/postData.json b/node_modules/har-validator/lib/schemas/postData.json deleted file mode 100644 index 91958b6..0000000 --- a/node_modules/har-validator/lib/schemas/postData.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "type": "object", - "optional": true, - "required": [ - "mimeType" - ], - "properties": { - "mimeType": { - "type": "string" - }, - "text": { - "type": "string" - }, - "params": { - "type": "array", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - }, - "fileName": { - "type": "string" - }, - "contentType": { - "type": "string" - }, - "comment": { - "type": "string" - } - } - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/record.json b/node_modules/har-validator/lib/schemas/record.json deleted file mode 100644 index 04acd51..0000000 --- a/node_modules/har-validator/lib/schemas/record.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "object", - "required": [ - "name", - "value" - ], - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/request.json b/node_modules/har-validator/lib/schemas/request.json deleted file mode 100644 index 639af06..0000000 --- a/node_modules/har-validator/lib/schemas/request.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "type": "object", - "required": [ - "method", - "url", - "httpVersion", - "cookies", - "headers", - "queryString", - "headersSize", - "bodySize" - ], - "properties": { - "method": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - }, - "httpVersion": { - "type": "string" - }, - "cookies": { - "type": "array", - "items": { - "$ref": "#cookie" - } - }, - "headers": { - "type": "array", - "items": { - "$ref": "#record" - } - }, - "queryString": { - "type": "array", - "items": { - "$ref": "#record" - } - }, - "postData": { - "$ref": "#postData" - }, - "headersSize": { - "type": "integer" - }, - "bodySize": { - "type": "integer" - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/response.json b/node_modules/har-validator/lib/schemas/response.json deleted file mode 100644 index de99c55..0000000 --- a/node_modules/har-validator/lib/schemas/response.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "type": "object", - "required": [ - "status", - "statusText", - "httpVersion", - "cookies", - "headers", - "content", - "redirectURL", - "headersSize", - "bodySize" - ], - "properties": { - "status": { - "type": "integer" - }, - "statusText": { - "type": "string" - }, - "httpVersion": { - "type": "string" - }, - "cookies": { - "type": "array", - "items": { - "$ref": "#cookie" - } - }, - "headers": { - "type": "array", - "items": { - "$ref": "#record" - } - }, - "content": { - "$ref": "#content" - }, - "redirectURL": { - "type": "string" - }, - "headersSize": { - "type": "integer" - }, - "bodySize": { - "type": "integer" - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/lib/schemas/timings.json b/node_modules/har-validator/lib/schemas/timings.json deleted file mode 100644 index 066ef71..0000000 --- a/node_modules/har-validator/lib/schemas/timings.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "required": [ - "send", - "wait", - "receive" - ], - "properties": { - "dns": { - "type": "number", - "min": -1 - }, - "connect": { - "type": "number", - "min": -1 - }, - "blocked": { - "type": "number", - "min": -1 - }, - "send": { - "type": "number", - "min": -1 - }, - "wait": { - "type": "number", - "min": -1 - }, - "receive": { - "type": "number", - "min": -1 - }, - "ssl": { - "type": "number", - "min": -1 - }, - "comment": { - "type": "string" - } - } -} diff --git a/node_modules/har-validator/package.json b/node_modules/har-validator/package.json index a068f4a..729650e 100644 --- a/node_modules/har-validator/package.json +++ b/node_modules/har-validator/package.json @@ -1,120 +1,75 @@ { - "_args": [ - [ - { - "raw": "har-validator@~2.0.6", - "scope": null, - "escapedName": "har-validator", - "name": "har-validator", - "rawSpec": "~2.0.6", - "spec": ">=2.0.6 <2.1.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/request" - ] - ], - "_from": "har-validator@>=2.0.6 <2.1.0", - "_id": "har-validator@2.0.6", - "_inCache": true, + "_from": "har-validator@~5.0.3", + "_id": "har-validator@5.0.3", + "_inBundle": false, + "_integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "_location": "/har-validator", - "_nodeVersion": "5.2.0", - "_npmUser": { - "name": "ahmadnassri", - "email": "ahmad@ahmadnassri.com" - }, - "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { - "raw": "har-validator@~2.0.6", - "scope": null, - "escapedName": "har-validator", + "type": "range", + "registry": true, + "raw": "har-validator@~5.0.3", "name": "har-validator", - "rawSpec": "~2.0.6", - "spec": ">=2.0.6 <2.1.0", - "type": "range" + "escapedName": "har-validator", + "rawSpec": "~5.0.3", + "saveSpec": null, + "fetchSpec": "~5.0.3" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "_shasum": "cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d", - "_shrinkwrap": null, - "_spec": "har-validator@~2.0.6", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/request", + "_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "_shasum": "ba402c266194f15956ef15e0fcf242993f6a7dfd", + "_spec": "har-validator@~5.0.3", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/request", "author": { "name": "Ahmad Nassri", "email": "ahmad@ahmadnassri.com", "url": "https://www.ahmadnassri.com/" }, - "bin": { - "har-validator": "bin/har-validator" - }, "bugs": { "url": "https://github.com/ahmadnassri/har-validator/issues" }, + "bundleDependencies": false, "dependencies": { - "chalk": "^1.1.1", - "commander": "^2.9.0", - "is-my-json-valid": "^2.12.4", - "pinkie-promise": "^2.0.0" + "ajv": "^5.1.0", + "har-schema": "^2.0.0" }, + "deprecated": false, "description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema", "devDependencies": { - "codeclimate-test-reporter": "0.2.1", - "echint": "^1.5.1", - "istanbul": "^0.4.2", - "mocha": "^2.3.4", - "require-directory": "^2.1.1", - "should": "^8.1.1", - "standard": "^5.4.1" - }, - "directories": {}, - "dist": { - "shasum": "cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d", - "tarball": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz" - }, - "echint": { - "ignore": [ - "coverage/**" - ] + "echint": "^4.0.1", + "standard": "^10.0.2", + "tap": "^10.3.2" }, "engines": { - "node": ">=0.10" + "node": ">=4" }, "files": [ - "bin", "lib" ], - "gitHead": "92ccddad2e5d13e6e32c764e06c347d67805b211", "homepage": "https://github.com/ahmadnassri/har-validator", "keywords": [ "har", + "cli", + "ajv", "http", "archive", "validate", "validator" ], "license": "ISC", - "main": "lib/index", - "maintainers": [ - { - "name": "ahmadnassri", - "email": "ahmad@ahmadnassri.com" - } - ], + "main": "lib/promise.js", "name": "har-validator", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/ahmadnassri/har-validator.git" }, "scripts": { - "codeclimate": "codeclimate < coverage/lcov.info", - "coverage": "istanbul cover --dir coverage _mocha -- -R dot", - "posttest": "npm run coverage", - "pretest": "standard && echint", - "test": "mocha" + "coverage": "tap test --reporter silent --coverage", + "lint": "standard && echint", + "pretest": "npm run lint", + "test": "tap test" }, - "version": "2.0.6" + "version": "5.0.3" } diff --git a/node_modules/has-ansi/index.js b/node_modules/has-ansi/index.js deleted file mode 100644 index 98fae06..0000000 --- a/node_modules/has-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -var ansiRegex = require('ansi-regex'); -var re = new RegExp(ansiRegex().source); // remove the `g` flag -module.exports = re.test.bind(re); diff --git a/node_modules/has-ansi/license b/node_modules/has-ansi/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/has-ansi/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/has-ansi/package.json b/node_modules/has-ansi/package.json deleted file mode 100644 index fb30e08..0000000 --- a/node_modules/has-ansi/package.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "has-ansi@^2.0.0", - "scope": null, - "escapedName": "has-ansi", - "name": "has-ansi", - "rawSpec": "^2.0.0", - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/chalk" - ] - ], - "_from": "has-ansi@>=2.0.0 <3.0.0", - "_id": "has-ansi@2.0.0", - "_inCache": true, - "_location": "/has-ansi", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "_npmVersion": "2.11.2", - "_phantomChildren": {}, - "_requested": { - "raw": "has-ansi@^2.0.0", - "scope": null, - "escapedName": "has-ansi", - "name": "has-ansi", - "rawSpec": "^2.0.0", - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/chalk" - ], - "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", - "_shrinkwrap": null, - "_spec": "has-ansi@^2.0.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/chalk", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/has-ansi/issues" - }, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "description": "Check if a string has ANSI escape codes", - "devDependencies": { - "ava": "0.0.4" - }, - "directories": {}, - "dist": { - "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", - "tarball": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9", - "homepage": "https://github.com/sindresorhus/has-ansi", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern", - "has" - ], - "license": "MIT", - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "name": "has-ansi", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/has-ansi.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "2.0.0" -} diff --git a/node_modules/has-ansi/readme.md b/node_modules/has-ansi/readme.md deleted file mode 100644 index 02bc7c2..0000000 --- a/node_modules/has-ansi/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) - -> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install --save has-ansi -``` - - -## Usage - -```js -var hasAnsi = require('has-ansi'); - -hasAnsi('\u001b[4mcake\u001b[0m'); -//=> true - -hasAnsi('cake'); -//=> false -``` - - -## Related - -- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module -- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes -- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/hawk/.npmignore b/node_modules/hawk/.npmignore old mode 100644 new mode 100755 index 96ed091..7144676 --- a/node_modules/hawk/.npmignore +++ b/node_modules/hawk/.npmignore @@ -1,20 +1,5 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -components -build -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov - +* +!lib/** +!dist/** +!client.js +!.npmignore diff --git a/node_modules/hawk/.travis.yml b/node_modules/hawk/.travis.yml deleted file mode 100755 index 40ca59e..0000000 --- a/node_modules/hawk/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js - -node_js: - - 0.10 - diff --git a/node_modules/hawk/LICENSE b/node_modules/hawk/LICENSE index 7880936..b43dce1 100755 --- a/node_modules/hawk/LICENSE +++ b/node_modules/hawk/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012-2014, Eran Hammer and other contributors. +Copyright (c) 2012-2017, Eran Hammer and Project contributors All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/node_modules/hawk/README.md b/node_modules/hawk/README.md index b92cd7c..fc5dd6d 100755 --- a/node_modules/hawk/README.md +++ b/node_modules/hawk/README.md @@ -1,634 +1,637 @@ -![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png) - - **Hawk** is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial -HTTP request cryptographic verification. For more complex use cases such as access delegation, see [Oz](https://github.com/hueniverse/oz). - -Current version: **3.x** - -Note: 3.x and 2.x are the same exact protocol as 1.1. The version increments reflect changes in the node API. - -[![Build Status](https://secure.travis-ci.org/hueniverse/hawk.png)](http://travis-ci.org/hueniverse/hawk) - -# Table of Content - -- [**Introduction**](#introduction) - - [Replay Protection](#replay-protection) - - [Usage Example](#usage-example) - - [Protocol Example](#protocol-example) - - [Payload Validation](#payload-validation) - - [Response Payload Validation](#response-payload-validation) - - [Browser Support and Considerations](#browser-support-and-considerations) -

    -- [**Single URI Authorization**](#single-uri-authorization) - - [Usage Example](#bewit-usage-example) -

    -- [**Security Considerations**](#security-considerations) - - [MAC Keys Transmission](#mac-keys-transmission) - - [Confidentiality of Requests](#confidentiality-of-requests) - - [Spoofing by Counterfeit Servers](#spoofing-by-counterfeit-servers) - - [Plaintext Storage of Credentials](#plaintext-storage-of-credentials) - - [Entropy of Keys](#entropy-of-keys) - - [Coverage Limitations](#coverage-limitations) - - [Future Time Manipulation](#future-time-manipulation) - - [Client Clock Poisoning](#client-clock-poisoning) - - [Bewit Limitations](#bewit-limitations) - - [Host Header Forgery](#host-header-forgery) -

    -- [**Frequently Asked Questions**](#frequently-asked-questions) -

    -- [**Implementations**](#implementations) -- [**Acknowledgements**](#acknowledgements) - -# Introduction - -**Hawk** is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with -partial cryptographic verification of the request and response, covering the HTTP method, request URI, host, -and optionally the request payload. - -Similar to the HTTP [Digest access authentication schemes](http://www.ietf.org/rfc/rfc2617.txt), **Hawk** uses a set of -client credentials which include an identifier (e.g. username) and key (e.g. password). Likewise, just as with the Digest scheme, -the key is never included in authenticated requests. Instead, it is used to calculate a request MAC value which is -included in its place. - -However, **Hawk** has several differences from Digest. In particular, while both use a nonce to limit the possibility of -replay attacks, in **Hawk** the client generates the nonce and uses it in combination with a timestamp, leading to less -"chattiness" (interaction with the server). - -Also unlike Digest, this scheme is not intended to protect the key itself (the password in Digest) because -the client and server must both have access to the key material in the clear. - -The primary design goals of this scheme are to: -* simplify and improve HTTP authentication for services that are unwilling or unable to deploy TLS for all resources, -* secure credentials against leakage (e.g., when the client uses some form of dynamic configuration to determine where - to send an authenticated request), and -* avoid the exposure of credentials sent to a malicious server over an unauthenticated secure channel due to client - failure to validate the server's identity as part of its TLS handshake. - -In addition, **Hawk** supports a method for granting third-parties temporary access to individual resources using -a query parameter called _bewit_ (in falconry, a leather strap used to attach a tracking device to the leg of a hawk). - -The **Hawk** scheme requires the establishment of a shared symmetric key between the client and the server, -which is beyond the scope of this module. Typically, the shared credentials are established via an initial -TLS-protected phase or derived from some other shared confidential information available to both the client -and the server. - - -## Replay Protection - -Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more -than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when -making requests. This gives the server enough information to prevent replay attacks. - -The nonce is generated by the client, and is a string unique across all requests with the same timestamp and -key identifier combination. - -The timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards -are rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks. -By default, **Hawk** uses a time window of 1 minute to allow for time skew between the client and server (which in -practice translates to a maximum of 2 minutes as the skew can be positive or negative). - -Using a timestamp requires the client's clock to be in sync with the server's clock. **Hawk** requires both the client -clock and the server clock to use NTP to ensure synchronization. However, given the limitations of some client types -(e.g. browsers) to deploy NTP, the server provides the client with its current time (in seconds precision) in response -to a bad timestamp. - -There is no expectation that the client will adjust its system clock to match the server (in fact, this would be a -potential attack vector). Instead, the client only uses the server's time to calculate an offset used only -for communications with that particular server. The protocol rewards clients with synchronized clocks by reducing -the number of round trips required to authenticate the first request. - - -## Usage Example - -Server code: - -```javascript -var Http = require('http'); -var Hawk = require('hawk'); - - -// Credentials lookup function - -var credentialsFunc = function (id, callback) { - - var credentials = { - key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', - algorithm: 'sha256', - user: 'Steve' - }; - - return callback(null, credentials); -}; - -// Create HTTP server - -var handler = function (req, res) { - - // Authenticate incoming request - - Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) { - - // Prepare response - - var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!'); - var headers = { 'Content-Type': 'text/plain' }; - - // Generate Server-Authorization response header - - var header = Hawk.server.header(credentials, artifacts, { payload: payload, contentType: headers['Content-Type'] }); - headers['Server-Authorization'] = header; - - // Send the response back - - res.writeHead(!err ? 200 : 401, headers); - res.end(payload); - }); -}; - -// Start server - -Http.createServer(handler).listen(8000, 'example.com'); -``` - -Client code: - -```javascript -var Request = require('request'); -var Hawk = require('hawk'); - - -// Client credentials - -var credentials = { - id: 'dh37fgj492je', - key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', - algorithm: 'sha256' -} - -// Request options - -var requestOptions = { - uri: 'http://example.com:8000/resource/1?b=1&a=2', - method: 'GET', - headers: {} -}; - -// Generate Authorization request header - -var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'some-app-data' }); -requestOptions.headers.Authorization = header.field; - -// Send authenticated request - -Request(requestOptions, function (error, response, body) { - - // Authenticate the server's response - - var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body }); - - // Output results - - console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)')); -}); -``` - -**Hawk** utilized the [**SNTP**](https://github.com/hueniverse/sntp) module for time sync management. By default, the local -machine time is used. To automatically retrieve and synchronice the clock within the application, use the SNTP 'start()' method. - -```javascript -Hawk.sntp.start(); -``` - - -## Protocol Example - -The client attempts to access a protected resource without authentication, sending the following HTTP request to -the resource server: - -``` -GET /resource/1?b=1&a=2 HTTP/1.1 -Host: example.com:8000 -``` - -The resource server returns an authentication challenge. - -``` -HTTP/1.1 401 Unauthorized -WWW-Authenticate: Hawk -``` - -The client has previously obtained a set of **Hawk** credentials for accessing resources on the "http://example.com/" -server. The **Hawk** credentials issued to the client include the following attributes: - -* Key identifier: dh37fgj492je -* Key: werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn -* Algorithm: sha256 - -The client generates the authentication header by calculating a timestamp (e.g. the number of seconds since January 1, -1970 00:00:00 GMT), generating a nonce, and constructing the normalized request string (each value followed by a newline -character): - -``` -hawk.1.header -1353832234 -j4h3g2 -GET -/resource/1?b=1&a=2 -example.com -8000 - -some-app-ext-data - -``` - -The request MAC is calculated using HMAC with the specified hash algorithm "sha256" and the key over the normalized request string. -The result is base64-encoded to produce the request MAC: - -``` -6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE= -``` - -The client includes the **Hawk** key identifier, timestamp, nonce, application specific data, and request MAC with the request using -the HTTP `Authorization` request header field: - -``` -GET /resource/1?b=1&a=2 HTTP/1.1 -Host: example.com:8000 -Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=" -``` - -The server validates the request by calculating the request MAC again based on the request received and verifies the validity -and scope of the **Hawk** credentials. If valid, the server responds with the requested resource. - - -### Payload Validation - -**Hawk** provides optional payload validation. When generating the authentication header, the client calculates a payload hash -using the specified hash algorithm. The hash is calculated over the concatenated value of (each followed by a newline character): -* `hawk.1.payload` -* the content-type in lowercase, without any parameters (e.g. `application/json`) -* the request payload prior to any content encoding (the exact representation requirements should be specified by the server for payloads other than simple single-part ascii to ensure interoperability) - -For example: - -* Payload: `Thank you for flying Hawk` -* Content Type: `text/plain` -* Hash (sha256): `Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=` - -Results in the following input to the payload hash function (newline terminated values): - -``` -hawk.1.payload -text/plain -Thank you for flying Hawk - -``` - -Which produces the following hash value: - -``` -Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY= -``` - -The client constructs the normalized request string (newline terminated values): - -``` -hawk.1.header -1353832234 -j4h3g2 -POST -/resource/1?a=1&b=2 -example.com -8000 -Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY= -some-app-ext-data - -``` - -Then calculates the request MAC and includes the **Hawk** key identifier, timestamp, nonce, payload hash, application specific data, -and request MAC, with the request using the HTTP `Authorization` request header field: - -``` -POST /resource/1?a=1&b=2 HTTP/1.1 -Host: example.com:8000 -Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", hash="Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=", ext="some-app-ext-data", mac="aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw=" -``` - -It is up to the server if and when it validates the payload for any given request, based solely on it's security policy -and the nature of the data included. - -If the payload is available at the time of authentication, the server uses the hash value provided by the client to construct -the normalized string and validates the MAC. If the MAC is valid, the server calculates the payload hash and compares the value -with the provided payload hash in the header. In many cases, checking the MAC first is faster than calculating the payload hash. - -However, if the payload is not available at authentication time (e.g. too large to fit in memory, streamed elsewhere, or processed -at a different stage in the application), the server may choose to defer payload validation for later by retaining the hash value -provided by the client after validating the MAC. - -It is important to note that MAC validation does not mean the hash value provided by the client is valid, only that the value -included in the header was not modified. Without calculating the payload hash on the server and comparing it to the value provided -by the client, the payload may be modified by an attacker. - - -## Response Payload Validation - -**Hawk** provides partial response payload validation. The server includes the `Server-Authorization` response header which enables the -client to authenticate the response and ensure it is talking to the right server. **Hawk** defines the HTTP `Server-Authorization` header -as a response header using the exact same syntax as the `Authorization` request header field. - -The header is contructed using the same process as the client's request header. The server uses the same credentials and other -artifacts provided by the client to constructs the normalized request string. The `ext` and `hash` values are replaced with -new values based on the server response. The rest as identical to those used by the client. - -The result MAC digest is included with the optional `hash` and `ext` values: - -``` -Server-Authorization: Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific" -``` - - -## Browser Support and Considerations - -A browser script is provided for including using a `'); - expect(encoded).to.equal('\\x3cscript\\x3ealert\\x281\\x29\\x3c\\x2fscript\\x3e'); - done(); - }); - - it('encodes \' characters', function (done) { - - var encoded = Hoek.escapeJavaScript('something(\'param\')'); - expect(encoded).to.equal('something\\x28\\x27param\\x27\\x29'); - done(); - }); - - it('encodes large unicode characters with the correct padding', function (done) { - - var encoded = Hoek.escapeJavaScript(String.fromCharCode(500) + String.fromCharCode(1000)); - expect(encoded).to.equal('\\u0500\\u1000'); - done(); - }); - - it('doesn\'t throw an exception when passed null', function (done) { - - var encoded = Hoek.escapeJavaScript(null); - expect(encoded).to.equal(''); - done(); - }); -}); - -describe('escapeHtml()', function () { - - it('encodes / characters', function (done) { - - var encoded = Hoek.escapeHtml(''); - expect(encoded).to.equal('<script>alert(1)</script>'); - done(); - }); - - it('encodes < and > as named characters', function (done) { - - var encoded = Hoek.escapeHtml(' +For version 1 uuids: +```html + ``` -(Note: Do not do this in production. Just don't. wzrd.in is a great service, but if you're deploying a "real" service you should be using a packaging tool like browserify or webpack. If you do go this route you would be well advised to link to a specific version instead of `uuid@latest` to avoid having your code break when we roll out breaking changes.) +For version 4 uuids: +```html + + +``` + +For version 5 uuids: + +```html + + +``` ## API -### uuid(...) +### Version 1 -Generate a V4 uuid. See uuid.v4 documentation below. +```javascript +const uuidv1 = require('uuid/v1'); -### uuid.v1([`options` [, `buffer` [, `offset`]]]) +// Allowed arguments +uuidv1(); +uuidv1(options); +uuidv1(options, buffer, offset); +``` Generate and return a RFC4122 v1 (timestamp-based) UUID. @@ -63,14 +105,12 @@ Generate and return a RFC4122 v1 (timestamp-based) UUID. Returns `buffer`, if specified, otherwise the string form of the UUID -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) +Note: The id is generated guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) Example: Generate string UUID with fully-specified options ```javascript -uuid.v1({ +uuidv1({ node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], clockseq: 0x1234, msecs: new Date('2011-11-01').getTime(), @@ -83,19 +123,26 @@ Example: In-place generation of two binary IDs ```javascript // Generate two ids in an array const arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] +uuidv1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] +uuidv1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] ``` -### uuid.v4([`options` [, `buffer` [, `offset`]]]) +### Version 4 + +```javascript +const uuidv4 = require('uuid/v4') + +// Allowed arguments +uuidv4(); +uuidv4(options); +uuidv4(options, buffer, offset); +``` Generate and return a RFC4122 v4 UUID. * `options` - (Object) Optional uuid state to apply. Properties may include: - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - + * `rng` - (Function) Random # generator function that returns an Array[16] of byte values (0-255) * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. * `offset` - (Number) Starting index in `buffer` at which to begin writing. @@ -121,12 +168,60 @@ uuid.v4(null, buffer, 0); uuid.v4(null, buffer, 16); ``` +### Version 5 + +```javascript +const uuidv5 = require('uuid/v4'); + +// Allowed arguments +uuidv5(name, namespace); +uuidv5(name, namespace, buffer); +uuidv5(name, namespace, buffer, offset); +``` + +Generate and return a RFC4122 v4 UUID. + +* `name` - (String | Array[]) "name" to create UUID with +* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0 + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Example: + +```javascript +// Generate a unique namespace (typically you would do this once, outside of +// your project, then bake this value into your code) +const uuidv4 = require('uuid/v4'); +const MY_NAMESPACE = uuidv4(); // + +// Generate a couple namespace uuids +const uuidv5 = require('uuid/v5'); +uuidv5('hello', MY_NAMESPACE); +uuidv5('world', MY_NAMESPACE); +``` + ## Testing -``` +```shell npm test ``` +## Deprecated / Browser-ready API + +The API below is available for legacy purposes and is not expected to be available post-3.X + +```javascript +const uuid = require('uuid'); + +uuid.v1(...); // alias of uuid/v1 +uuid.v4(...); // alias of uuid/v4 +uuid(...); // alias of uuid/v4 + +// uuid.v5() is not supported in this API +``` + ## Legacy node-uuid package The code for the legacy node-uuid package is available in the `node-uuid` branch. diff --git a/node_modules/uuid/bin/uuid b/node_modules/uuid/bin/uuid index f732e99..2fd26d7 100755 --- a/node_modules/uuid/bin/uuid +++ b/node_modules/uuid/bin/uuid @@ -1,26 +1,50 @@ #!/usr/bin/env node +var assert = require('assert'); -var path = require('path'); -var uuid = require(path.join(__dirname, '..')); +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC4122'); +} -var arg = process.argv[2]; +var args = process.argv.slice(2); -if ('--help' === arg) { - console.log('\n USAGE: uuid [version] [options]\n\n'); - console.log(' options:\n'); - console.log(' --help Display this message and exit\n'); +if (args.indexOf('--help') >= 0) { + usage(); process.exit(0); } +var version = args.shift() || 'v4'; -if (null == arg) { - console.log(uuid()); - process.exit(0); +switch (version) { + case 'v1': + var uuidV1 = require('../v1'); + console.log(uuidV1()); + break; + + case 'v4': + var uuidV4 = require('../v4'); + console.log(uuidV4()); + break; + + case 'v5': + var uuidV5 = require('../v5'); + + var name = args.shift(); + var namespace = args.shift(); + assert(name != null, 'v5 name not specified'); + assert(namespace != null, 'v5 namespace not specified'); + + if (namespace == 'URL') namespace = uuidV5.URL; + if (namespace == 'DNS') namespace = uuidV5.DNS; + + console.log(uuidV5(name, namespace)); + break; + + default: + usage(); + process.exit(1); } - -if ('v1' !== arg && 'v4' !== arg) { - console.error('Version must be RFC4122 version 1 or version 4, denoted as "v1" or "v4"'); - process.exit(1); -} - -console.log(uuid[arg]()); -process.exit(0); diff --git a/node_modules/uuid/lib/bytesToUuid.js b/node_modules/uuid/lib/bytesToUuid.js index 9ee989c..2c9a223 100644 --- a/node_modules/uuid/lib/bytesToUuid.js +++ b/node_modules/uuid/lib/bytesToUuid.js @@ -1,6 +1,6 @@ /** * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ var byteToHex = []; for (var i = 0; i < 256; ++i) { @@ -10,7 +10,7 @@ for (var i = 0; i < 256; ++i) { function bytesToUuid(buf, offset) { var i = offset || 0; var bth = byteToHex; - return bth[buf[i++]] + bth[buf[i++]] + + return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + diff --git a/node_modules/uuid/lib/rng-browser.js b/node_modules/uuid/lib/rng-browser.js index 88b7dfb..ac39b12 100644 --- a/node_modules/uuid/lib/rng-browser.js +++ b/node_modules/uuid/lib/rng-browser.js @@ -7,7 +7,7 @@ var rng; var crypto = global.crypto || global.msCrypto; // for IE 11 if (crypto && crypto.getRandomValues) { // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto - var rnds8 = new Uint8Array(16); + var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef rng = function whatwgRNG() { crypto.getRandomValues(rnds8); return rnds8; @@ -19,7 +19,7 @@ if (!rng) { // // If all else fails, use Math.random(). It's fast, but is of unspecified // quality. - var rnds = new Array(16); + var rnds = new Array(16); rng = function() { for (var i = 0, r; i < 16; i++) { if ((i & 0x03) === 0) r = Math.random() * 0x100000000; diff --git a/node_modules/uuid/lib/rng.js b/node_modules/uuid/lib/rng.js index 5624d91..4a0182f 100644 --- a/node_modules/uuid/lib/rng.js +++ b/node_modules/uuid/lib/rng.js @@ -1,10 +1,10 @@ // Unique ID creation requires a high quality random # generator. In node.js -// this is prett straight-forward - we use the crypto API. +// this is pretty straight-forward - we use the crypto API. var rb = require('crypto').randomBytes; function rng() { return rb(16); -}; +} module.exports = rng; diff --git a/node_modules/uuid/package.json b/node_modules/uuid/package.json index 4c324f4..a3d4171 100644 --- a/node_modules/uuid/package.json +++ b/node_modules/uuid/package.json @@ -1,59 +1,38 @@ { - "_args": [ - [ - { - "raw": "uuid@^3.0.0", - "scope": null, - "escapedName": "uuid", - "name": "uuid", - "rawSpec": "^3.0.0", - "spec": ">=3.0.0 <4.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/request" - ] - ], - "_from": "uuid@>=3.0.0 <4.0.0", - "_id": "uuid@3.0.1", - "_inCache": true, + "_from": "uuid@^3.1.0", + "_id": "uuid@3.1.0", + "_inBundle": false, + "_integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", "_location": "/uuid", - "_nodeVersion": "6.7.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/uuid-3.0.1.tgz_1480403886767_0.2584113120101392" - }, - "_npmUser": { - "name": "defunctzombie", - "email": "shtylman@gmail.com" - }, - "_npmVersion": "3.10.3", "_phantomChildren": {}, "_requested": { - "raw": "uuid@^3.0.0", - "scope": null, - "escapedName": "uuid", + "type": "range", + "registry": true, + "raw": "uuid@^3.1.0", "name": "uuid", - "rawSpec": "^3.0.0", - "spec": ">=3.0.0 <4.0.0", - "type": "range" + "escapedName": "uuid", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", - "_shasum": "6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1", - "_shrinkwrap": null, - "_spec": "uuid@^3.0.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/request", + "_resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "_shasum": "3dd3d3e790abc24d7b0d3a034ffababe28ebbc04", + "_spec": "uuid@^3.1.0", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/request", "bin": { "uuid": "./bin/uuid" }, "browser": { - "./lib/rng.js": "./lib/rng-browser.js" + "./lib/rng.js": "./lib/rng-browser.js", + "./lib/sha1.js": "./lib/sha1-browser.js" }, "bugs": { "url": "https://github.com/kelektiv/node-uuid/issues" }, + "bundleDependencies": false, "contributors": [ { "name": "Robert Kieffer", @@ -76,17 +55,11 @@ "email": "shtylman@gmail.com" } ], - "dependencies": {}, - "description": "RFC4122 (v1 and v4) generator", + "deprecated": false, + "description": "RFC4122 (v1, v4, and v5) UUIDs", "devDependencies": { "mocha": "3.1.2" }, - "directories": {}, - "dist": { - "shasum": "6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1", - "tarball": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz" - }, - "gitHead": "374de826de71d8997f71b4641f65552e48956ced", "homepage": "https://github.com/kelektiv/node-uuid#readme", "keywords": [ "uuid", @@ -94,23 +67,7 @@ "rfc4122" ], "license": "MIT", - "maintainers": [ - { - "name": "broofa", - "email": "robert@broofa.com" - }, - { - "name": "defunctzombie", - "email": "shtylman@gmail.com" - }, - { - "name": "vvo", - "email": "vincent.voyer@gmail.com" - } - ], "name": "uuid", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/kelektiv/node-uuid.git" @@ -118,5 +75,5 @@ "scripts": { "test": "mocha test/test.js" }, - "version": "3.0.1" + "version": "3.1.0" } diff --git a/node_modules/uuid/test/mocha.opts b/node_modules/uuid/test/mocha.opts deleted file mode 100644 index 5d6a311..0000000 --- a/node_modules/uuid/test/mocha.opts +++ /dev/null @@ -1,3 +0,0 @@ ---ui qunit ---reporter spec ---check-leaks diff --git a/node_modules/uuid/test/test.js b/node_modules/uuid/test/test.js deleted file mode 100644 index ec33bec..0000000 --- a/node_modules/uuid/test/test.js +++ /dev/null @@ -1,96 +0,0 @@ -var assert = require('assert'); - -var uuid = require('../'); - -// Verify ordering of v1 ids created with explicit times -var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00 - -function compare(name, ids) { - test(name, function() { - // avoid .map for older browsers - for (var i=0 ; i 10k ids created in 1ms', function() { - // Verify throw if too many ids created - var thrown = false; - try { - uuid.v1({msecs: TIME, nsecs: 10000}); - } catch (e) { - thrown = true; - } - assert(thrown, 'Exception thrown when > 10K ids created in 1 ms'); -}); - -test('clock regression by msec', function() { - // Verify clock regression bumps clockseq - var uidt = uuid.v1({msecs: TIME}); - var uidtb = uuid.v1({msecs: TIME - 1}); - assert( - parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1, - 'Clock regression by msec increments the clockseq' - ); -}); - -test('clock regression by nsec', function() { - // Verify clock regression bumps clockseq - var uidtn = uuid.v1({msecs: TIME, nsecs: 10}); - var uidtnb = uuid.v1({msecs: TIME, nsecs: 9}); - assert( - parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1, - 'Clock regression by nsec increments the clockseq' - ); -}); - -test('explicit options product expected id', function() { - // Verify explicit options produce expected id - var id = uuid.v1({ - msecs: 1321651533573, - nsecs: 5432, - clockseq: 0x385c, - node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ] - }); - assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id'); -}); - -test('ids spanning 1ms boundary are 100ns apart', function() { - // Verify adjacent ids across a msec boundary are 1 time unit apart - var u0 = uuid.v1({msecs: TIME, nsecs: 9999}); - var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0}); - - var before = u0.split('-')[0], after = u1.split('-')[0]; - var dt = parseInt(after, 16) - parseInt(before, 16); - assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart'); -}); diff --git a/node_modules/uuid/v1.js b/node_modules/uuid/v1.js index 315bd4c..613f67e 100644 --- a/node_modules/uuid/v1.js +++ b/node_modules/uuid/v1.js @@ -1,6 +1,3 @@ -// Unique ID creation requires a high quality random # generator. We feature -// detect to determine the best RNG source, normalizing to a function that -// returns 128-bits of randomness, since that's what's usually required var rng = require('./lib/rng'); var bytesToUuid = require('./lib/bytesToUuid'); diff --git a/node_modules/verror/.gitmodules b/node_modules/verror/.gitmodules deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/verror/.npmignore b/node_modules/verror/.npmignore index 3c3629e..f14aec8 100644 --- a/node_modules/verror/.npmignore +++ b/node_modules/verror/.npmignore @@ -1 +1,9 @@ -node_modules +.gitignore +.gitmodules +deps +examples +experiments +jsl.node.conf +Makefile +Makefile.targ +test diff --git a/node_modules/verror/LICENSE b/node_modules/verror/LICENSE index cbc0bb3..82a5cb8 100644 --- a/node_modules/verror/LICENSE +++ b/node_modules/verror/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012, Joyent, Inc. All rights reserved. +Copyright (c) 2016, Joyent, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/verror/Makefile b/node_modules/verror/Makefile deleted file mode 100644 index 00faa97..0000000 --- a/node_modules/verror/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright (c) 2012, Joyent, Inc. All rights reserved. -# -# Makefile: top-level Makefile -# -# This Makefile contains only repo-specific logic and uses included makefiles -# to supply common targets (javascriptlint, jsstyle, restdown, etc.), which are -# used by other repos as well. -# - -# -# Tools -# -NPM = npm - -# -# Files -# -JS_FILES := $(shell find lib examples tests -name '*.js') -JSL_FILES_NODE = $(JS_FILES) -JSSTYLE_FILES = $(JS_FILES) -JSL_CONF_NODE = jsl.node.conf - -.PHONY: all -all: - $(NPM) install - -.PHONY: test -test: - node tests/tst.inherit.js - node tests/tst.verror.js - node tests/tst.werror.js - @echo all tests passed - -include ./Makefile.targ diff --git a/node_modules/verror/Makefile.targ b/node_modules/verror/Makefile.targ deleted file mode 100644 index 2a64fe7..0000000 --- a/node_modules/verror/Makefile.targ +++ /dev/null @@ -1,285 +0,0 @@ -# -*- mode: makefile -*- -# -# Copyright (c) 2012, Joyent, Inc. All rights reserved. -# -# Makefile.targ: common targets. -# -# NOTE: This makefile comes from the "eng" repo. It's designed to be dropped -# into other repos as-is without requiring any modifications. If you find -# yourself changing this file, you should instead update the original copy in -# eng.git and then update your repo to use the new version. -# -# This Makefile defines several useful targets and rules. You can use it by -# including it from a Makefile that specifies some of the variables below. -# -# Targets defined in this Makefile: -# -# check Checks JavaScript files for lint and style -# Checks bash scripts for syntax -# Checks SMF manifests for validity against the SMF DTD -# -# clean Removes built files -# -# docs Builds restdown documentation in docs/ -# -# prepush Depends on "check" and "test" -# -# test Does nothing (you should override this) -# -# xref Generates cscope (source cross-reference index) -# -# For details on what these targets are supposed to do, see the Joyent -# Engineering Guide. -# -# To make use of these targets, you'll need to set some of these variables. Any -# variables left unset will simply not be used. -# -# BASH_FILES Bash scripts to check for syntax -# (paths relative to top-level Makefile) -# -# CLEAN_FILES Files to remove as part of the "clean" target. Note -# that files generated by targets in this Makefile are -# automatically included in CLEAN_FILES. These include -# restdown-generated HTML and JSON files. -# -# DOC_FILES Restdown (documentation source) files. These are -# assumed to be contained in "docs/", and must NOT -# contain the "docs/" prefix. -# -# JSL_CONF_NODE Specify JavaScriptLint configuration files -# JSL_CONF_WEB (paths relative to top-level Makefile) -# -# Node.js and Web configuration files are separate -# because you'll usually want different global variable -# configurations. If no file is specified, none is given -# to jsl, which causes it to use a default configuration, -# which probably isn't what you want. -# -# JSL_FILES_NODE JavaScript files to check with Node config file. -# JSL_FILES_WEB JavaScript files to check with Web config file. -# -# You can also override these variables: -# -# BASH Path to bash (default: bash) -# -# CSCOPE_DIRS Directories to search for source files for the cscope -# index. (default: ".") -# -# JSL Path to JavaScriptLint (default: "jsl") -# -# JSL_FLAGS_NODE Additional flags to pass through to JSL -# JSL_FLAGS_WEB -# JSL_FLAGS -# -# JSSTYLE Path to jsstyle (default: jsstyle) -# -# JSSTYLE_FLAGS Additional flags to pass through to jsstyle -# - -# -# Defaults for the various tools we use. -# -BASH ?= bash -BASHSTYLE ?= tools/bashstyle -CP ?= cp -CSCOPE ?= cscope -CSCOPE_DIRS ?= . -JSL ?= jsl -JSSTYLE ?= jsstyle -MKDIR ?= mkdir -p -MV ?= mv -RESTDOWN_FLAGS ?= -RMTREE ?= rm -rf -JSL_FLAGS ?= --nologo --nosummary - -ifeq ($(shell uname -s),SunOS) - TAR ?= gtar -else - TAR ?= tar -endif - - -# -# Defaults for other fixed values. -# -BUILD = build -DISTCLEAN_FILES += $(BUILD) -DOC_BUILD = $(BUILD)/docs/public - -# -# Configure JSL_FLAGS_{NODE,WEB} based on JSL_CONF_{NODE,WEB}. -# -ifneq ($(origin JSL_CONF_NODE), undefined) - JSL_FLAGS_NODE += --conf=$(JSL_CONF_NODE) -endif - -ifneq ($(origin JSL_CONF_WEB), undefined) - JSL_FLAGS_WEB += --conf=$(JSL_CONF_WEB) -endif - -# -# Targets. For descriptions on what these are supposed to do, see the -# Joyent Engineering Guide. -# - -# -# Instruct make to keep around temporary files. We have rules below that -# automatically update git submodules as needed, but they employ a deps/*/.git -# temporary file. Without this directive, make tries to remove these .git -# directories after the build has completed. -# -.SECONDARY: $($(wildcard deps/*):%=%/.git) - -# -# This rule enables other rules that use files from a git submodule to have -# those files depend on deps/module/.git and have "make" automatically check -# out the submodule as needed. -# -deps/%/.git: - git submodule update --init deps/$* - -# -# These recipes make heavy use of dynamically-created phony targets. The parent -# Makefile defines a list of input files like BASH_FILES. We then say that each -# of these files depends on a fake target called filename.bashchk, and then we -# define a pattern rule for those targets that runs bash in check-syntax-only -# mode. This mechanism has the nice properties that if you specify zero files, -# the rule becomes a noop (unlike a single rule to check all bash files, which -# would invoke bash with zero files), and you can check individual files from -# the command line with "make filename.bashchk". -# -.PHONY: check-bash -check-bash: $(BASH_FILES:%=%.bashchk) $(BASH_FILES:%=%.bashstyle) - -%.bashchk: % - $(BASH) -n $^ - -%.bashstyle: % - $(BASHSTYLE) $^ - -.PHONY: check-jsl check-jsl-node check-jsl-web -check-jsl: check-jsl-node check-jsl-web - -check-jsl-node: $(JSL_FILES_NODE:%=%.jslnodechk) - -check-jsl-web: $(JSL_FILES_WEB:%=%.jslwebchk) - -%.jslnodechk: % $(JSL_EXEC) - $(JSL) $(JSL_FLAGS) $(JSL_FLAGS_NODE) $< - -%.jslwebchk: % $(JSL_EXEC) - $(JSL) $(JSL_FLAGS) $(JSL_FLAGS_WEB) $< - -.PHONY: check-jsstyle -check-jsstyle: $(JSSTYLE_FILES:%=%.jsstylechk) - -%.jsstylechk: % $(JSSTYLE_EXEC) - $(JSSTYLE) $(JSSTYLE_FLAGS) $< - -.PHONY: check -check: check-jsl check-jsstyle check-bash - @echo check ok - -.PHONY: clean -clean:: - -$(RMTREE) $(CLEAN_FILES) - -.PHONY: distclean -distclean:: clean - -$(RMTREE) $(DISTCLEAN_FILES) - -CSCOPE_FILES = cscope.in.out cscope.out cscope.po.out -CLEAN_FILES += $(CSCOPE_FILES) - -.PHONY: xref -xref: cscope.files - $(CSCOPE) -bqR - -.PHONY: cscope.files -cscope.files: - find $(CSCOPE_DIRS) -name '*.c' -o -name '*.h' -o -name '*.cc' \ - -o -name '*.js' -o -name '*.s' -o -name '*.cpp' > $@ - -# -# The "docs" target is complicated because we do several things here: -# -# (1) Use restdown to build HTML and JSON files from each of DOC_FILES. -# -# (2) Copy these files into $(DOC_BUILD) (build/docs/public), which -# functions as a complete copy of the documentation that could be -# mirrored or served over HTTP. -# -# (3) Then copy any directories and media from docs/media into -# $(DOC_BUILD)/media. This allows projects to include their own media, -# including files that will override same-named files provided by -# restdown. -# -# Step (3) is the surprisingly complex part: in order to do this, we need to -# identify the subdirectories in docs/media, recreate them in -# $(DOC_BUILD)/media, then do the same with the files. -# -DOC_MEDIA_DIRS := $(shell find docs/media -type d 2>/dev/null | grep -v "^docs/media$$") -DOC_MEDIA_DIRS := $(DOC_MEDIA_DIRS:docs/media/%=%) -DOC_MEDIA_DIRS_BUILD := $(DOC_MEDIA_DIRS:%=$(DOC_BUILD)/media/%) - -DOC_MEDIA_FILES := $(shell find docs/media -type f 2>/dev/null) -DOC_MEDIA_FILES := $(DOC_MEDIA_FILES:docs/media/%=%) -DOC_MEDIA_FILES_BUILD := $(DOC_MEDIA_FILES:%=$(DOC_BUILD)/media/%) - -# -# Like the other targets, "docs" just depends on the final files we want to -# create in $(DOC_BUILD), leveraging other targets and recipes to define how -# to get there. -# -.PHONY: docs -docs: \ - $(DOC_FILES:%.restdown=$(DOC_BUILD)/%.html) \ - $(DOC_FILES:%.restdown=$(DOC_BUILD)/%.json) \ - $(DOC_MEDIA_FILES_BUILD) - -# -# We keep the intermediate files so that the next build can see whether the -# files in DOC_BUILD are up to date. -# -.PRECIOUS: \ - $(DOC_FILES:%.restdown=docs/%.html) \ - $(DOC_FILES:%.restdown=docs/%json) - -# -# We do clean those intermediate files, as well as all of DOC_BUILD. -# -CLEAN_FILES += \ - $(DOC_BUILD) \ - $(DOC_FILES:%.restdown=docs/%.html) \ - $(DOC_FILES:%.restdown=docs/%.json) - -# -# Before installing the files, we must make sure the directories exist. The | -# syntax tells make that the dependency need only exist, not be up to date. -# Otherwise, it might try to rebuild spuriously because the directory itself -# appears out of date. -# -$(DOC_MEDIA_FILES_BUILD): | $(DOC_MEDIA_DIRS_BUILD) - -$(DOC_BUILD)/%: docs/% | $(DOC_BUILD) - $(CP) $< $@ - -docs/%.json docs/%.html: docs/%.restdown | $(DOC_BUILD) $(RESTDOWN_EXEC) - $(RESTDOWN) $(RESTDOWN_FLAGS) -m $(DOC_BUILD) $< - -$(DOC_BUILD): - $(MKDIR) $@ - -$(DOC_MEDIA_DIRS_BUILD): - $(MKDIR) $@ - -# -# The default "test" target does nothing. This should usually be overridden by -# the parent Makefile. It's included here so we can define "prepush" without -# requiring the repo to define "test". -# -.PHONY: test -test: - -.PHONY: prepush -prepush: check test diff --git a/node_modules/verror/README.md b/node_modules/verror/README.md index e9b5497..c1f0635 100644 --- a/node_modules/verror/README.md +++ b/node_modules/verror/README.md @@ -1,120 +1,528 @@ -# verror: richer JavaScript errors +# verror: rich JavaScript errors -This module provides two classes: VError, for accretive errors, and WError, for -wrapping errors. Both support printf-style error messages using extsprintf. +This module provides several classes in support of Joyent's [Best Practices for +Error Handling in Node.js](http://www.joyent.com/developers/node/design/errors). +If you find any of the behavior here confusing or surprising, check out that +document first. -## Printf-style errors +The error classes here support: -At the most basic level, VError is just like JavaScript's Error class, but with -printf-style arguments: +* printf-style arguments for the message +* chains of causes +* properties to provide extra information about the error +* creating your own subclasses that support all of these - var verror = require('verror'); +The classes here are: - var opname = 'read'; - var err = new verror.VError('"%s" operation failed', opname); - console.log(err.message); - console.log(err.stack); +* **VError**, for chaining errors while preserving each one's error message. + This is useful in servers and command-line utilities when you want to + propagate an error up a call stack, but allow various levels to add their own + context. See examples below. +* **WError**, for wrapping errors while hiding the lower-level messages from the + top-level error. This is useful for API endpoints where you don't want to + expose internal error messages, but you still want to preserve the error chain + for logging and debugging. +* **SError**, which is just like VError but interprets printf-style arguments + more strictly. +* **MultiError**, which is just an Error that encapsulates one or more other + errors. (This is used for parallel operations that return several errors.) + + +# Quick start + +First, install the package: + + npm install verror + +If nothing else, you can use VError as a drop-in replacement for the built-in +JavaScript Error class, with the addition of printf-style messages: + +```javascript +var err = new VError('missing file: "%s"', '/etc/passwd'); +console.log(err.message); +``` This prints: - "read" operation failed - "read" operation failed - at Object. (/Users/dap/node-verror/examples/varargs.js:4:11) - at Module._compile (module.js:449:26) - at Object.Module._extensions..js (module.js:467:10) + missing file: "/etc/passwd" + +You can also pass a `cause` argument, which is any other Error object: + +```javascript +var fs = require('fs'); +var filename = '/nonexistent'; +fs.stat(filename, function (err1) { + var err2 = new VError(err1, 'stat "%s"', filename); + console.error(err2.message); +}); +``` + +This prints out: + + stat "/nonexistent": ENOENT, stat '/nonexistent' + +which resembles how Unix programs typically report errors: + + $ sort /nonexistent + sort: open failed: /nonexistent: No such file or directory + +To match the Unixy feel, when you print out the error, just prepend the +program's name to the VError's `message`. Or just call +[node-cmdutil.fail(your_verror)](https://github.com/joyent/node-cmdutil), which +does this for you. + +You can get the next-level Error using `err.cause()`: + +```javascript +console.error(err2.cause().message); +``` + +prints: + + ENOENT, stat '/nonexistent' + +Of course, you can chain these as many times as you want, and it works with any +kind of Error: + +```javascript +var err1 = new Error('No such file or directory'); +var err2 = new VError(err1, 'failed to stat "%s"', '/junk'); +var err3 = new VError(err2, 'request failed'); +console.error(err3.message); +``` + +This prints: + + request failed: failed to stat "/junk": No such file or directory + +The idea is that each layer in the stack annotates the error with a description +of what it was doing. The end result is a message that explains what happened +at each level. + +You can also decorate Error objects with additional information so that callers +can not only handle each kind of error differently, but also construct their own +error messages (e.g., to localize them, format them, group them by type, and so +on). See the example below. + + +# Deeper dive + +The two main goals for VError are: + +* **Make it easy to construct clear, complete error messages intended for + people.** Clear error messages greatly improve both user experience and + debuggability, so we wanted to make it easy to build them. That's why the + constructor takes printf-style arguments. +* **Make it easy to construct objects with programmatically-accessible + metadata** (which we call _informational properties_). Instead of just saying + "connection refused while connecting to 192.168.1.2:80", you can add + properties like `"ip": "192.168.1.2"` and `"tcpPort": 80`. This can be used + for feeding into monitoring systems, analyzing large numbers of Errors (as + from a log file), or localizing error messages. + +To really make this useful, it also needs to be easy to compose Errors: +higher-level code should be able to augment the Errors reported by lower-level +code to provide a more complete description of what happened. Instead of saying +"connection refused", you can say "operation X failed: connection refused". +That's why VError supports `causes`. + +In order for all this to work, programmers need to know that it's generally safe +to wrap lower-level Errors with higher-level ones. If you have existing code +that handles Errors produced by a library, you should be able to wrap those +Errors with a VError to add information without breaking the error handling +code. There are two obvious ways that this could break such consumers: + +* The error's name might change. People typically use `name` to determine what + kind of Error they've got. To ensure compatibility, you can create VErrors + with custom names, but this approach isn't great because it prevents you from + representing complex failures. For this reason, VError provides + `findCauseByName`, which essentially asks: does this Error _or any of its + causes_ have this specific type? If error handling code uses + `findCauseByName`, then subsystems can construct very specific causal chains + for debuggability and still let people handle simple cases easily. There's an + example below. +* The error's properties might change. People often hang additional properties + off of Error objects. If we wrap an existing Error in a new Error, those + properties would be lost unless we copied them. But there are a variety of + both standard and non-standard Error properties that should _not_ be copied in + this way: most obviously `name`, `message`, and `stack`, but also `fileName`, + `lineNumber`, and a few others. Plus, it's useful for some Error subclasses + to have their own private properties -- and there'd be no way to know whether + these should be copied. For these reasons, VError first-classes these + information properties. You have to provide them in the constructor, you can + only fetch them with the `info()` function, and VError takes care of making + sure properties from causes wind up in the `info()` output. + +Let's put this all together with an example from the node-fast RPC library. +node-fast implements a simple RPC protocol for Node programs. There's a server +and client interface, and clients make RPC requests to servers. Let's say the +server fails with an UnauthorizedError with message "user 'bob' is not +authorized". The client wraps all server errors with a FastServerError. The +client also wraps all request errors with a FastRequestError that includes the +name of the RPC call being made. The result of this failed RPC might look like +this: + + name: FastRequestError + message: "request failed: server error: user 'bob' is not authorized" + rpcMsgid: + rpcMethod: GetObject + cause: + name: FastServerError + message: "server error: user 'bob' is not authorized" + cause: + name: UnauthorizedError + message: "user 'bob' is not authorized" + rpcUser: "bob" + +When the caller uses `VError.info()`, the information properties are collapsed +so that it looks like this: + + message: "request failed: server error: user 'bob' is not authorized" + rpcMsgid: + rpcMethod: GetObject + rpcUser: "bob" + +Taking this apart: + +* The error's message is a complete description of the problem. The caller can + report this directly to its caller, which can potentially make its way back to + an end user (if appropriate). It can also be logged. +* The caller can tell that the request failed on the server, rather than as a + result of a client problem (e.g., failure to serialize the request), a + transport problem (e.g., failure to connect to the server), or something else + (e.g., a timeout). They do this using `findCauseByName('FastServerError')` + rather than checking the `name` field directly. +* If the caller logs this error, the logs can be analyzed to aggregate + errors by cause, by RPC method name, by user, or whatever. Or the + error can be correlated with other events for the same rpcMsgid. +* It wasn't very hard for any part of the code to contribute to this Error. + Each part of the stack has just a few lines to provide exactly what it knows, + with very little boilerplate. + +It's not expected that you'd use these complex forms all the time. Despite +supporting the complex case above, you can still just do: + + new VError("my service isn't working"); + +for the simple cases. + + +# Reference: VError, WError, SError + +VError, WError, and SError are convenient drop-in replacements for `Error` that +support printf-style arguments, first-class causes, informational properties, +and other useful features. + + +## Constructors + +The VError constructor has several forms: + +```javascript +/* + * This is the most general form. You can specify any supported options + * (including "cause" and "info") this way. + */ +new VError(options, sprintf_args...) + +/* + * This is a useful shorthand when the only option you need is "cause". + */ +new VError(cause, sprintf_args...) + +/* + * This is a useful shorthand when you don't need any options at all. + */ +new VError(sprintf_args...) +``` + +All of these forms construct a new VError that behaves just like the built-in +JavaScript `Error` class, with some additional methods described below. + +In the first form, `options` is a plain object with any of the following +optional properties: + +Option name | Type | Meaning +---------------- | ---------------- | ------- +`name` | string | Describes what kind of error this is. This is intended for programmatic use to distinguish between different kinds of errors. Note that in modern versions of Node.js, this name is ignored in the `stack` property value, but callers can still use the `name` property to get at it. +`cause` | any Error object | Indicates that the new error was caused by `cause`. See `cause()` below. If unspecified, the cause will be `null`. +`strict` | boolean | If true, then `null` and `undefined` values in `sprintf_args` are passed through to `sprintf()`. Otherwise, these are replaced with the strings `'null'`, and '`undefined`', respectively. +`constructorOpt` | function | If specified, then the stack trace for this error ends at function `constructorOpt`. Functions called by `constructorOpt` will not show up in the stack. This is useful when this class is subclassed. +`info` | object | Specifies arbitrary informational properties that are available through the `VError.info(err)` static class method. See that method for details. + +The second form is equivalent to using the first form with the specified `cause` +as the error's cause. This form is distinguished from the first form because +the first argument is an Error. + +The third form is equivalent to using the first form with all default option +values. This form is distinguished from the other forms because the first +argument is not an object or an Error. + +The `WError` constructor is used exactly the same way as the `VError` +constructor. The `SError` constructor is also used the same way as the +`VError` constructor except that in all cases, the `strict` property is +overriden to `true. + + +## Public properties + +`VError`, `WError`, and `SError` all provide the same public properties as +JavaScript's built-in Error objects. + +Property name | Type | Meaning +------------- | ------ | ------- +`name` | string | Programmatically-usable name of the error. +`message` | string | Human-readable summary of the failure. Programmatically-accessible details are provided through `VError.info(err)` class method. +`stack` | string | Human-readable stack trace where the Error was constructed. + +For all of these classes, the printf-style arguments passed to the constructor +are processed with `sprintf()` to form a message. For `WError`, this becomes +the complete `message` property. For `SError` and `VError`, this message is +prepended to the message of the cause, if any (with a suitable separator), and +the result becomes the `message` property. + +The `stack` property is managed entirely by the underlying JavaScript +implementation. It's generally implemented using a getter function because +constructing the human-readable stack trace is somewhat expensive. + +## Class methods + +The following methods are defined on the `VError` class and as exported +functions on the `verror` module. They're defined this way rather than using +methods on VError instances so that they can be used on Errors not created with +`VError`. + +### `VError.cause(err)` + +The `cause()` function returns the next Error in the cause chain for `err`, or +`null` if there is no next error. See the `cause` argument to the constructor. +Errors can have arbitrarily long cause chains. You can walk the `cause` chain +by invoking `VError.cause(err)` on each subsequent return value. If `err` is +not a `VError`, the cause is `null`. + +### `VError.info(err)` + +Returns an object with all of the extra error information that's been associated +with this Error and all of its causes. These are the properties passed in using +the `info` option to the constructor. Properties not specified in the +constructor for this Error are implicitly inherited from this error's cause. + +These properties are intended to provide programmatically-accessible metadata +about the error. For an error that indicates a failure to resolve a DNS name, +informational properties might include the DNS name to be resolved, or even the +list of resolvers used to resolve it. The values of these properties should +generally be plain objects (i.e., consisting only of null, undefined, numbers, +booleans, strings, and objects and arrays containing only other plain objects). + +### `VError.fullStack(err)` + +Returns a string containing the full stack trace, with all nested errors recursively +reported as `'caused by:' + err.stack`. + +### `VError.findCauseByName(err, name)` + +The `findCauseByName()` function traverses the cause chain for `err`, looking +for an error whose `name` property matches the passed in `name` value. If no +match is found, `null` is returned. + +If all you want is to know _whether_ there's a cause (and you don't care what it +is), you can use `VError.hasCauseWithName(err, name)`. + +If a vanilla error or a non-VError error is passed in, then there is no cause +chain to traverse. In this scenario, the function will check the `name` +property of only `err`. + +### `VError.hasCauseWithName(err, name)` + +Returns true if and only if `VError.findCauseByName(err, name)` would return +a non-null value. This essentially determines whether `err` has any cause in +its cause chain that has name `name`. + +### `VError.errorFromList(errors)` + +Given an array of Error objects (possibly empty), return a single error +representing the whole collection of errors. If the list has: + +* 0 elements, returns `null` +* 1 element, returns the sole error +* more than 1 element, returns a MultiError referencing the whole list + +This is useful for cases where an operation may produce any number of errors, +and you ultimately want to implement the usual `callback(err)` pattern. You can +accumulate the errors in an array and then invoke +`callback(VError.errorFromList(errors))` when the operation is complete. + + +### `VError.errorForEach(err, func)` + +Convenience function for iterating an error that may itself be a MultiError. + +In all cases, `err` must be an Error. If `err` is a MultiError, then `func` is +invoked as `func(errorN)` for each of the underlying errors of the MultiError. +If `err` is any other kind of error, `func` is invoked once as `func(err)`. In +all cases, `func` is invoked synchronously. + +This is useful for cases where an operation may produce any number of warnings +that may be encapsulated with a MultiError -- but may not be. + +This function does not iterate an error's cause chain. + + +## Examples + +The "Demo" section above covers several basic cases. Here's a more advanced +case: + +```javascript +var err1 = new VError('something bad happened'); +/* ... */ +var err2 = new VError({ + 'name': 'ConnectionError', + 'cause': err1, + 'info': { + 'errno': 'ECONNREFUSED', + 'remote_ip': '127.0.0.1', + 'port': 215 + } +}, 'failed to connect to "%s:%d"', '127.0.0.1', 215); + +console.log(err2.message); +console.log(err2.name); +console.log(VError.info(err2)); +console.log(err2.stack); +``` + +This outputs: + + failed to connect to "127.0.0.1:215": something bad happened + ConnectionError + { errno: 'ECONNREFUSED', remote_ip: '127.0.0.1', port: 215 } + ConnectionError: failed to connect to "127.0.0.1:215": something bad happened + at Object. (/home/dap/node-verror/examples/info.js:5:12) + at Module._compile (module.js:456:26) + at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) - at Module.runMain (module.js:492:10) - at process.startup.processNextTick.process._tickCallback (node.js:244:9) + at Function.Module.runMain (module.js:497:10) + at startup (node.js:119:16) + at node.js:935:3 +Information properties are inherited up the cause chain, with values at the top +of the chain overriding same-named values lower in the chain. To continue that +example: -## VError for accretive error messages - -More interestingly, you can use VError to build up an error describing what -happened at various levels in the stack. For example, suppose you have a -request handler that stats a file and fails if it doesn't exist: - - var fs = require('fs'); - var verror = require('verror'); - - function checkFile(filename, callback) { - fs.stat(filename, function (err) { - if (err) - /* Annotate the "stat" error with what we were doing. */ - return (callback(new verror.VError(err, - 'failed to check "%s"', filename))); - - /* ... */ - }); +```javascript +var err3 = new VError({ + 'name': 'RequestError', + 'cause': err2, + 'info': { + 'errno': 'EBADREQUEST' } +}, 'request failed'); - function handleRequest(filename, callback) { - checkFile('/nonexistent', function (err) { - if (err) { - /* Annotate the "checkFile" error with what we were doing. */ - return (callback(new verror.VError(err, 'request failed'))); - } +console.log(err3.message); +console.log(err3.name); +console.log(VError.info(err3)); +console.log(err3.stack); +``` - /* ... */ - }); - } +This outputs: - handleRequest('/nonexistent', function (err) { - if (err) - console.log(err.message); - /* ... */ - }); + request failed: failed to connect to "127.0.0.1:215": something bad happened + RequestError + { errno: 'EBADREQUEST', remote_ip: '127.0.0.1', port: 215 } + RequestError: request failed: failed to connect to "127.0.0.1:215": something bad happened + at Object. (/home/dap/node-verror/examples/info.js:20:12) + at Module._compile (module.js:456:26) + at Object.Module._extensions..js (module.js:474:10) + at Module.load (module.js:356:32) + at Function.Module._load (module.js:312:12) + at Function.Module.runMain (module.js:497:10) + at startup (node.js:119:16) + at node.js:935:3 -Since the file "/nonexistent" doesn't exist, this prints out: +You can also print the complete stack trace of combined `Error`s by using +`VError.fullStack(err).` - request failed: failed to check "/nonexistent": ENOENT, stat '/nonexistent' +```javascript +var err1 = new VError('something bad happened'); +/* ... */ +var err2 = new VError(err1, 'something really bad happened here'); -The idea here is that the lowest level (Node's "fs.stat" function) generates an -arbitrary error, and each higher level (request handler and stat callback) -creates a new VError that annotates the previous error with what it was doing, -so that the result is a clear message explaining what failed at each level. +console.log(VError.fullStack(err2)); +``` -This plays nicely with extsprintf's "%r" specifier, which prints out a -Java-style stacktrace with the whole chain of exceptions: +This outputs: - EXCEPTION: VError: request failed: failed to check "/nonexistent": ENOENT, stat '/nonexistent' - at /Users/dap/work/node-verror/examples/levels.js:21:21 - at /Users/dap/work/node-verror/examples/levels.js:9:12 - at Object.oncomplete (fs.js:297:15) - Caused by: EXCEPTION: VError: failed to check "/nonexistent": ENOENT, stat '/nonexistent' - at /Users/dap/work/node-verror/examples/levels.js:9:21 - at Object.oncomplete (fs.js:297:15) - Caused by: EXCEPTION: Error: Error: ENOENT, stat '/nonexistent' + VError: something really bad happened here: something bad happened + at Object. (/home/dap/node-verror/examples/fullStack.js:5:12) + at Module._compile (module.js:409:26) + at Object.Module._extensions..js (module.js:416:10) + at Module.load (module.js:343:32) + at Function.Module._load (module.js:300:12) + at Function.Module.runMain (module.js:441:10) + at startup (node.js:139:18) + at node.js:968:3 + caused by: VError: something bad happened + at Object. (/home/dap/node-verror/examples/fullStack.js:3:12) + at Module._compile (module.js:409:26) + at Object.Module._extensions..js (module.js:416:10) + at Module.load (module.js:343:32) + at Function.Module._load (module.js:300:12) + at Function.Module.runMain (module.js:441:10) + at startup (node.js:139:18) + at node.js:968:3 + +`VError.fullStack` is also safe to use on regular `Error`s, so feel free to use +it whenever you need to extract the stack trace from an `Error`, regardless if +it's a `VError` or not. + +# Reference: MultiError + +MultiError is an Error class that represents a group of Errors. This is used +when you logically need to provide a single Error, but you want to preserve +information about multiple underying Errors. A common case is when you execute +several operations in parallel and some of them fail. + +MultiErrors are constructed as: + +```javascript +new MultiError(error_list) +``` + +`error_list` is an array of at least one `Error` object. + +The cause of the MultiError is the first error provided. None of the other +`VError` options are supported. The `message` for a MultiError consists the +`message` from the first error, prepended with a message indicating that there +were other errors. + +For example: + +```javascript +err = new MultiError([ + new Error('failed to resolve DNS name "abc.example.com"'), + new Error('failed to resolve DNS name "def.example.com"'), +]); + +console.error(err.message); +``` + +outputs: + + first of 2 errors: failed to resolve DNS name "abc.example.com" + +See the convenience function `VError.errorFromList`, which is sometimes simpler +to use than this constructor. + +## Public methods -## WError for wrapped errors +### `errors()` -Sometimes you don't want an Error's "message" field to include the details of -all of the low-level errors, but you still want to be able to get at them -programmatically. For example, in an HTTP server, you probably don't want to -spew all of the low-level errors back to the client, but you do want to include -them in the audit log entry for the request. In that case, you can use a -WError, which is created exactly like VError (and also supports both -printf-style arguments and an optional cause), but the resulting "message" only -contains the top-level error. It's also more verbose, including the class -associated with each error in the cause chain. Using the same example above, -but replacing the VError in handleRequest with WError, we get this output: +Returns an array of the errors used to construct this MultiError. - request failed - -That's what we wanted -- just a high-level summary for the client. But we can -get the object's toString() for the full details: - - WError: request failed; caused by WError: failed to check "/nonexistent"; - caused by Error: ENOENT, stat '/nonexistent' # Contributing -Contributions welcome. Code should be "make check" clean. To run "make check", -you'll need these tools: - -* https://github.com/davepacheco/jsstyle -* https://github.com/davepacheco/javascriptlint - -If you're changing something non-trivial or user-facing, you may want to submit -an issue first. +See separate [contribution guidelines](CONTRIBUTING.md). diff --git a/node_modules/verror/examples/levels-verror.js b/node_modules/verror/examples/levels-verror.js deleted file mode 100644 index 53a7022..0000000 --- a/node_modules/verror/examples/levels-verror.js +++ /dev/null @@ -1,36 +0,0 @@ -var extsprintf = require('extsprintf'); -var fs = require('fs'); -var verror = require('../lib/verror'); - -function checkFile(filename, callback) { - fs.stat(filename, function (err) { - if (err) - /* Annotate the "stat" error with what we were doing. */ - return (callback(new verror.VError(err, - 'failed to check "%s"', filename))); - - /* ... */ - return (callback()); - }); -} - -function handleRequest(filename, callback) { - checkFile('/nonexistent', function (err) { - if (err) - /* Annotate the "checkFile" error. */ - return (callback(new verror.VError( - err, 'request failed'))); - - /* ... */ - return (callback()); - }); -} - -handleRequest('/nonexistent', function (err) { - if (err) { - console.log(err.message); - console.log(extsprintf.sprintf('%r', err)); - } - - /* ... */ -}); diff --git a/node_modules/verror/examples/levels-werror.js b/node_modules/verror/examples/levels-werror.js deleted file mode 100644 index 7e57075..0000000 --- a/node_modules/verror/examples/levels-werror.js +++ /dev/null @@ -1,34 +0,0 @@ -var extsprintf = require('extsprintf'); -var fs = require('fs'); -var verror = require('../lib/verror'); - -function checkFile(filename, callback) { - fs.stat(filename, function (err) { - if (err) - /* Annotate the "stat" error with what we were doing. */ - return (callback(new verror.VError(err, - 'failed to check "%s"', filename))); - - /* ... */ - return (callback()); - }); -} - -function handleRequest(filename, callback) { - checkFile('/nonexistent', function (err) { - if (err) - /* Wrap the "checkFile" error. */ - return (callback(new verror.WError( - err, 'request failed'))); - - /* ... */ - return (callback()); - }); -} - -handleRequest('/nonexistent', function (err) { - if (err) { - console.log(err.message); - console.log(err.toString()); - } -}); diff --git a/node_modules/verror/examples/varargs.js b/node_modules/verror/examples/varargs.js deleted file mode 100644 index 2e14ee4..0000000 --- a/node_modules/verror/examples/varargs.js +++ /dev/null @@ -1,6 +0,0 @@ -var verror = require('../lib/verror'); - -var opname = 'read'; -var err = new verror.VError('"%s" operation failed', opname); -console.log(err.message); -console.log(err.stack); diff --git a/node_modules/verror/examples/verror.js b/node_modules/verror/examples/verror.js deleted file mode 100644 index 887b181..0000000 --- a/node_modules/verror/examples/verror.js +++ /dev/null @@ -1,13 +0,0 @@ -var mod_fs = require('fs'); -var mod_verror = require('../lib/verror'); - -var filename = '/nonexistent'; - -mod_fs.stat(filename, function (err1) { - var err2 = new mod_verror.VError(err1, 'failed to stat "%s"', filename); - - /* The following would normally be higher up the stack. */ - var err3 = new mod_verror.VError(err2, 'failed to handle request'); - console.log(err3.message); - console.log(err3.stack); -}); diff --git a/node_modules/verror/examples/werror.js b/node_modules/verror/examples/werror.js deleted file mode 100644 index f55e532..0000000 --- a/node_modules/verror/examples/werror.js +++ /dev/null @@ -1,14 +0,0 @@ -var mod_fs = require('fs'); -var mod_verror = require('../lib/verror'); - -var filename = '/nonexistent'; - -mod_fs.stat(filename, function (err1) { - var err2 = new mod_verror.WError(err1, 'failed to stat "%s"', filename); - - /* The following would normally be higher up the stack. */ - var err3 = new mod_verror.WError(err2, 'failed to handle request'); - console.log(err3.message); - console.log(err3.toString()); - console.log(err3.stack); -}); diff --git a/node_modules/verror/jsl.node.conf b/node_modules/verror/jsl.node.conf deleted file mode 100644 index bd724a2..0000000 --- a/node_modules/verror/jsl.node.conf +++ /dev/null @@ -1,139 +0,0 @@ -# -# Configuration File for JavaScript Lint -# -# This configuration file can be used to lint a collection of scripts, or to enable -# or disable warnings for scripts that are linted via the command line. -# - -### Warnings -# Enable or disable warnings based on requirements. -# Use "+WarningName" to display or "-WarningName" to suppress. -# -+ambiguous_else_stmt # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent -+ambiguous_nested_stmt # block statements containing block statements should use curly braces to resolve ambiguity -+ambiguous_newline # unexpected end of line; it is ambiguous whether these lines are part of the same statement -+anon_no_return_value # anonymous function does not always return value -+assign_to_function_call # assignment to a function call --block_without_braces # block statement without curly braces -+comma_separated_stmts # multiple statements separated by commas (use semicolons?) -+comparison_type_conv # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==) -+default_not_at_end # the default case is not at the end of the switch statement -+dup_option_explicit # duplicate "option explicit" control comment -+duplicate_case_in_switch # duplicate case in switch statement -+duplicate_formal # duplicate formal argument {name} -+empty_statement # empty statement or extra semicolon -+identifier_hides_another # identifer {name} hides an identifier in a parent scope --inc_dec_within_stmt # increment (++) and decrement (--) operators used as part of greater statement -+incorrect_version # Expected /*jsl:content-type*/ control comment. The script was parsed with the wrong version. -+invalid_fallthru # unexpected "fallthru" control comment -+invalid_pass # unexpected "pass" control comment -+jsl_cc_not_understood # couldn't understand control comment using /*jsl:keyword*/ syntax -+leading_decimal_point # leading decimal point may indicate a number or an object member -+legacy_cc_not_understood # couldn't understand control comment using /*@keyword@*/ syntax -+meaningless_block # meaningless block; curly braces have no impact -+mismatch_ctrl_comments # mismatched control comment; "ignore" and "end" control comments must have a one-to-one correspondence -+misplaced_regex # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma -+missing_break # missing break statement -+missing_break_for_last_case # missing break statement for last case in switch -+missing_default_case # missing default case in switch statement -+missing_option_explicit # the "option explicit" control comment is missing -+missing_semicolon # missing semicolon -+missing_semicolon_for_lambda # missing semicolon for lambda assignment -+multiple_plus_minus # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs -+nested_comment # nested comment -+no_return_value # function {name} does not always return a value -+octal_number # leading zeros make an octal number -+parseint_missing_radix # parseInt missing radix parameter -+partial_option_explicit # the "option explicit" control comment, if used, must be in the first script tag -+redeclared_var # redeclaration of {name} -+trailing_comma_in_array # extra comma is not recommended in array initializers -+trailing_decimal_point # trailing decimal point may indicate a number or an object member -+undeclared_identifier # undeclared identifier: {name} -+unreachable_code # unreachable code --unreferenced_argument # argument declared but never referenced: {name} --unreferenced_function # function is declared but never referenced: {name} -+unreferenced_variable # variable is declared but never referenced: {name} -+unsupported_version # JavaScript {version} is not supported -+use_of_label # use of label -+useless_assign # useless assignment -+useless_comparison # useless comparison; comparing identical expressions --useless_quotes # the quotation marks are unnecessary -+useless_void # use of the void type may be unnecessary (void is always undefined) -+var_hides_arg # variable {name} hides argument -+want_assign_or_call # expected an assignment or function call -+with_statement # with statement hides undeclared variables; use temporary variable instead - - -### Output format -# Customize the format of the error message. -# __FILE__ indicates current file path -# __FILENAME__ indicates current file name -# __LINE__ indicates current line -# __COL__ indicates current column -# __ERROR__ indicates error message (__ERROR_PREFIX__: __ERROR_MSG__) -# __ERROR_NAME__ indicates error name (used in configuration file) -# __ERROR_PREFIX__ indicates error prefix -# __ERROR_MSG__ indicates error message -# -# For machine-friendly output, the output format can be prefixed with -# "encode:". If specified, all items will be encoded with C-slashes. -# -# Visual Studio syntax (default): -+output-format __FILE__(__LINE__): __ERROR__ -# Alternative syntax: -#+output-format __FILE__:__LINE__: __ERROR__ - - -### Context -# Show the in-line position of the error. -# Use "+context" to display or "-context" to suppress. -# -+context - - -### Control Comments -# Both JavaScript Lint and the JScript interpreter confuse each other with the syntax for -# the /*@keyword@*/ control comments and JScript conditional comments. (The latter is -# enabled in JScript with @cc_on@). The /*jsl:keyword*/ syntax is preferred for this reason, -# although legacy control comments are enabled by default for backward compatibility. -# --legacy_control_comments - - -### Defining identifiers -# By default, "option explicit" is enabled on a per-file basis. -# To enable this for all files, use "+always_use_option_explicit" --always_use_option_explicit - -# Define certain identifiers of which the lint is not aware. -# (Use this in conjunction with the "undeclared identifier" warning.) -# -# Common uses for webpages might be: -+define __dirname -+define clearInterval -+define clearTimeout -+define console -+define exports -+define global -+define process -+define require -+define setInterval -+define setTimeout -+define Buffer -+define JSON -+define Math -+define __dirname -+define __filename - -### JavaScript Version -# To change the default JavaScript version: -#+default-type text/javascript;version=1.5 -#+default-type text/javascript;e4x=1 - -### Files -# Specify which files to lint -# Use "+recurse" to enable recursion (disabled by default). -# To add a set of files, use "+process FileName", "+process Folder\Path\*.js", -# or "+process Folder\Path\*.htm". -# - diff --git a/node_modules/verror/lib/verror.js b/node_modules/verror/lib/verror.js index 9ca087b..8663dde 100644 --- a/node_modules/verror/lib/verror.js +++ b/node_modules/verror/lib/verror.js @@ -2,58 +2,212 @@ * verror.js: richer JavaScript errors */ -var mod_assert = require('assert'); +var mod_assertplus = require('assert-plus'); var mod_util = require('util'); var mod_extsprintf = require('extsprintf'); +var mod_isError = require('core-util-is').isError; +var sprintf = mod_extsprintf.sprintf; /* * Public interface */ -exports.VError = VError; -exports.WError = WError; -exports.MultiError = MultiError; + +/* So you can 'var VError = require('verror')' */ +module.exports = VError; +/* For compatibility */ +VError.VError = VError; +/* Other exported classes */ +VError.SError = SError; +VError.WError = WError; +VError.MultiError = MultiError; /* - * Like JavaScript's built-in Error class, but supports a "cause" argument and a - * printf-style message. The cause argument can be null. + * Common function used to parse constructor arguments for VError, WError, and + * SError. Named arguments to this function: + * + * strict force strict interpretation of sprintf arguments, even + * if the options in "argv" don't say so + * + * argv error's constructor arguments, which are to be + * interpreted as described in README.md. For quick + * reference, "argv" has one of the following forms: + * + * [ sprintf_args... ] (argv[0] is a string) + * [ cause, sprintf_args... ] (argv[0] is an Error) + * [ options, sprintf_args... ] (argv[0] is an object) + * + * This function normalizes these forms, producing an object with the following + * properties: + * + * options equivalent to "options" in third form. This will never + * be a direct reference to what the caller passed in + * (i.e., it may be a shallow copy), so it can be freely + * modified. + * + * shortmessage result of sprintf(sprintf_args), taking options.strict + * into account as described in README.md. */ -function VError(options) +function parseConstructorArguments(args) { - var args, causedBy, ctor, tailmsg; + var argv, options, sprintf_args, shortmessage, k; - if (options instanceof Error || typeof (options) === 'object') { - args = Array.prototype.slice.call(arguments, 1); + mod_assertplus.object(args, 'args'); + mod_assertplus.bool(args.strict, 'args.strict'); + mod_assertplus.array(args.argv, 'args.argv'); + argv = args.argv; + + /* + * First, figure out which form of invocation we've been given. + */ + if (argv.length === 0) { + options = {}; + sprintf_args = []; + } else if (mod_isError(argv[0])) { + options = { 'cause': argv[0] }; + sprintf_args = argv.slice(1); + } else if (typeof (argv[0]) === 'object') { + options = {}; + for (k in argv[0]) { + options[k] = argv[0][k]; + } + sprintf_args = argv.slice(1); } else { - args = Array.prototype.slice.call(arguments, 0); - options = undefined; + mod_assertplus.string(argv[0], + 'first argument to VError, SError, or WError ' + + 'constructor must be a string, object, or Error'); + options = {}; + sprintf_args = argv; } - tailmsg = args.length > 0 ? - mod_extsprintf.sprintf.apply(null, args) : ''; - this.jse_shortmsg = tailmsg; - this.jse_summary = tailmsg; + /* + * Now construct the error's message. + * + * extsprintf (which we invoke here with our caller's arguments in order + * to construct this Error's message) is strict in its interpretation of + * values to be processed by the "%s" specifier. The value passed to + * extsprintf must actually be a string or something convertible to a + * String using .toString(). Passing other values (notably "null" and + * "undefined") is considered a programmer error. The assumption is + * that if you actually want to print the string "null" or "undefined", + * then that's easy to do that when you're calling extsprintf; on the + * other hand, if you did NOT want that (i.e., there's actually a bug + * where the program assumes some variable is non-null and tries to + * print it, which might happen when constructing a packet or file in + * some specific format), then it's better to stop immediately than + * produce bogus output. + * + * However, sometimes the bug is only in the code calling VError, and a + * programmer might prefer to have the error message contain "null" or + * "undefined" rather than have the bug in the error path crash the + * program (making the first bug harder to identify). For that reason, + * by default VError converts "null" or "undefined" arguments to their + * string representations and passes those to extsprintf. Programmers + * desiring the strict behavior can use the SError class or pass the + * "strict" option to the VError constructor. + */ + mod_assertplus.object(options); + if (!options.strict && !args.strict) { + sprintf_args = sprintf_args.map(function (a) { + return (a === null ? 'null' : + a === undefined ? 'undefined' : a); + }); + } - if (options) { - causedBy = options.cause; + if (sprintf_args.length === 0) { + shortmessage = ''; + } else { + shortmessage = sprintf.apply(null, sprintf_args); + } - if (!causedBy || !(options.cause instanceof Error)) - causedBy = options; + return ({ + 'options': options, + 'shortmessage': shortmessage + }); +} - if (causedBy && (causedBy instanceof Error)) { - this.jse_cause = causedBy; - this.jse_summary += ': ' + causedBy.message; +/* + * See README.md for reference documentation. + */ +function VError() +{ + var args, obj, parsed, cause, ctor, message, k; + + args = Array.prototype.slice.call(arguments, 0); + + /* + * This is a regrettable pattern, but JavaScript's built-in Error class + * is defined to work this way, so we allow the constructor to be called + * without "new". + */ + if (!(this instanceof VError)) { + obj = Object.create(VError.prototype); + VError.apply(obj, arguments); + return (obj); + } + + /* + * For convenience and backwards compatibility, we support several + * different calling forms. Normalize them here. + */ + parsed = parseConstructorArguments({ + 'argv': args, + 'strict': false + }); + + /* + * If we've been given a name, apply it now. + */ + if (parsed.options.name) { + mod_assertplus.string(parsed.options.name, + 'error\'s "name" must be a string'); + this.name = parsed.options.name; + } + + /* + * For debugging, we keep track of the original short message (attached + * this Error particularly) separately from the complete message (which + * includes the messages of our cause chain). + */ + this.jse_shortmsg = parsed.shortmessage; + message = parsed.shortmessage; + + /* + * If we've been given a cause, record a reference to it and update our + * message appropriately. + */ + cause = parsed.options.cause; + if (cause) { + mod_assertplus.ok(mod_isError(cause), 'cause is not an Error'); + this.jse_cause = cause; + + if (!parsed.options.skipCauseMessage) { + message += ': ' + cause.message; } } - this.message = this.jse_summary; - Error.call(this, this.jse_summary); + /* + * If we've been given an object with properties, shallow-copy that + * here. We don't want to use a deep copy in case there are non-plain + * objects here, but we don't want to use the original object in case + * the caller modifies it later. + */ + this.jse_info = {}; + if (parsed.options.info) { + for (k in parsed.options.info) { + this.jse_info[k] = parsed.options.info[k]; + } + } + + this.message = message; + Error.call(this, message); if (Error.captureStackTrace) { - ctor = options ? options.constructorOpt : undefined; - ctor = ctor || arguments.callee; + ctor = parsed.options.constructorOpt || this.constructor; Error.captureStackTrace(this, ctor); } + + return (this); } mod_util.inherits(VError, Error); @@ -69,11 +223,153 @@ VError.prototype.toString = function ve_toString() return (str); }; +/* + * This method is provided for compatibility. New callers should use + * VError.cause() instead. That method also uses the saner `null` return value + * when there is no cause. + */ VError.prototype.cause = function ve_cause() { - return (this.jse_cause); + var cause = VError.cause(this); + return (cause === null ? undefined : cause); }; +/* + * Static methods + * + * These class-level methods are provided so that callers can use them on + * instances of Errors that are not VErrors. New interfaces should be provided + * only using static methods to eliminate the class of programming mistake where + * people fail to check whether the Error object has the corresponding methods. + */ + +VError.cause = function (err) +{ + mod_assertplus.ok(mod_isError(err), 'err must be an Error'); + return (mod_isError(err.jse_cause) ? err.jse_cause : null); +}; + +VError.info = function (err) +{ + var rv, cause, k; + + mod_assertplus.ok(mod_isError(err), 'err must be an Error'); + cause = VError.cause(err); + if (cause !== null) { + rv = VError.info(cause); + } else { + rv = {}; + } + + if (typeof (err.jse_info) == 'object' && err.jse_info !== null) { + for (k in err.jse_info) { + rv[k] = err.jse_info[k]; + } + } + + return (rv); +}; + +VError.findCauseByName = function (err, name) +{ + var cause; + + mod_assertplus.ok(mod_isError(err), 'err must be an Error'); + mod_assertplus.string(name, 'name'); + mod_assertplus.ok(name.length > 0, 'name cannot be empty'); + + for (cause = err; cause !== null; cause = VError.cause(cause)) { + mod_assertplus.ok(mod_isError(cause)); + if (cause.name == name) { + return (cause); + } + } + + return (null); +}; + +VError.hasCauseWithName = function (err, name) +{ + return (VError.findCauseByName(err, name) !== null); +}; + +VError.fullStack = function (err) +{ + mod_assertplus.ok(mod_isError(err), 'err must be an Error'); + + var cause = VError.cause(err); + + if (cause) { + return (err.stack + '\ncaused by: ' + VError.fullStack(cause)); + } + + return (err.stack); +}; + +VError.errorFromList = function (errors) +{ + mod_assertplus.arrayOfObject(errors, 'errors'); + + if (errors.length === 0) { + return (null); + } + + errors.forEach(function (e) { + mod_assertplus.ok(mod_isError(e)); + }); + + if (errors.length == 1) { + return (errors[0]); + } + + return (new MultiError(errors)); +}; + +VError.errorForEach = function (err, func) +{ + mod_assertplus.ok(mod_isError(err), 'err must be an Error'); + mod_assertplus.func(func, 'func'); + + if (err instanceof MultiError) { + err.errors().forEach(function iterError(e) { func(e); }); + } else { + func(err); + } +}; + + +/* + * SError is like VError, but stricter about types. You cannot pass "null" or + * "undefined" as string arguments to the formatter. + */ +function SError() +{ + var args, obj, parsed, options; + + args = Array.prototype.slice.call(arguments, 0); + if (!(this instanceof SError)) { + obj = Object.create(SError.prototype); + SError.apply(obj, arguments); + return (obj); + } + + parsed = parseConstructorArguments({ + 'argv': args, + 'strict': true + }); + + options = parsed.options; + VError.call(this, options, '%s', parsed.shortmessage); + + return (this); +} + +/* + * We don't bother setting SError.prototype.name because once constructed, + * SErrors are just like VErrors. + */ +mod_util.inherits(SError, VError); + /* * Represents a collection of errors for the purpose of consumers that generally @@ -83,75 +379,73 @@ VError.prototype.cause = function ve_cause() */ function MultiError(errors) { - mod_assert.ok(errors.length > 0); + mod_assertplus.array(errors, 'list of errors'); + mod_assertplus.ok(errors.length > 0, 'must be at least one error'); this.ase_errors = errors; - VError.call(this, errors[0], 'first of %d error%s', - errors.length, errors.length == 1 ? '' : 's'); + VError.call(this, { + 'cause': errors[0] + }, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's'); } mod_util.inherits(MultiError, VError); +MultiError.prototype.name = 'MultiError'; +MultiError.prototype.errors = function me_errors() +{ + return (this.ase_errors.slice(0)); +}; /* - * Like JavaScript's built-in Error class, but supports a "cause" argument which - * is wrapped, not "folded in" as with VError. Accepts a printf-style message. - * The cause argument can be null. + * See README.md for reference details. */ -function WError(options) +function WError() { - Error.call(this); + var args, obj, parsed, options; - var args, cause, ctor; - if (typeof (options) === 'object') { - args = Array.prototype.slice.call(arguments, 1); - } else { - args = Array.prototype.slice.call(arguments, 0); - options = undefined; + args = Array.prototype.slice.call(arguments, 0); + if (!(this instanceof WError)) { + obj = Object.create(WError.prototype); + WError.apply(obj, args); + return (obj); } - if (args.length > 0) { - this.message = mod_extsprintf.sprintf.apply(null, args); - } else { - this.message = ''; - } + parsed = parseConstructorArguments({ + 'argv': args, + 'strict': false + }); - if (options) { - if (options instanceof Error) { - cause = options; - } else { - cause = options.cause; - ctor = options.constructorOpt; - } - } - - Error.captureStackTrace(this, ctor || this.constructor); - if (cause) - this.cause(cause); + options = parsed.options; + options['skipCauseMessage'] = true; + VError.call(this, options, '%s', parsed.shortmessage); + return (this); } -mod_util.inherits(WError, Error); +mod_util.inherits(WError, VError); WError.prototype.name = 'WError'; - WError.prototype.toString = function we_toString() { var str = (this.hasOwnProperty('name') && this.name || this.constructor.name || this.constructor.prototype.name); if (this.message) str += ': ' + this.message; - if (this.we_cause && this.we_cause.message) - str += '; caused by ' + this.we_cause.toString(); + if (this.jse_cause && this.jse_cause.message) + str += '; caused by ' + this.jse_cause.toString(); return (str); }; +/* + * For purely historical reasons, WError's cause() function allows you to set + * the cause. + */ WError.prototype.cause = function we_cause(c) { - if (c instanceof Error) - this.we_cause = c; + if (mod_isError(c)) + this.jse_cause = c; - return (this.we_cause); + return (this.jse_cause); }; diff --git a/node_modules/verror/package.json b/node_modules/verror/package.json index 9c111b3..d7e5d8b 100644 --- a/node_modules/verror/package.json +++ b/node_modules/verror/package.json @@ -1,72 +1,45 @@ { - "_args": [ - [ - { - "raw": "verror@1.3.6", - "scope": null, - "escapedName": "verror", - "name": "verror", - "rawSpec": "1.3.6", - "spec": "1.3.6", - "type": "version" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/jsprim" - ] - ], - "_from": "verror@1.3.6", - "_id": "verror@1.3.6", - "_inCache": true, + "_from": "verror@1.10.0", + "_id": "verror@1.10.0", + "_inBundle": false, + "_integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "_location": "/verror", - "_npmUser": { - "name": "dap", - "email": "dap@cs.brown.edu" - }, - "_npmVersion": "1.1.65", "_phantomChildren": {}, "_requested": { - "raw": "verror@1.3.6", - "scope": null, - "escapedName": "verror", + "type": "version", + "registry": true, + "raw": "verror@1.10.0", "name": "verror", - "rawSpec": "1.3.6", - "spec": "1.3.6", - "type": "version" + "escapedName": "verror", + "rawSpec": "1.10.0", + "saveSpec": null, + "fetchSpec": "1.10.0" }, "_requiredBy": [ "/jsprim" ], - "_resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", - "_shasum": "cff5df12946d297d2baaefaa2689e25be01c005c", - "_shrinkwrap": null, - "_spec": "verror@1.3.6", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/jsprim", + "_resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "_shasum": "3a105ca17053af55d6e270c1f8288682e18da400", + "_spec": "verror@1.10.0", + "_where": "/export/home/matjaz/git/zoneadmin-master/node_modules/jsprim", "bugs": { "url": "https://github.com/davepacheco/node-verror/issues" }, + "bundleDependencies": false, "dependencies": { - "extsprintf": "1.0.2" + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" }, + "deprecated": false, "description": "richer JavaScript errors", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "cff5df12946d297d2baaefaa2689e25be01c005c", - "tarball": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz" - }, "engines": [ "node >=0.6.0" ], "homepage": "https://github.com/davepacheco/node-verror#readme", + "license": "MIT", "main": "./lib/verror.js", - "maintainers": [ - { - "name": "dap", - "email": "dap@cs.brown.edu" - } - ], "name": "verror", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/davepacheco/node-verror.git" @@ -74,5 +47,5 @@ "scripts": { "test": "make test" }, - "version": "1.3.6" + "version": "1.10.0" } diff --git a/node_modules/verror/tests/tst.inherit.js b/node_modules/verror/tests/tst.inherit.js deleted file mode 100644 index 0f0d70b..0000000 --- a/node_modules/verror/tests/tst.inherit.js +++ /dev/null @@ -1,100 +0,0 @@ -/* - * tst.inherit.js: test that inheriting from VError and WError work as expected. - */ - -var mod_assert = require('assert'); -var mod_util = require('util'); - -var mod_verror = require('../lib/verror'); - -var VError = mod_verror.VError; -var WError = mod_verror.WError; -var err, suberr; - -function VErrorChild() -{ - VError.apply(this, Array.prototype.slice.call(arguments)); -} - -mod_util.inherits(VErrorChild, VError); -VErrorChild.prototype.name = 'VErrorChild'; - - -function WErrorChild() -{ - WError.apply(this, Array.prototype.slice.call(arguments)); -} - -mod_util.inherits(WErrorChild, WError); -WErrorChild.prototype.name = 'WErrorChild'; - - -suberr = new Error('root cause'); -err = new VErrorChild(suberr, 'top'); -mod_assert.ok(err instanceof Error); -mod_assert.ok(err instanceof VError); -mod_assert.ok(err instanceof VErrorChild); -mod_assert.equal(err.cause(), suberr); -mod_assert.equal(err.message, 'top: root cause'); -mod_assert.equal(err.toString(), 'VErrorChild: top: root cause'); -mod_assert.equal(err.stack.split('\n')[0], 'VErrorChild: top: root cause'); - -suberr = new Error('root cause'); -err = new WErrorChild(suberr, 'top'); -mod_assert.ok(err instanceof Error); -mod_assert.ok(err instanceof WError); -mod_assert.ok(err instanceof WErrorChild); -mod_assert.equal(err.cause(), suberr); -mod_assert.equal(err.message, 'top'); -mod_assert.equal(err.toString(), - 'WErrorChild: top; caused by Error: root cause'); -mod_assert.equal(err.stack.split('\n')[0], - 'WErrorChild: top; caused by Error: root cause'); - - -// Test that `.toString()` uses the ctor name. I.e. setting -// `.prototype.name` isn't necessary. -function VErrorChildNoName() { - VError.apply(this, Array.prototype.slice.call(arguments)); -} -mod_util.inherits(VErrorChildNoName, VError); -err = new VErrorChildNoName('top'); -mod_assert.equal(err.toString(), 'VErrorChildNoName: top'); - -function WErrorChildNoName() { - WError.apply(this, Array.prototype.slice.call(arguments)); -} -mod_util.inherits(WErrorChildNoName, WError); -err = new WErrorChildNoName('top'); -mod_assert.equal(err.toString(), 'WErrorChildNoName: top'); - - -// Test that `.prototype.name` can be used for the `.toString()` -// when the ctor is anonymous. -var VErrorChildAnon = function () { - VError.apply(this, Array.prototype.slice.call(arguments)); -}; -mod_util.inherits(VErrorChildAnon, VError); -VErrorChildAnon.prototype.name = 'VErrorChildAnon'; -err = new VErrorChildAnon('top'); -mod_assert.equal(err.toString(), 'VErrorChildAnon: top'); - -var WErrorChildAnon = function () { - WError.apply(this, Array.prototype.slice.call(arguments)); -}; -mod_util.inherits(WErrorChildAnon, WError); -WErrorChildAnon.prototype.name = 'WErrorChildAnon'; -err = new WErrorChildAnon('top'); -mod_assert.equal(err.toString(), 'WErrorChildAnon: top'); - - -// Test get appropriate exception name in `.toString()` when reconstituting -// an error instance a la: -// https://github.com/mcavage/node-fast/blob/master/lib/client.js#L215 -err = new VError('top'); -err.name = 'CustomNameError'; -mod_assert.equal(err.toString(), 'CustomNameError: top'); - -err = new WError('top'); -err.name = 'CustomNameError'; -mod_assert.equal(err.toString(), 'CustomNameError: top'); diff --git a/node_modules/verror/tests/tst.verror.js b/node_modules/verror/tests/tst.verror.js deleted file mode 100644 index ee937cd..0000000 --- a/node_modules/verror/tests/tst.verror.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * tst.verror.js: tests basic functionality of the VError class. - */ - -var mod_assert = require('assert'); -var mod_verror = require('../lib/verror'); - -var VError = mod_verror.VError; -var WError = mod_verror.WError; - -var err, suberr, stack, substack; - -/* - * Remove full paths and relative line numbers from stack traces so that we can - * compare against "known-good" output. - */ -function cleanStack(stacktxt) -{ - var re = new RegExp(__filename + ':\\d+:\\d+', 'gm'); - stacktxt = stacktxt.replace(re, 'tst.verror.js'); - return (stacktxt); -} - -/* - * Save the generic parts of all stack traces so we can avoid hardcoding - * Node-specific implementation details in our testing of stack traces. - */ -var nodestack = new Error().stack.split('\n').slice(2).join('\n'); - -/* no arguments */ -err = new VError(); -mod_assert.equal(err.name, 'VError'); -mod_assert.ok(err instanceof Error); -mod_assert.ok(err instanceof VError); -mod_assert.equal(err.message, ''); -mod_assert.ok(err.cause() === undefined); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'VError', - ' at Object. (tst.verror.js)' -].join('\n') + '\n' + nodestack); - -/* options-argument form */ -err = new VError({}); -mod_assert.equal(err.message, ''); -mod_assert.ok(err.cause() === undefined); - -/* simple message */ -err = new VError('my error'); -mod_assert.equal(err.message, 'my error'); -mod_assert.ok(err.cause() === undefined); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'VError: my error', - ' at Object. (tst.verror.js)' -].join('\n') + '\n' + nodestack); - -err = new VError({}, 'my error'); -mod_assert.equal(err.message, 'my error'); -mod_assert.ok(err.cause() === undefined); - -/* printf-style message */ -err = new VError('%s error: %3d problems', 'very bad', 15); -mod_assert.equal(err.message, 'very bad error: 15 problems'); -mod_assert.ok(err.cause() === undefined); - -err = new VError({}, '%s error: %3d problems', 'very bad', 15); -mod_assert.equal(err.message, 'very bad error: 15 problems'); -mod_assert.ok(err.cause() === undefined); - -/* caused by another error, with no additional message */ -suberr = new Error('root cause'); -err = new VError(suberr); -mod_assert.equal(err.message, ': root cause'); -mod_assert.ok(err.cause() === suberr); - -err = new VError({ 'cause': suberr }); -mod_assert.equal(err.message, ': root cause'); -mod_assert.ok(err.cause() === suberr); - -/* caused by another error, with annotation */ -err = new VError(suberr, 'proximate cause: %d issues', 3); -mod_assert.equal(err.message, 'proximate cause: 3 issues: root cause'); -mod_assert.ok(err.cause() === suberr); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'VError: proximate cause: 3 issues: root cause', - ' at Object. (tst.verror.js)' -].join('\n') + '\n' + nodestack); - -err = new VError({ 'cause': suberr }, 'proximate cause: %d issues', 3); -mod_assert.equal(err.message, 'proximate cause: 3 issues: root cause'); -mod_assert.ok(err.cause() === suberr); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'VError: proximate cause: 3 issues: root cause', - ' at Object. (tst.verror.js)' -].join('\n') + '\n' + nodestack); - -/* caused by another VError, with annotation. */ -suberr = err; -err = new VError(suberr, 'top'); -mod_assert.equal(err.message, 'top: proximate cause: 3 issues: root cause'); -mod_assert.ok(err.cause() === suberr); - -err = new VError({ 'cause': suberr }, 'top'); -mod_assert.equal(err.message, 'top: proximate cause: 3 issues: root cause'); -mod_assert.ok(err.cause() === suberr); - -/* caused by a WError */ -suberr = new WError(new Error('root cause'), 'mid'); -err = new VError(suberr, 'top'); -mod_assert.equal(err.message, 'top: mid'); -mod_assert.ok(err.cause() === suberr); - -/* null cause (for backwards compatibility with older versions) */ -err = new VError(null, 'my error'); -mod_assert.equal(err.message, 'my error'); -mod_assert.ok(err.cause() === undefined); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'VError: my error', - ' at Object. (tst.verror.js)' -].join('\n') + '\n' + nodestack); - -err = new VError({ 'cause': null }, 'my error'); -mod_assert.equal(err.message, 'my error'); -mod_assert.ok(err.cause() === undefined); - -err = new VError(null); -mod_assert.equal(err.message, ''); -mod_assert.ok(err.cause() === undefined); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'VError', - ' at Object. (tst.verror.js)' -].join('\n') + '\n' + nodestack); - -/* constructorOpt */ -function makeErr(options) { - return (new VError(options, 'test error')); -} -err = makeErr({}); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'VError: test error', - ' at makeErr (tst.verror.js)', - ' at Object. (tst.verror.js)' -].join('\n') + '\n' + nodestack); - -err = makeErr({ 'constructorOpt': makeErr }); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'VError: test error', - ' at Object. (tst.verror.js)' -].join('\n') + '\n' + nodestack); diff --git a/node_modules/verror/tests/tst.werror.js b/node_modules/verror/tests/tst.werror.js deleted file mode 100644 index c8cdc61..0000000 --- a/node_modules/verror/tests/tst.werror.js +++ /dev/null @@ -1,179 +0,0 @@ -/* - * tst.werror.js: tests basic functionality of the WError class. - */ - -var mod_assert = require('assert'); -var mod_verror = require('../lib/verror'); - -var VError = mod_verror.VError; -var WError = mod_verror.WError; - -var err, suberr, stack, substack; - -/* - * Remove full paths and relative line numbers from stack traces so that we can - * compare against "known-good" output. - */ -function cleanStack(stacktxt) -{ - var re = new RegExp(__filename + ':\\d+:\\d+', 'gm'); - stacktxt = stacktxt.replace(re, 'tst.werror.js'); - return (stacktxt); -} - -/* - * Save the generic parts of all stack traces so we can avoid hardcoding - * Node-specific implementation details in our testing of stack traces. - */ -var nodestack = new Error().stack.split('\n').slice(2).join('\n'); - -/* no arguments */ -err = new WError(); -mod_assert.equal(err.name, 'WError'); -mod_assert.ok(err instanceof Error); -mod_assert.ok(err instanceof WError); -mod_assert.equal(err.message, ''); -mod_assert.equal(err.toString(), 'WError'); -mod_assert.ok(err.cause() === undefined); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'WError', - ' at Object. (tst.werror.js)' -].join('\n') + '\n' + nodestack); - -/* options-argument form */ -err = new WError({}); -mod_assert.equal(err.message, ''); -mod_assert.equal(err.toString(), 'WError'); -mod_assert.ok(err.cause() === undefined); - -/* simple message */ -err = new WError('my error'); -mod_assert.equal(err.message, 'my error'); -mod_assert.equal(err.toString(), 'WError: my error'); -mod_assert.ok(err.cause() === undefined); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'WError: my error', - ' at Object. (tst.werror.js)' -].join('\n') + '\n' + nodestack); - -err = new WError({}, 'my error'); -mod_assert.equal(err.message, 'my error'); -mod_assert.equal(err.toString(), 'WError: my error'); -mod_assert.ok(err.cause() === undefined); - -/* printf-style message */ -err = new WError('%s error: %3d problems', 'very bad', 15); -mod_assert.equal(err.message, 'very bad error: 15 problems'); -mod_assert.equal(err.toString(), 'WError: very bad error: 15 problems'); -mod_assert.ok(err.cause() === undefined); - -err = new WError({}, '%s error: %3d problems', 'very bad', 15); -mod_assert.equal(err.message, 'very bad error: 15 problems'); -mod_assert.equal(err.toString(), 'WError: very bad error: 15 problems'); -mod_assert.ok(err.cause() === undefined); - -/* caused by another error, with no additional message */ -suberr = new Error('root cause'); -err = new WError(suberr); -mod_assert.equal(err.message, ''); -mod_assert.equal(err.toString(), 'WError; caused by Error: root cause'); -mod_assert.ok(err.cause() === suberr); - -err = new WError({ 'cause': suberr }); -mod_assert.equal(err.message, ''); -mod_assert.equal(err.toString(), 'WError; caused by Error: root cause'); -mod_assert.ok(err.cause() === suberr); - -/* caused by another error, with annotation */ -err = new WError(suberr, 'proximate cause: %d issues', 3); -mod_assert.equal(err.message, 'proximate cause: 3 issues'); -mod_assert.equal(err.toString(), 'WError: proximate cause: 3 issues; ' + - 'caused by Error: root cause'); -mod_assert.ok(err.cause() === suberr); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'WError: proximate cause: 3 issues; caused by Error: root cause', - ' at Object. (tst.werror.js)' -].join('\n') + '\n' + nodestack); - -err = new WError({ 'cause': suberr }, 'proximate cause: %d issues', 3); -mod_assert.equal(err.message, 'proximate cause: 3 issues'); -mod_assert.equal(err.toString(), 'WError: proximate cause: 3 issues; ' + - 'caused by Error: root cause'); -mod_assert.ok(err.cause() === suberr); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'WError: proximate cause: 3 issues; caused by Error: root cause', - ' at Object. (tst.werror.js)' -].join('\n') + '\n' + nodestack); - -/* caused by another WError, with annotation. */ -suberr = err; -err = new WError(suberr, 'top'); -mod_assert.equal(err.message, 'top'); -mod_assert.equal(err.toString(), 'WError: top; caused by WError: ' + - 'proximate cause: 3 issues; caused by Error: root cause'); -mod_assert.ok(err.cause() === suberr); - -err = new WError({ 'cause': suberr }, 'top'); -mod_assert.equal(err.message, 'top'); -mod_assert.equal(err.toString(), 'WError: top; caused by WError: ' + - 'proximate cause: 3 issues; caused by Error: root cause'); -mod_assert.ok(err.cause() === suberr); - -/* caused by a VError */ -suberr = new VError(new Error('root cause'), 'mid'); -err = new WError(suberr, 'top'); -mod_assert.equal(err.message, 'top'); -mod_assert.equal(err.toString(), - 'WError: top; caused by VError: mid: root cause'); -mod_assert.ok(err.cause() === suberr); - -/* null cause (for backwards compatibility with older versions) */ -err = new WError(null, 'my error'); -mod_assert.equal(err.message, 'my error'); -mod_assert.equal(err.toString(), 'WError: my error'); -mod_assert.ok(err.cause() === undefined); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'WError: my error', - ' at Object. (tst.werror.js)' -].join('\n') + '\n' + nodestack); - -err = new WError({ 'cause': null }, 'my error'); -mod_assert.equal(err.message, 'my error'); -mod_assert.equal(err.toString(), 'WError: my error'); -mod_assert.ok(err.cause() === undefined); - -err = new WError(null); -mod_assert.equal(err.message, ''); -mod_assert.equal(err.toString(), 'WError'); -mod_assert.ok(err.cause() === undefined); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'WError', - ' at Object. (tst.werror.js)' -].join('\n') + '\n' + nodestack); - -/* constructorOpt */ -function makeErr(options) { - return (new WError(options, 'test error')); -} -err = makeErr({}); -mod_assert.equal(err.toString(), 'WError: test error'); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'WError: test error', - ' at makeErr (tst.werror.js)', - ' at Object. (tst.werror.js)' -].join('\n') + '\n' + nodestack); - -err = makeErr({ 'constructorOpt': makeErr }); -mod_assert.equal(err.toString(), 'WError: test error'); -stack = cleanStack(err.stack); -mod_assert.equal(stack, [ - 'WError: test error', - ' at Object. (tst.werror.js)' -].join('\n') + '\n' + nodestack); diff --git a/node_modules/xtend/.jshintrc b/node_modules/xtend/.jshintrc deleted file mode 100644 index 77887b5..0000000 --- a/node_modules/xtend/.jshintrc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "maxdepth": 4, - "maxstatements": 200, - "maxcomplexity": 12, - "maxlen": 80, - "maxparams": 5, - - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": false, - "noarg": true, - "noempty": true, - "nonew": true, - "undef": true, - "unused": "vars", - "trailing": true, - - "quotmark": true, - "expr": true, - "asi": true, - - "browser": false, - "esnext": true, - "devel": false, - "node": false, - "nonstandard": false, - - "predef": ["require", "module", "__dirname", "__filename"] -} diff --git a/node_modules/xtend/.npmignore b/node_modules/xtend/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/xtend/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/xtend/LICENCE b/node_modules/xtend/LICENCE deleted file mode 100644 index 1a14b43..0000000 --- a/node_modules/xtend/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2014 Raynos. - -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/xtend/Makefile b/node_modules/xtend/Makefile deleted file mode 100644 index d583fcf..0000000 --- a/node_modules/xtend/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -browser: - node ./support/compile - -.PHONY: browser \ No newline at end of file diff --git a/node_modules/xtend/README.md b/node_modules/xtend/README.md deleted file mode 100644 index 093cb29..0000000 --- a/node_modules/xtend/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# xtend - -[![browser support][3]][4] - -[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) - -Extend like a boss - -xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. - -## Examples - -```js -var extend = require("xtend") - -// extend returns a new object. Does not mutate arguments -var combination = extend({ - a: "a", - b: 'c' -}, { - b: "b" -}) -// { a: "a", b: "b" } -``` - -## Stability status: Locked - -## MIT Licenced - - - [3]: http://ci.testling.com/Raynos/xtend.png - [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/xtend/immutable.js b/node_modules/xtend/immutable.js deleted file mode 100644 index 94889c9..0000000 --- a/node_modules/xtend/immutable.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/node_modules/xtend/mutable.js b/node_modules/xtend/mutable.js deleted file mode 100644 index 72debed..0000000 --- a/node_modules/xtend/mutable.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/node_modules/xtend/package.json b/node_modules/xtend/package.json deleted file mode 100644 index 2626a0b..0000000 --- a/node_modules/xtend/package.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "xtend@^4.0.0", - "scope": null, - "escapedName": "xtend", - "name": "xtend", - "rawSpec": "^4.0.0", - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "/tank/data/SERVER/zoneadm-master/node_modules/is-my-json-valid" - ] - ], - "_from": "xtend@>=4.0.0 <5.0.0", - "_id": "xtend@4.0.1", - "_inCache": true, - "_location": "/xtend", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "raynos", - "email": "raynos2@gmail.com" - }, - "_npmVersion": "2.14.1", - "_phantomChildren": {}, - "_requested": { - "raw": "xtend@^4.0.0", - "scope": null, - "escapedName": "xtend", - "name": "xtend", - "rawSpec": "^4.0.0", - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/is-my-json-valid" - ], - "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af", - "_shrinkwrap": null, - "_spec": "xtend@^4.0.0", - "_where": "/tank/data/SERVER/zoneadm-master/node_modules/is-my-json-valid", - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "bugs": { - "url": "https://github.com/Raynos/xtend/issues", - "email": "raynos2@gmail.com" - }, - "contributors": [ - { - "name": "Jake Verbaten" - }, - { - "name": "Matt Esch" - } - ], - "dependencies": {}, - "description": "extend like a boss", - "devDependencies": { - "tape": "~1.1.0" - }, - "directories": {}, - "dist": { - "shasum": "a5c6d532be656e23db820efb943a1f04998d63af", - "tarball": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" - }, - "engines": { - "node": ">=0.4" - }, - "gitHead": "23dc302a89756da89c1897bc732a752317e35390", - "homepage": "https://github.com/Raynos/xtend", - "keywords": [ - "extend", - "merge", - "options", - "opts", - "object", - "array" - ], - "license": "MIT", - "main": "immutable", - "maintainers": [ - { - "name": "raynos", - "email": "raynos2@gmail.com" - } - ], - "name": "xtend", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/Raynos/xtend.git" - }, - "scripts": { - "test": "node test" - }, - "testling": { - "files": "test.js", - "browsers": [ - "ie/7..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "version": "4.0.1" -} diff --git a/node_modules/xtend/test.js b/node_modules/xtend/test.js deleted file mode 100644 index 093a2b0..0000000 --- a/node_modules/xtend/test.js +++ /dev/null @@ -1,83 +0,0 @@ -var test = require("tape") -var extend = require("./") -var mutableExtend = require("./mutable") - -test("merge", function(assert) { - var a = { a: "foo" } - var b = { b: "bar" } - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("replace", function(assert) { - var a = { a: "foo" } - var b = { a: "bar" } - - assert.deepEqual(extend(a, b), { a: "bar" }) - assert.end() -}) - -test("undefined", function(assert) { - var a = { a: undefined } - var b = { b: "foo" } - - assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) - assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) - assert.end() -}) - -test("handle 0", function(assert) { - var a = { a: "default" } - var b = { a: 0 } - - assert.deepEqual(extend(a, b), { a: 0 }) - assert.deepEqual(extend(b, a), { a: "default" }) - assert.end() -}) - -test("is immutable", function (assert) { - var record = {} - - extend(record, { foo: "bar" }) - assert.equal(record.foo, undefined) - assert.end() -}) - -test("null as argument", function (assert) { - var a = { foo: "bar" } - var b = null - var c = void 0 - - assert.deepEqual(extend(b, a, c), { foo: "bar" }) - assert.end() -}) - -test("mutable", function (assert) { - var a = { foo: "bar" } - - mutableExtend(a, { bar: "baz" }) - - assert.equal(a.bar, "baz") - assert.end() -}) - -test("null prototype", function(assert) { - var a = { a: "foo" } - var b = Object.create(null) - b.b = "bar"; - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("null prototype mutable", function (assert) { - var a = { foo: "bar" } - var b = Object.create(null) - b.bar = "baz"; - - mutableExtend(a, b) - - assert.equal(a.bar, "baz") - assert.end() -}) diff --git a/package.json b/package.json index f3f9067..a169adc 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,12 @@ "body-parser": "~1.15.2", "cookie-parser": "~1.4.3", "debug": "~2.2.0", - "ejs": "~2.5.2", + "ejs": "^2.5.7", "express": "~4.14.0", "express-sse": "^0.4.1", "morgan": "~1.7.0", "nconf": "^0.8.4", - "request": "^2.79.0", + "request": "^2.82.0", "serve-favicon": "~2.3.0" } }