diff options
Diffstat (limited to 'deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed')
4 files changed, 221 insertions, 0 deletions
diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/index.js b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/index.js new file mode 100644 index 0000000000..663ee338fc --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/index.js @@ -0,0 +1,60 @@ +'use strict'; + +var WHITELIST = [ + 'ETIMEDOUT', + 'ECONNRESET', + 'EADDRINUSE', + 'ESOCKETTIMEDOUT', + 'ECONNREFUSED', + 'EPIPE' +]; + +var BLACKLIST = [ + 'ENOTFOUND', + 'ENETUNREACH', + + // SSL errors from https://github.com/nodejs/node/blob/ed3d8b13ee9a705d89f9e0397d9e96519e7e47ac/src/node_crypto.cc#L1950 + 'UNABLE_TO_GET_ISSUER_CERT', + 'UNABLE_TO_GET_CRL', + 'UNABLE_TO_DECRYPT_CERT_SIGNATURE', + 'UNABLE_TO_DECRYPT_CRL_SIGNATURE', + 'UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY', + 'CERT_SIGNATURE_FAILURE', + 'CRL_SIGNATURE_FAILURE', + 'CERT_NOT_YET_VALID', + 'CERT_HAS_EXPIRED', + 'CRL_NOT_YET_VALID', + 'CRL_HAS_EXPIRED', + 'ERROR_IN_CERT_NOT_BEFORE_FIELD', + 'ERROR_IN_CERT_NOT_AFTER_FIELD', + 'ERROR_IN_CRL_LAST_UPDATE_FIELD', + 'ERROR_IN_CRL_NEXT_UPDATE_FIELD', + 'OUT_OF_MEM', + 'DEPTH_ZERO_SELF_SIGNED_CERT', + 'SELF_SIGNED_CERT_IN_CHAIN', + 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY', + 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', + 'CERT_CHAIN_TOO_LONG', + 'CERT_REVOKED', + 'INVALID_CA', + 'PATH_LENGTH_EXCEEDED', + 'INVALID_PURPOSE', + 'CERT_UNTRUSTED', + 'CERT_REJECTED' +]; + +module.exports = function (err) { + if (!err || !err.code) { + return true; + } + + if (WHITELIST.indexOf(err.code) !== -1) { + return true; + } + + if (BLACKLIST.indexOf(err.code) !== -1) { + return false; + } + + return true; +}; diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/license b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/license new file mode 100644 index 0000000000..1aeb74fd25 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> (github.com/floatdrop) + +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/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/package.json b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/package.json new file mode 100644 index 0000000000..8e177dd43d --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "is-retry-allowed@^1.0.0", + "scope": null, + "escapedName": "is-retry-allowed", + "name": "is-retry-allowed", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got" + ] + ], + "_from": "is-retry-allowed@>=1.0.0 <2.0.0", + "_id": "is-retry-allowed@1.1.0", + "_inCache": true, + "_location": "/update-notifier/latest-version/package-json/got/is-retry-allowed", + "_nodeVersion": "4.4.7", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/is-retry-allowed-1.1.0.tgz_1467498831328_0.0396464669611305" + }, + "_npmUser": { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + }, + "_npmVersion": "2.15.8", + "_phantomChildren": {}, + "_requested": { + "raw": "is-retry-allowed@^1.0.0", + "scope": null, + "escapedName": "is-retry-allowed", + "name": "is-retry-allowed", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/update-notifier/latest-version/package-json/got" + ], + "_resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "_shasum": "11a060568b67339444033d0125a61a20d564fb34", + "_shrinkwrap": null, + "_spec": "is-retry-allowed@^1.0.0", + "_where": "/Users/ceej/code/Tools/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got", + "author": { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", + "url": "github.com/floatdrop" + }, + "bugs": { + "url": "https://github.com/floatdrop/is-retry-allowed/issues" + }, + "dependencies": {}, + "description": "My prime module", + "devDependencies": { + "ava": "^0.8.0", + "xo": "^0.12.1" + }, + "directories": {}, + "dist": { + "shasum": "11a060568b67339444033d0125a61a20d564fb34", + "tarball": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "8ca0d01b23b0a92bcf232d97801c3f08c41231a3", + "homepage": "https://github.com/floatdrop/is-retry-allowed#readme", + "keywords": [], + "license": "MIT", + "maintainers": [ + { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + }, + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-retry-allowed", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/floatdrop/is-retry-allowed.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/readme.md b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/readme.md new file mode 100644 index 0000000000..4212d099b5 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/readme.md @@ -0,0 +1,42 @@ +# is-retry-allowed [![Build Status](https://travis-ci.org/floatdrop/is-retry-allowed.svg?branch=master)](https://travis-ci.org/floatdrop/is-retry-allowed) + +Is retry allowed for Error? + + +## Install + +``` +$ npm install --save is-retry-allowed +``` + + +## Usage + +```js +const isRetryAllowed = require('is-retry-allowed'); + +isRetryAllowed({code: 'ETIMEDOUT'}); +//=> true + +isRetryAllowed({code: 'ENOTFOUND'}); +//=> false + +isRetryAllowed({}); +//=> true +``` + + +## API + +### isRetryAllowed(error) + +#### error + +Type: `object` + +Object with `code` property, which will be used to determine retry. + + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) |