diff options
Diffstat (limited to 'node_modules/debug')
| -rw-r--r-- | node_modules/debug/CHANGELOG.md | 5 | ||||
| -rw-r--r-- | node_modules/debug/component.json | 2 | ||||
| -rw-r--r-- | node_modules/debug/node_modules/ms/index.js | 152 | ||||
| -rw-r--r-- | node_modules/debug/node_modules/ms/license.md | 21 | ||||
| -rw-r--r-- | node_modules/debug/node_modules/ms/package.json | 37 | ||||
| -rw-r--r-- | node_modules/debug/node_modules/ms/readme.md | 51 | ||||
| -rw-r--r-- | node_modules/debug/package.json | 2 | ||||
| -rw-r--r-- | node_modules/debug/src/browser.js | 10 | 
8 files changed, 12 insertions, 268 deletions
| diff --git a/node_modules/debug/CHANGELOG.md b/node_modules/debug/CHANGELOG.md index 189dbc824..a1a270cd4 100644 --- a/node_modules/debug/CHANGELOG.md +++ b/node_modules/debug/CHANGELOG.md @@ -1,4 +1,9 @@ +2.6.8 / 2017-05-18 +================== + +  * Fix: Check for undefined on browser globals (#462, @marbemac) +  2.6.7 / 2017-05-16  ================== diff --git a/node_modules/debug/component.json b/node_modules/debug/component.json index d7118d2f1..94cd36d8b 100644 --- a/node_modules/debug/component.json +++ b/node_modules/debug/component.json @@ -2,7 +2,7 @@    "name": "debug",    "repo": "visionmedia/debug",    "description": "small debugging utility", -  "version": "2.6.7", +  "version": "2.6.8",    "keywords": [      "debug",      "log", diff --git a/node_modules/debug/node_modules/ms/index.js b/node_modules/debug/node_modules/ms/index.js deleted file mode 100644 index 6a522b16b..000000000 --- a/node_modules/debug/node_modules/ms/index.js +++ /dev/null @@ -1,152 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - *  - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options) { -  options = options || {}; -  var type = typeof val; -  if (type === 'string' && val.length > 0) { -    return parse(val); -  } else if (type === 'number' && isNaN(val) === false) { -    return options.long ? fmtLong(val) : fmtShort(val); -  } -  throw new Error( -    'val is not a non-empty string or a valid number. val=' + -      JSON.stringify(val) -  ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { -  str = String(str); -  if (str.length > 100) { -    return; -  } -  var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( -    str -  ); -  if (!match) { -    return; -  } -  var n = parseFloat(match[1]); -  var type = (match[2] || 'ms').toLowerCase(); -  switch (type) { -    case 'years': -    case 'year': -    case 'yrs': -    case 'yr': -    case 'y': -      return n * y; -    case 'days': -    case 'day': -    case 'd': -      return n * d; -    case 'hours': -    case 'hour': -    case 'hrs': -    case 'hr': -    case 'h': -      return n * h; -    case 'minutes': -    case 'minute': -    case 'mins': -    case 'min': -    case 'm': -      return n * m; -    case 'seconds': -    case 'second': -    case 'secs': -    case 'sec': -    case 's': -      return n * s; -    case 'milliseconds': -    case 'millisecond': -    case 'msecs': -    case 'msec': -    case 'ms': -      return n; -    default: -      return undefined; -  } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { -  if (ms >= d) { -    return Math.round(ms / d) + 'd'; -  } -  if (ms >= h) { -    return Math.round(ms / h) + 'h'; -  } -  if (ms >= m) { -    return Math.round(ms / m) + 'm'; -  } -  if (ms >= s) { -    return Math.round(ms / s) + 's'; -  } -  return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { -  return plural(ms, d, 'day') || -    plural(ms, h, 'hour') || -    plural(ms, m, 'minute') || -    plural(ms, s, 'second') || -    ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { -  if (ms < n) { -    return; -  } -  if (ms < n * 1.5) { -    return Math.floor(ms / n) + ' ' + name; -  } -  return Math.ceil(ms / n) + ' ' + name + 's'; -} diff --git a/node_modules/debug/node_modules/ms/license.md b/node_modules/debug/node_modules/ms/license.md deleted file mode 100644 index 69b61253a..000000000 --- a/node_modules/debug/node_modules/ms/license.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Zeit, Inc. - -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/debug/node_modules/ms/package.json b/node_modules/debug/node_modules/ms/package.json deleted file mode 100644 index 6a31c81fa..000000000 --- a/node_modules/debug/node_modules/ms/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ -  "name": "ms", -  "version": "2.0.0", -  "description": "Tiny milisecond conversion utility", -  "repository": "zeit/ms", -  "main": "./index", -  "files": [ -    "index.js" -  ], -  "scripts": { -    "precommit": "lint-staged", -    "lint": "eslint lib/* bin/*", -    "test": "mocha tests.js" -  }, -  "eslintConfig": { -    "extends": "eslint:recommended", -    "env": { -      "node": true, -      "es6": true -    } -  }, -  "lint-staged": { -    "*.js": [ -      "npm run lint", -      "prettier --single-quote --write", -      "git add" -    ] -  }, -  "license": "MIT", -  "devDependencies": { -    "eslint": "3.19.0", -    "expect.js": "0.3.1", -    "husky": "0.13.3", -    "lint-staged": "3.4.1", -    "mocha": "3.4.1" -  } -} diff --git a/node_modules/debug/node_modules/ms/readme.md b/node_modules/debug/node_modules/ms/readme.md deleted file mode 100644 index 84a9974cc..000000000 --- a/node_modules/debug/node_modules/ms/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# ms - -[](https://travis-ci.org/zeit/ms) -[](https://zeit.chat/) - -Use this package to easily convert various time formats to milliseconds. - -## Examples - -```js -ms('2 days')  // 172800000 -ms('1d')      // 86400000 -ms('10h')     // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h')      // 7200000 -ms('1m')      // 60000 -ms('5s')      // 5000 -ms('1y')      // 31557600000 -ms('100')     // 100 -``` - -### Convert from milliseconds - -```js -ms(60000)             // "1m" -ms(2 * 60000)         // "2m" -ms(ms('10 hours'))    // "10h" -``` - -### Time format written-out - -```js -ms(60000, { long: true })             // "1 minute" -ms(2 * 60000, { long: true })         // "2 minutes" -ms(ms('10 hours'), { long: true })    // "10 hours" -``` - -## Features - -- Works both in [node](https://nodejs.org) and in the browser. -- If a number is supplied to `ms`, a string with a unit is returned. -- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). -- If you pass a string with a number and a valid unit, the number of equivalent ms is returned. - -## Caught a bug? - -1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device -2. Link the package to the global module directory: `npm link` -3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! - -As always, you can run the tests using: `npm test` diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json index 02ae1486f..df863517f 100644 --- a/node_modules/debug/package.json +++ b/node_modules/debug/package.json @@ -1,6 +1,6 @@  {    "name": "debug", -  "version": "2.6.7", +  "version": "2.6.8",    "repository": {      "type": "git",      "url": "git://github.com/visionmedia/debug.git" diff --git a/node_modules/debug/src/browser.js b/node_modules/debug/src/browser.js index 7978ce722..710692493 100644 --- a/node_modules/debug/src/browser.js +++ b/node_modules/debug/src/browser.js @@ -40,20 +40,20 @@ function useColors() {    // NB: In an Electron preload script, document will be defined but not fully    // initialized. Since we know we're in Chrome, we'll just detect this case    // explicitly -  if (window && window.process && window.process.type === 'renderer') { +  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {      return true;    }    // is webkit? http://stackoverflow.com/a/16459606/376773    // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 -  return (document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || +  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||      // is firebug? http://stackoverflow.com/a/398120/376773 -    (window && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || +    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||      // is firefox >= v31?      // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages -    (navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || +    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||      // double check webkit in userAgent just in case we are in a worker -    (navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));  }  /** | 
