fsevents 1.2.7 → 1.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/.travis.yml +1 -2
  2. package/binding.gyp +1 -9
  3. package/fsevents.cc +8 -11
  4. package/fsevents.js +1 -3
  5. package/node_modules/abbrev/package.json +2 -3
  6. package/node_modules/ansi-regex/package.json +1 -1
  7. package/node_modules/aproba/package.json +1 -1
  8. package/node_modules/are-we-there-yet/package.json +1 -1
  9. package/node_modules/balanced-match/package.json +1 -1
  10. package/node_modules/brace-expansion/package.json +1 -1
  11. package/node_modules/chownr/chownr.js +47 -10
  12. package/node_modules/chownr/package.json +7 -7
  13. package/node_modules/code-point-at/package.json +1 -1
  14. package/node_modules/concat-map/package.json +1 -1
  15. package/node_modules/console-control-strings/package.json +1 -1
  16. package/node_modules/core-util-is/package.json +1 -1
  17. package/node_modules/debug/CHANGELOG.md +34 -1
  18. package/node_modules/debug/README.md +188 -63
  19. package/node_modules/debug/dist/debug.js +886 -0
  20. package/node_modules/debug/package.json +28 -26
  21. package/node_modules/debug/src/browser.js +77 -82
  22. package/node_modules/debug/src/common.js +249 -0
  23. package/node_modules/debug/src/index.js +5 -3
  24. package/node_modules/debug/src/node.js +72 -146
  25. package/node_modules/deep-extend/package.json +1 -1
  26. package/node_modules/delegates/package.json +1 -1
  27. package/node_modules/detect-libc/package.json +1 -1
  28. package/node_modules/fs-minipass/index.js +2 -1
  29. package/node_modules/fs-minipass/package.json +13 -10
  30. package/node_modules/fs.realpath/package.json +1 -1
  31. package/node_modules/gauge/package.json +1 -1
  32. package/node_modules/glob/LICENSE +6 -0
  33. package/node_modules/glob/README.md +8 -1
  34. package/node_modules/glob/package.json +9 -6
  35. package/node_modules/has-unicode/package.json +1 -1
  36. package/node_modules/iconv-lite/package.json +1 -1
  37. package/node_modules/ignore-walk/README.md +1 -1
  38. package/node_modules/ignore-walk/index.js +9 -5
  39. package/node_modules/ignore-walk/package.json +11 -8
  40. package/node_modules/inflight/package.json +1 -1
  41. package/node_modules/inherits/inherits.js +2 -0
  42. package/node_modules/inherits/inherits_browser.js +18 -14
  43. package/node_modules/inherits/package.json +9 -11
  44. package/node_modules/ini/package.json +1 -1
  45. package/node_modules/is-fullwidth-code-point/package.json +1 -1
  46. package/node_modules/isarray/package.json +1 -1
  47. package/node_modules/minimatch/package.json +1 -1
  48. package/node_modules/minimist/package.json +1 -1
  49. package/node_modules/minipass/README.md +486 -4
  50. package/node_modules/minipass/index.js +190 -28
  51. package/node_modules/minipass/package.json +17 -14
  52. package/node_modules/minizlib/README.md +36 -27
  53. package/node_modules/minizlib/constants.js +73 -4
  54. package/node_modules/minizlib/index.js +137 -152
  55. package/node_modules/minizlib/package.json +12 -12
  56. package/node_modules/mkdirp/package.json +1 -2
  57. package/node_modules/ms/index.js +29 -19
  58. package/node_modules/ms/package.json +17 -17
  59. package/node_modules/ms/readme.md +18 -9
  60. package/node_modules/needle/README.md +1 -2
  61. package/node_modules/needle/examples/multipart-stream.js +1 -1
  62. package/node_modules/needle/lib/auth.js +1 -1
  63. package/node_modules/needle/lib/multipart.js +1 -1
  64. package/node_modules/needle/lib/needle.js +4 -2
  65. package/node_modules/needle/package.json +13 -13
  66. package/node_modules/needle/test/basic_auth_spec.js +1 -1
  67. package/node_modules/needle/test/cookies_spec.js +2 -2
  68. package/node_modules/needle/test/headers_spec.js +1 -1
  69. package/node_modules/needle/test/output_spec.js +1 -1
  70. package/node_modules/needle/test/post_data_spec.js +20 -20
  71. package/node_modules/needle/test/proxy_spec.js +1 -1
  72. package/node_modules/needle/test/utils/test.js +1 -1
  73. package/node_modules/node-pre-gyp/CHANGELOG.md +21 -0
  74. package/node_modules/node-pre-gyp/README.md +41 -6
  75. package/node_modules/node-pre-gyp/lib/build.js +1 -1
  76. package/node_modules/node-pre-gyp/lib/install.js +64 -22
  77. package/node_modules/node-pre-gyp/lib/node-pre-gyp.js +1 -1
  78. package/node_modules/node-pre-gyp/lib/pre-binding.js +5 -5
  79. package/node_modules/node-pre-gyp/lib/rebuild.js +1 -1
  80. package/node_modules/node-pre-gyp/lib/reinstall.js +1 -1
  81. package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +288 -0
  82. package/node_modules/node-pre-gyp/lib/util/handle_gyp_opts.js +5 -2
  83. package/node_modules/node-pre-gyp/lib/util/napi.js +72 -23
  84. package/node_modules/node-pre-gyp/lib/util/versioning.js +7 -6
  85. package/node_modules/node-pre-gyp/package.json +12 -12
  86. package/node_modules/nopt/package.json +1 -1
  87. package/node_modules/npm-bundled/index.js +26 -6
  88. package/node_modules/npm-bundled/package.json +9 -6
  89. package/node_modules/npm-normalize-package-bin/.github/settings.yml +2 -0
  90. package/node_modules/npm-normalize-package-bin/.npmignore +24 -0
  91. package/node_modules/npm-normalize-package-bin/LICENSE +15 -0
  92. package/node_modules/npm-normalize-package-bin/README.md +14 -0
  93. package/node_modules/npm-normalize-package-bin/index.js +60 -0
  94. package/node_modules/npm-normalize-package-bin/package-lock.json +3529 -0
  95. package/node_modules/npm-normalize-package-bin/package.json +57 -0
  96. package/node_modules/npm-normalize-package-bin/test/array.js +37 -0
  97. package/node_modules/npm-normalize-package-bin/test/nobin.js +35 -0
  98. package/node_modules/npm-normalize-package-bin/test/object.js +141 -0
  99. package/node_modules/npm-normalize-package-bin/test/string.js +37 -0
  100. package/node_modules/npm-packlist/index.js +76 -16
  101. package/node_modules/npm-packlist/package.json +16 -9
  102. package/node_modules/npmlog/package.json +1 -1
  103. package/node_modules/number-is-nan/package.json +1 -1
  104. package/node_modules/object-assign/package.json +1 -1
  105. package/node_modules/once/package.json +1 -1
  106. package/node_modules/os-homedir/package.json +1 -1
  107. package/node_modules/os-tmpdir/package.json +1 -1
  108. package/node_modules/osenv/package.json +1 -1
  109. package/node_modules/path-is-absolute/package.json +1 -1
  110. package/node_modules/process-nextick-args/index.js +2 -1
  111. package/node_modules/process-nextick-args/package.json +6 -6
  112. package/node_modules/rc/node_modules/minimist/package.json +1 -1
  113. package/node_modules/rc/package.json +1 -1
  114. package/node_modules/readable-stream/package.json +1 -1
  115. package/node_modules/rimraf/package.json +6 -6
  116. package/node_modules/rimraf/rimraf.js +9 -1
  117. package/node_modules/safe-buffer/package.json +1 -1
  118. package/node_modules/safer-buffer/package.json +1 -1
  119. package/node_modules/sax/package.json +1 -1
  120. package/node_modules/semver/CHANGELOG.md +39 -0
  121. package/node_modules/semver/README.md +26 -13
  122. package/node_modules/semver/bin/semver +84 -77
  123. package/node_modules/semver/package.json +14 -8
  124. package/node_modules/semver/semver.js +906 -775
  125. package/node_modules/set-blocking/package.json +1 -1
  126. package/node_modules/signal-exit/package.json +1 -1
  127. package/node_modules/string-width/package.json +1 -1
  128. package/node_modules/string_decoder/package.json +1 -1
  129. package/node_modules/strip-ansi/package.json +1 -1
  130. package/node_modules/strip-json-comments/package.json +1 -1
  131. package/node_modules/tar/lib/large-numbers.js +32 -27
  132. package/node_modules/tar/lib/mkdir.js +2 -2
  133. package/node_modules/tar/lib/parse.js +6 -1
  134. package/node_modules/tar/lib/read-entry.js +4 -0
  135. package/node_modules/tar/lib/write-entry.js +2 -2
  136. package/node_modules/tar/package.json +22 -18
  137. package/node_modules/util-deprecate/package.json +1 -1
  138. package/node_modules/wide-align/package.json +1 -1
  139. package/node_modules/wrappy/package.json +1 -1
  140. package/node_modules/yallist/package.json +11 -11
  141. package/node_modules/yallist/yallist.js +50 -0
  142. package/package.json +5 -18
  143. package/src/constants.cc +20 -20
  144. package/install.js +0 -7
  145. package/node_modules/debug/.coveralls.yml +0 -1
  146. package/node_modules/debug/.eslintrc +0 -11
  147. package/node_modules/debug/.npmignore +0 -9
  148. package/node_modules/debug/.travis.yml +0 -14
  149. package/node_modules/debug/Makefile +0 -50
  150. package/node_modules/debug/component.json +0 -19
  151. package/node_modules/debug/karma.conf.js +0 -70
  152. package/node_modules/debug/src/debug.js +0 -202
  153. package/node_modules/debug/src/inspector-log.js +0 -15
  154. package/node_modules/needle/note.xml +0 -7
  155. package/node_modules/needle/note.xml.1 +0 -7
@@ -1,27 +1,27 @@
1
1
  {
2
- "_from": "debug@^2.1.2",
3
- "_id": "debug@2.6.9",
2
+ "_from": "debug@^3.2.6",
3
+ "_id": "debug@3.2.6",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
5
+ "_integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
6
6
  "_location": "/debug",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
9
9
  "type": "range",
10
10
  "registry": true,
11
- "raw": "debug@^2.1.2",
11
+ "raw": "debug@^3.2.6",
12
12
  "name": "debug",
13
13
  "escapedName": "debug",
14
- "rawSpec": "^2.1.2",
14
+ "rawSpec": "^3.2.6",
15
15
  "saveSpec": null,
16
- "fetchSpec": "^2.1.2"
16
+ "fetchSpec": "^3.2.6"
17
17
  },
18
18
  "_requiredBy": [
19
19
  "/needle"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
22
- "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
23
- "_spec": "debug@^2.1.2",
24
- "_where": "/Users/pdunkel1/Office/fsevents/fsevents/node_modules/needle",
21
+ "_resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
22
+ "_shasum": "e83d17de16d8a7efb7717edbe5fb10135eee629b",
23
+ "_spec": "debug@^3.2.6",
24
+ "_where": "/Users/pipobscure/fsevents/node_modules/needle",
25
25
  "author": {
26
26
  "name": "TJ Holowaychuk",
27
27
  "email": "tj@vision-media.ca"
@@ -31,12 +31,6 @@
31
31
  "url": "https://github.com/visionmedia/debug/issues"
32
32
  },
33
33
  "bundleDependencies": false,
34
- "component": {
35
- "scripts": {
36
- "debug/index.js": "browser.js",
37
- "debug/debug.js": "debug.js"
38
- }
39
- },
40
34
  "contributors": [
41
35
  {
42
36
  "name": "Nathan Rajlich",
@@ -49,28 +43,35 @@
49
43
  }
50
44
  ],
51
45
  "dependencies": {
52
- "ms": "2.0.0"
46
+ "ms": "^2.1.1"
53
47
  },
54
48
  "deprecated": false,
55
49
  "description": "small debugging utility",
56
50
  "devDependencies": {
57
- "browserify": "9.0.3",
51
+ "@babel/cli": "^7.0.0",
52
+ "@babel/core": "^7.0.0",
53
+ "@babel/preset-env": "^7.0.0",
54
+ "browserify": "14.4.0",
58
55
  "chai": "^3.5.0",
59
56
  "concurrently": "^3.1.0",
60
- "coveralls": "^2.11.15",
61
- "eslint": "^3.12.1",
57
+ "coveralls": "^3.0.2",
62
58
  "istanbul": "^0.4.5",
63
- "karma": "^1.3.0",
59
+ "karma": "^3.0.0",
64
60
  "karma-chai": "^0.1.0",
65
61
  "karma-mocha": "^1.3.0",
66
62
  "karma-phantomjs-launcher": "^1.0.2",
67
- "karma-sinon": "^1.0.5",
68
- "mocha": "^3.2.0",
63
+ "mocha": "^5.2.0",
69
64
  "mocha-lcov-reporter": "^1.2.0",
70
65
  "rimraf": "^2.5.4",
71
- "sinon": "^1.17.6",
72
- "sinon-chai": "^2.8.0"
66
+ "xo": "^0.23.0"
73
67
  },
68
+ "files": [
69
+ "src",
70
+ "node.js",
71
+ "dist/debug.js",
72
+ "LICENSE",
73
+ "README.md"
74
+ ],
74
75
  "homepage": "https://github.com/visionmedia/debug#readme",
75
76
  "keywords": [
76
77
  "debug",
@@ -84,5 +85,6 @@
84
85
  "type": "git",
85
86
  "url": "git://github.com/visionmedia/debug.git"
86
87
  },
87
- "version": "2.6.9"
88
+ "unpkg": "./dist/debug.js",
89
+ "version": "3.2.6"
88
90
  }
@@ -1,33 +1,23 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ /* eslint-env browser */
6
+
1
7
  /**
2
8
  * This is the web browser implementation of `debug()`.
3
- *
4
- * Expose `debug()` as the module.
5
9
  */
6
-
7
- exports = module.exports = require('./debug');
8
10
  exports.log = log;
9
11
  exports.formatArgs = formatArgs;
10
12
  exports.save = save;
11
13
  exports.load = load;
12
14
  exports.useColors = useColors;
13
- exports.storage = 'undefined' != typeof chrome
14
- && 'undefined' != typeof chrome.storage
15
- ? chrome.storage.local
16
- : localstorage();
17
-
15
+ exports.storage = localstorage();
18
16
  /**
19
17
  * Colors.
20
18
  */
21
19
 
22
- exports.colors = [
23
- 'lightseagreen',
24
- 'forestgreen',
25
- 'goldenrod',
26
- 'dodgerblue',
27
- 'darkorchid',
28
- 'crimson'
29
- ];
30
-
20
+ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
31
21
  /**
32
22
  * Currently only WebKit-based Web Inspectors, Firefox >= v31,
33
23
  * and the Firebug extension (any Firefox version) are known
@@ -35,79 +25,65 @@ exports.colors = [
35
25
  *
36
26
  * TODO: add a `localStorage` variable to explicitly enable/disable colors
37
27
  */
28
+ // eslint-disable-next-line complexity
38
29
 
39
30
  function useColors() {
40
31
  // NB: In an Electron preload script, document will be defined but not fully
41
32
  // initialized. Since we know we're in Chrome, we'll just detect this case
42
33
  // explicitly
43
- if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
34
+ if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
44
35
  return true;
45
- }
36
+ } // Internet Explorer and Edge do not support colors.
46
37
 
47
- // is webkit? http://stackoverflow.com/a/16459606/376773
48
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
49
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
50
- // is firebug? http://stackoverflow.com/a/398120/376773
51
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
52
- // is firefox >= v31?
53
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
54
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
55
- // double check webkit in userAgent just in case we are in a worker
56
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
57
- }
58
38
 
59
- /**
60
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
61
- */
62
-
63
- exports.formatters.j = function(v) {
64
- try {
65
- return JSON.stringify(v);
66
- } catch (err) {
67
- return '[UnexpectedJSONParseError]: ' + err.message;
68
- }
69
- };
39
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
40
+ return false;
41
+ } // Is webkit? http://stackoverflow.com/a/16459606/376773
42
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
70
43
 
71
44
 
45
+ return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
46
+ typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
47
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
48
+ 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
49
+ typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
50
+ }
72
51
  /**
73
52
  * Colorize log arguments if enabled.
74
53
  *
75
54
  * @api public
76
55
  */
77
56
 
78
- function formatArgs(args) {
79
- var useColors = this.useColors;
80
57
 
81
- args[0] = (useColors ? '%c' : '')
82
- + this.namespace
83
- + (useColors ? ' %c' : ' ')
84
- + args[0]
85
- + (useColors ? '%c ' : ' ')
86
- + '+' + exports.humanize(this.diff);
58
+ function formatArgs(args) {
59
+ args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
87
60
 
88
- if (!useColors) return;
61
+ if (!this.useColors) {
62
+ return;
63
+ }
89
64
 
90
65
  var c = 'color: ' + this.color;
91
- args.splice(1, 0, c, 'color: inherit')
92
-
93
- // the final "%c" is somewhat tricky, because there could be other
66
+ args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
94
67
  // arguments passed either before or after the %c, so we need to
95
68
  // figure out the correct index to insert the CSS into
69
+
96
70
  var index = 0;
97
71
  var lastC = 0;
98
- args[0].replace(/%[a-zA-Z%]/g, function(match) {
99
- if ('%%' === match) return;
72
+ args[0].replace(/%[a-zA-Z%]/g, function (match) {
73
+ if (match === '%%') {
74
+ return;
75
+ }
76
+
100
77
  index++;
101
- if ('%c' === match) {
102
- // we only are interested in the *last* %c
78
+
79
+ if (match === '%c') {
80
+ // We only are interested in the *last* %c
103
81
  // (the user may have provided their own)
104
82
  lastC = index;
105
83
  }
106
84
  });
107
-
108
85
  args.splice(lastC, 0, c);
109
86
  }
110
-
111
87
  /**
112
88
  * Invokes `console.log()` when available.
113
89
  * No-op when `console.log` is not a "function".
@@ -115,14 +91,14 @@ function formatArgs(args) {
115
91
  * @api public
116
92
  */
117
93
 
94
+
118
95
  function log() {
119
- // this hackery is required for IE8/9, where
96
+ var _console;
97
+
98
+ // This hackery is required for IE8/9, where
120
99
  // the `console.log` function doesn't have 'apply'
121
- return 'object' === typeof console
122
- && console.log
123
- && Function.prototype.apply.call(console.log, console, arguments);
100
+ return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
124
101
  }
125
-
126
102
  /**
127
103
  * Save `namespaces`.
128
104
  *
@@ -130,16 +106,18 @@ function log() {
130
106
  * @api private
131
107
  */
132
108
 
109
+
133
110
  function save(namespaces) {
134
111
  try {
135
- if (null == namespaces) {
136
- exports.storage.removeItem('debug');
112
+ if (namespaces) {
113
+ exports.storage.setItem('debug', namespaces);
137
114
  } else {
138
- exports.storage.debug = namespaces;
115
+ exports.storage.removeItem('debug');
139
116
  }
140
- } catch(e) {}
117
+ } catch (error) {// Swallow
118
+ // XXX (@Qix-) should we be logging these?
119
+ }
141
120
  }
142
-
143
121
  /**
144
122
  * Load `namespaces`.
145
123
  *
@@ -147,26 +125,23 @@ function save(namespaces) {
147
125
  * @api private
148
126
  */
149
127
 
128
+
150
129
  function load() {
151
130
  var r;
152
- try {
153
- r = exports.storage.debug;
154
- } catch(e) {}
155
131
 
132
+ try {
133
+ r = exports.storage.getItem('debug');
134
+ } catch (error) {} // Swallow
135
+ // XXX (@Qix-) should we be logging these?
156
136
  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
137
+
138
+
157
139
  if (!r && typeof process !== 'undefined' && 'env' in process) {
158
140
  r = process.env.DEBUG;
159
141
  }
160
142
 
161
143
  return r;
162
144
  }
163
-
164
- /**
165
- * Enable namespaces listed in `localStorage.debug` initially.
166
- */
167
-
168
- exports.enable(load());
169
-
170
145
  /**
171
146
  * Localstorage attempts to return the localstorage.
172
147
  *
@@ -178,8 +153,28 @@ exports.enable(load());
178
153
  * @api private
179
154
  */
180
155
 
156
+
181
157
  function localstorage() {
182
158
  try {
183
- return window.localStorage;
184
- } catch (e) {}
159
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
160
+ // The Browser also has localStorage in the global context.
161
+ return localStorage;
162
+ } catch (error) {// Swallow
163
+ // XXX (@Qix-) should we be logging these?
164
+ }
185
165
  }
166
+
167
+ module.exports = require('./common')(exports);
168
+ var formatters = module.exports.formatters;
169
+ /**
170
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
171
+ */
172
+
173
+ formatters.j = function (v) {
174
+ try {
175
+ return JSON.stringify(v);
176
+ } catch (error) {
177
+ return '[UnexpectedJSONParseError]: ' + error.message;
178
+ }
179
+ };
180
+
@@ -0,0 +1,249 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * This is the common logic for both the Node.js and web browser
5
+ * implementations of `debug()`.
6
+ */
7
+ function setup(env) {
8
+ createDebug.debug = createDebug;
9
+ createDebug.default = createDebug;
10
+ createDebug.coerce = coerce;
11
+ createDebug.disable = disable;
12
+ createDebug.enable = enable;
13
+ createDebug.enabled = enabled;
14
+ createDebug.humanize = require('ms');
15
+ Object.keys(env).forEach(function (key) {
16
+ createDebug[key] = env[key];
17
+ });
18
+ /**
19
+ * Active `debug` instances.
20
+ */
21
+
22
+ createDebug.instances = [];
23
+ /**
24
+ * The currently active debug mode names, and names to skip.
25
+ */
26
+
27
+ createDebug.names = [];
28
+ createDebug.skips = [];
29
+ /**
30
+ * Map of special "%n" handling functions, for the debug "format" argument.
31
+ *
32
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
33
+ */
34
+
35
+ createDebug.formatters = {};
36
+ /**
37
+ * Selects a color for a debug namespace
38
+ * @param {String} namespace The namespace string for the for the debug instance to be colored
39
+ * @return {Number|String} An ANSI color code for the given namespace
40
+ * @api private
41
+ */
42
+
43
+ function selectColor(namespace) {
44
+ var hash = 0;
45
+
46
+ for (var i = 0; i < namespace.length; i++) {
47
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
48
+ hash |= 0; // Convert to 32bit integer
49
+ }
50
+
51
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
52
+ }
53
+
54
+ createDebug.selectColor = selectColor;
55
+ /**
56
+ * Create a debugger with the given `namespace`.
57
+ *
58
+ * @param {String} namespace
59
+ * @return {Function}
60
+ * @api public
61
+ */
62
+
63
+ function createDebug(namespace) {
64
+ var prevTime;
65
+
66
+ function debug() {
67
+ // Disabled?
68
+ if (!debug.enabled) {
69
+ return;
70
+ }
71
+
72
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
73
+ args[_key] = arguments[_key];
74
+ }
75
+
76
+ var self = debug; // Set `diff` timestamp
77
+
78
+ var curr = Number(new Date());
79
+ var ms = curr - (prevTime || curr);
80
+ self.diff = ms;
81
+ self.prev = prevTime;
82
+ self.curr = curr;
83
+ prevTime = curr;
84
+ args[0] = createDebug.coerce(args[0]);
85
+
86
+ if (typeof args[0] !== 'string') {
87
+ // Anything else let's inspect with %O
88
+ args.unshift('%O');
89
+ } // Apply any `formatters` transformations
90
+
91
+
92
+ var index = 0;
93
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
94
+ // If we encounter an escaped % then don't increase the array index
95
+ if (match === '%%') {
96
+ return match;
97
+ }
98
+
99
+ index++;
100
+ var formatter = createDebug.formatters[format];
101
+
102
+ if (typeof formatter === 'function') {
103
+ var val = args[index];
104
+ match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
105
+
106
+ args.splice(index, 1);
107
+ index--;
108
+ }
109
+
110
+ return match;
111
+ }); // Apply env-specific formatting (colors, etc.)
112
+
113
+ createDebug.formatArgs.call(self, args);
114
+ var logFn = self.log || createDebug.log;
115
+ logFn.apply(self, args);
116
+ }
117
+
118
+ debug.namespace = namespace;
119
+ debug.enabled = createDebug.enabled(namespace);
120
+ debug.useColors = createDebug.useColors();
121
+ debug.color = selectColor(namespace);
122
+ debug.destroy = destroy;
123
+ debug.extend = extend; // Debug.formatArgs = formatArgs;
124
+ // debug.rawLog = rawLog;
125
+ // env-specific initialization logic for debug instances
126
+
127
+ if (typeof createDebug.init === 'function') {
128
+ createDebug.init(debug);
129
+ }
130
+
131
+ createDebug.instances.push(debug);
132
+ return debug;
133
+ }
134
+
135
+ function destroy() {
136
+ var index = createDebug.instances.indexOf(this);
137
+
138
+ if (index !== -1) {
139
+ createDebug.instances.splice(index, 1);
140
+ return true;
141
+ }
142
+
143
+ return false;
144
+ }
145
+
146
+ function extend(namespace, delimiter) {
147
+ return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
148
+ }
149
+ /**
150
+ * Enables a debug mode by namespaces. This can include modes
151
+ * separated by a colon and wildcards.
152
+ *
153
+ * @param {String} namespaces
154
+ * @api public
155
+ */
156
+
157
+
158
+ function enable(namespaces) {
159
+ createDebug.save(namespaces);
160
+ createDebug.names = [];
161
+ createDebug.skips = [];
162
+ var i;
163
+ var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
164
+ var len = split.length;
165
+
166
+ for (i = 0; i < len; i++) {
167
+ if (!split[i]) {
168
+ // ignore empty strings
169
+ continue;
170
+ }
171
+
172
+ namespaces = split[i].replace(/\*/g, '.*?');
173
+
174
+ if (namespaces[0] === '-') {
175
+ createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
176
+ } else {
177
+ createDebug.names.push(new RegExp('^' + namespaces + '$'));
178
+ }
179
+ }
180
+
181
+ for (i = 0; i < createDebug.instances.length; i++) {
182
+ var instance = createDebug.instances[i];
183
+ instance.enabled = createDebug.enabled(instance.namespace);
184
+ }
185
+ }
186
+ /**
187
+ * Disable debug output.
188
+ *
189
+ * @api public
190
+ */
191
+
192
+
193
+ function disable() {
194
+ createDebug.enable('');
195
+ }
196
+ /**
197
+ * Returns true if the given mode name is enabled, false otherwise.
198
+ *
199
+ * @param {String} name
200
+ * @return {Boolean}
201
+ * @api public
202
+ */
203
+
204
+
205
+ function enabled(name) {
206
+ if (name[name.length - 1] === '*') {
207
+ return true;
208
+ }
209
+
210
+ var i;
211
+ var len;
212
+
213
+ for (i = 0, len = createDebug.skips.length; i < len; i++) {
214
+ if (createDebug.skips[i].test(name)) {
215
+ return false;
216
+ }
217
+ }
218
+
219
+ for (i = 0, len = createDebug.names.length; i < len; i++) {
220
+ if (createDebug.names[i].test(name)) {
221
+ return true;
222
+ }
223
+ }
224
+
225
+ return false;
226
+ }
227
+ /**
228
+ * Coerce `val`.
229
+ *
230
+ * @param {Mixed} val
231
+ * @return {Mixed}
232
+ * @api private
233
+ */
234
+
235
+
236
+ function coerce(val) {
237
+ if (val instanceof Error) {
238
+ return val.stack || val.message;
239
+ }
240
+
241
+ return val;
242
+ }
243
+
244
+ createDebug.enable(createDebug.load());
245
+ return createDebug;
246
+ }
247
+
248
+ module.exports = setup;
249
+
@@ -1,10 +1,12 @@
1
+ "use strict";
2
+
1
3
  /**
2
- * Detect Electron renderer process, which is node, but we should
4
+ * Detect Electron renderer / nwjs process, which is node, but we should
3
5
  * treat as a browser.
4
6
  */
5
-
6
- if (typeof process !== 'undefined' && process.type === 'renderer') {
7
+ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
7
8
  module.exports = require('./browser.js');
8
9
  } else {
9
10
  module.exports = require('./node.js');
10
11
  }
12
+