fsevents 1.2.3 → 1.2.8
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.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/.travis.yml +1 -3
- package/fsevents.cc +6 -15
- package/node_modules/abbrev/package.json +13 -14
- package/node_modules/ansi-regex/package.json +13 -14
- package/node_modules/aproba/package.json +13 -14
- package/node_modules/are-we-there-yet/CHANGES.md +6 -0
- package/node_modules/are-we-there-yet/package.json +19 -20
- package/node_modules/are-we-there-yet/tracker-stream.js +1 -0
- package/node_modules/balanced-match/package.json +13 -14
- package/node_modules/brace-expansion/package.json +13 -14
- package/node_modules/chownr/chownr.js +74 -38
- package/node_modules/chownr/package.json +22 -20
- package/node_modules/code-point-at/package.json +13 -14
- package/node_modules/concat-map/package.json +8 -9
- package/node_modules/console-control-strings/package.json +14 -14
- package/node_modules/core-util-is/package.json +13 -14
- package/node_modules/debug/CHANGELOG.md +34 -1
- package/node_modules/debug/README.md +206 -63
- package/node_modules/debug/dist/debug.js +912 -0
- package/node_modules/debug/package.json +46 -33
- package/node_modules/debug/src/browser.js +185 -106
- package/node_modules/debug/src/common.js +266 -0
- package/node_modules/debug/src/index.js +4 -4
- package/node_modules/debug/src/node.js +174 -165
- package/node_modules/deep-extend/CHANGELOG.md +28 -3
- package/node_modules/deep-extend/LICENSE +1 -1
- package/node_modules/deep-extend/README.md +2 -1
- package/node_modules/deep-extend/lib/deep-extend.js +11 -5
- package/node_modules/deep-extend/package.json +26 -28
- package/node_modules/delegates/package.json +13 -14
- package/node_modules/detect-libc/package.json +13 -14
- package/node_modules/fs-minipass/package.json +13 -14
- package/node_modules/fs.realpath/package.json +13 -14
- package/node_modules/gauge/package.json +13 -14
- package/node_modules/glob/package.json +18 -19
- package/node_modules/has-unicode/package.json +13 -14
- package/node_modules/iconv-lite/Changelog.md +16 -0
- package/node_modules/iconv-lite/encodings/sbcs-codec.js +2 -2
- package/node_modules/iconv-lite/encodings/sbcs-data.js +5 -0
- package/node_modules/iconv-lite/lib/extend-node.js +1 -1
- package/node_modules/iconv-lite/lib/index.d.ts +2 -2
- package/node_modules/iconv-lite/package.json +19 -20
- package/node_modules/ignore-walk/package.json +13 -14
- package/node_modules/inflight/package.json +13 -14
- package/node_modules/inherits/package.json +14 -14
- package/node_modules/ini/package.json +13 -14
- package/node_modules/is-fullwidth-code-point/package.json +13 -14
- package/node_modules/isarray/package.json +13 -14
- package/node_modules/minimatch/package.json +14 -14
- package/node_modules/minimist/package.json +8 -9
- package/node_modules/minipass/LICENSE +15 -0
- package/node_modules/minipass/README.md +81 -3
- package/node_modules/minipass/index.js +77 -6
- package/node_modules/minipass/package.json +21 -20
- package/node_modules/minizlib/index.js +66 -95
- package/node_modules/minizlib/package.json +18 -19
- package/node_modules/mkdirp/package.json +14 -14
- package/node_modules/ms/index.js +28 -18
- package/node_modules/ms/package.json +22 -23
- package/node_modules/ms/readme.md +17 -8
- package/node_modules/needle/.npmignore +6 -0
- package/node_modules/needle/README.md +3 -3
- package/node_modules/needle/examples/multipart-stream.js +1 -1
- package/node_modules/needle/lib/auth.js +1 -1
- package/node_modules/needle/lib/cookies.js +12 -10
- package/node_modules/needle/lib/multipart.js +1 -1
- package/node_modules/needle/lib/needle.js +18 -6
- package/node_modules/needle/package-lock.json +395 -0
- package/node_modules/needle/package.json +26 -27
- package/node_modules/needle/test/basic_auth_spec.js +1 -1
- package/node_modules/needle/test/cookies_spec.js +2 -2
- package/node_modules/needle/test/errors_spec.js +4 -4
- package/node_modules/needle/test/keys/ssl.cert +21 -0
- package/node_modules/needle/test/keys/ssl.key +27 -0
- package/node_modules/needle/test/long_string_spec.js +1 -1
- package/node_modules/needle/test/output_spec.js +1 -1
- package/node_modules/needle/test/post_data_spec.js +20 -20
- package/node_modules/needle/test/proxy_spec.js +1 -1
- package/node_modules/needle/test/url_spec.js +11 -3
- package/node_modules/needle/test/utils/test.js +1 -1
- package/node_modules/node-pre-gyp/CHANGELOG.md +34 -3
- package/node_modules/node-pre-gyp/README.md +53 -21
- package/node_modules/node-pre-gyp/appveyor.yml +2 -9
- package/node_modules/node-pre-gyp/contributing.md +2 -2
- package/node_modules/node-pre-gyp/lib/build.js +1 -1
- package/node_modules/node-pre-gyp/lib/install.js +46 -12
- package/node_modules/node-pre-gyp/lib/node-pre-gyp.js +1 -1
- package/node_modules/node-pre-gyp/lib/package.js +5 -2
- package/node_modules/node-pre-gyp/lib/pre-binding.js +5 -5
- package/node_modules/node-pre-gyp/lib/rebuild.js +1 -1
- package/node_modules/node-pre-gyp/lib/reinstall.js +1 -1
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +148 -0
- package/node_modules/node-pre-gyp/lib/util/handle_gyp_opts.js +5 -2
- package/node_modules/node-pre-gyp/lib/util/napi.js +70 -22
- package/node_modules/node-pre-gyp/lib/util/versioning.js +7 -6
- package/node_modules/node-pre-gyp/package.json +16 -19
- package/node_modules/nopt/package.json +13 -14
- package/node_modules/npm-bundled/LICENSE +15 -0
- package/node_modules/npm-bundled/README.md +2 -0
- package/node_modules/npm-bundled/index.js +16 -2
- package/node_modules/npm-bundled/package.json +18 -19
- package/node_modules/npm-packlist/index.js +43 -13
- package/node_modules/npm-packlist/package.json +18 -19
- package/node_modules/npmlog/package.json +13 -14
- package/node_modules/number-is-nan/package.json +13 -14
- package/node_modules/object-assign/package.json +13 -14
- package/node_modules/once/package.json +14 -14
- package/node_modules/os-homedir/package.json +13 -14
- package/node_modules/os-tmpdir/package.json +13 -14
- package/node_modules/osenv/package.json +13 -14
- package/node_modules/path-is-absolute/package.json +13 -14
- package/node_modules/process-nextick-args/package.json +13 -14
- package/node_modules/rc/node_modules/minimist/package.json +13 -14
- package/node_modules/rc/package.json +18 -19
- package/node_modules/readable-stream/package.json +13 -14
- package/node_modules/rimraf/package.json +22 -20
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/package.json +23 -21
- package/node_modules/safer-buffer/package.json +13 -14
- package/node_modules/sax/package.json +13 -14
- package/node_modules/semver/CHANGELOG.md +39 -0
- package/node_modules/semver/README.md +31 -8
- package/node_modules/semver/bin/semver +92 -75
- package/node_modules/semver/package.json +25 -20
- package/node_modules/semver/semver.js +922 -763
- package/node_modules/set-blocking/package.json +13 -14
- package/node_modules/signal-exit/package.json +13 -14
- package/node_modules/string-width/package.json +14 -14
- package/node_modules/string_decoder/package.json +13 -14
- package/node_modules/strip-ansi/package.json +14 -14
- package/node_modules/strip-json-comments/package.json +13 -14
- package/node_modules/tar/README.md +7 -2
- package/node_modules/tar/lib/header.js +20 -4
- package/node_modules/tar/lib/mode-fix.js +14 -0
- package/node_modules/tar/lib/pack.js +1 -0
- package/node_modules/tar/lib/parse.js +2 -1
- package/node_modules/tar/lib/unpack.js +67 -6
- package/node_modules/tar/lib/write-entry.js +25 -6
- package/node_modules/tar/package.json +25 -26
- package/node_modules/util-deprecate/package.json +13 -14
- package/node_modules/wide-align/package.json +19 -20
- package/node_modules/wrappy/package.json +14 -14
- package/node_modules/yallist/iterator.js +5 -5
- package/node_modules/yallist/package.json +19 -19
- package/node_modules/yallist/yallist.js +2 -2
- package/package.json +6 -9
- package/src/async.cc +2 -2
- package/src/thread.cc +5 -6
- package/.npmignore +0 -1
- package/build/.target.mk +0 -53
- package/build/Makefile +0 -352
- package/build/Release/.deps/Release/.node.d +0 -1
- package/build/Release/.deps/Release/fse.node.d +0 -1
- package/build/Release/.deps/Release/obj.target/action_after_build.stamp.d +0 -1
- package/build/Release/.deps/Release/obj.target/fse/fsevents.o.d +0 -65
- package/build/Release/.deps/Users/eshanker/Code/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node.d +0 -1
- package/build/Release/.node +0 -0
- package/build/Release/fse.node +0 -0
- package/build/Release/obj.target/action_after_build.stamp +0 -0
- package/build/Release/obj.target/fse/fsevents.o +0 -0
- package/build/action_after_build.target.mk +0 -32
- package/build/binding.Makefile +0 -6
- package/build/fse.target.mk +0 -179
- package/build/gyp-mac-tool +0 -611
- package/build/stage/v1.1.2/fse-v1.1.2-node-v48-darwin-x64.tar.gz +0 -0
- package/lib/binding/Release/node-v11-darwin-x64/fse.node +0 -0
- package/lib/binding/Release/node-v46-darwin-x64/fse.node +0 -0
- package/lib/binding/Release/node-v47-darwin-x64/fse.node +0 -0
- package/lib/binding/Release/node-v48-darwin-x64/fse.node +0 -0
- package/lib/binding/Release/node-v57-darwin-x64/fse.node +0 -0
- package/node_modules/are-we-there-yet/CHANGES.md~ +0 -27
- package/node_modules/debug/.coveralls.yml +0 -1
- package/node_modules/debug/.eslintrc +0 -11
- package/node_modules/debug/.npmignore +0 -9
- package/node_modules/debug/.travis.yml +0 -14
- package/node_modules/debug/Makefile +0 -50
- package/node_modules/debug/component.json +0 -19
- package/node_modules/debug/karma.conf.js +0 -70
- package/node_modules/debug/node.js +0 -1
- package/node_modules/debug/src/debug.js +0 -202
- package/node_modules/debug/src/inspector-log.js +0 -15
- package/node_modules/iconv-lite/.travis.yml +0 -23
- package/node_modules/rc/.npmignore +0 -3
- package/node_modules/safe-buffer/.travis.yml +0 -7
- package/node_modules/safe-buffer/test.js +0 -101
- package/src/locking.cc +0 -27
@@ -1,30 +1,27 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
|
4
|
-
"debug@2.6.9",
|
5
|
-
"/Users/eshanker/Code/fsevents"
|
6
|
-
]
|
7
|
-
],
|
8
|
-
"_from": "debug@2.6.9",
|
9
|
-
"_id": "debug@2.6.9",
|
2
|
+
"_from": "debug@^4.1.0",
|
3
|
+
"_id": "debug@4.1.1",
|
10
4
|
"_inBundle": false,
|
11
|
-
"_integrity": "sha512-
|
5
|
+
"_integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
12
6
|
"_location": "/debug",
|
13
7
|
"_phantomChildren": {},
|
14
8
|
"_requested": {
|
15
|
-
"type": "
|
9
|
+
"type": "range",
|
16
10
|
"registry": true,
|
17
|
-
"raw": "debug
|
11
|
+
"raw": "debug@^4.1.0",
|
18
12
|
"name": "debug",
|
19
13
|
"escapedName": "debug",
|
20
|
-
"rawSpec": "
|
14
|
+
"rawSpec": "^4.1.0",
|
21
15
|
"saveSpec": null,
|
22
|
-
"fetchSpec": "
|
16
|
+
"fetchSpec": "^4.1.0"
|
23
17
|
},
|
24
|
-
"_requiredBy": [
|
25
|
-
|
26
|
-
|
27
|
-
"
|
18
|
+
"_requiredBy": [
|
19
|
+
"/needle"
|
20
|
+
],
|
21
|
+
"_resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
22
|
+
"_shasum": "3b72260255109c6b589cee050f1d516139664791",
|
23
|
+
"_spec": "debug@^4.1.0",
|
24
|
+
"_where": "/Users/pipobscure/fsevents/node_modules/needle",
|
28
25
|
"author": {
|
29
26
|
"name": "TJ Holowaychuk",
|
30
27
|
"email": "tj@vision-media.ca"
|
@@ -33,12 +30,7 @@
|
|
33
30
|
"bugs": {
|
34
31
|
"url": "https://github.com/visionmedia/debug/issues"
|
35
32
|
},
|
36
|
-
"
|
37
|
-
"scripts": {
|
38
|
-
"debug/index.js": "browser.js",
|
39
|
-
"debug/debug.js": "debug.js"
|
40
|
-
}
|
41
|
-
},
|
33
|
+
"bundleDependencies": false,
|
42
34
|
"contributors": [
|
43
35
|
{
|
44
36
|
"name": "Nathan Rajlich",
|
@@ -51,27 +43,34 @@
|
|
51
43
|
}
|
52
44
|
],
|
53
45
|
"dependencies": {
|
54
|
-
"ms": "2.
|
46
|
+
"ms": "^2.1.1"
|
55
47
|
},
|
48
|
+
"deprecated": false,
|
56
49
|
"description": "small debugging utility",
|
57
50
|
"devDependencies": {
|
58
|
-
"
|
51
|
+
"@babel/cli": "^7.0.0",
|
52
|
+
"@babel/core": "^7.0.0",
|
53
|
+
"@babel/preset-env": "^7.0.0",
|
54
|
+
"browserify": "14.4.0",
|
59
55
|
"chai": "^3.5.0",
|
60
56
|
"concurrently": "^3.1.0",
|
61
|
-
"coveralls": "^
|
62
|
-
"eslint": "^3.12.1",
|
57
|
+
"coveralls": "^3.0.2",
|
63
58
|
"istanbul": "^0.4.5",
|
64
|
-
"karma": "^
|
59
|
+
"karma": "^3.0.0",
|
65
60
|
"karma-chai": "^0.1.0",
|
66
61
|
"karma-mocha": "^1.3.0",
|
67
62
|
"karma-phantomjs-launcher": "^1.0.2",
|
68
|
-
"
|
69
|
-
"mocha": "^3.2.0",
|
63
|
+
"mocha": "^5.2.0",
|
70
64
|
"mocha-lcov-reporter": "^1.2.0",
|
71
65
|
"rimraf": "^2.5.4",
|
72
|
-
"
|
73
|
-
"sinon-chai": "^2.8.0"
|
66
|
+
"xo": "^0.23.0"
|
74
67
|
},
|
68
|
+
"files": [
|
69
|
+
"src",
|
70
|
+
"dist/debug.js",
|
71
|
+
"LICENSE",
|
72
|
+
"README.md"
|
73
|
+
],
|
75
74
|
"homepage": "https://github.com/visionmedia/debug#readme",
|
76
75
|
"keywords": [
|
77
76
|
"debug",
|
@@ -85,5 +84,19 @@
|
|
85
84
|
"type": "git",
|
86
85
|
"url": "git://github.com/visionmedia/debug.git"
|
87
86
|
},
|
88
|
-
"
|
87
|
+
"scripts": {
|
88
|
+
"build": "npm run build:debug && npm run build:test",
|
89
|
+
"build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js",
|
90
|
+
"build:test": "babel -d dist test.js",
|
91
|
+
"clean": "rimraf dist coverage",
|
92
|
+
"lint": "xo",
|
93
|
+
"prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .",
|
94
|
+
"pretest:browser": "npm run build",
|
95
|
+
"test": "npm run test:node && npm run test:browser",
|
96
|
+
"test:browser": "karma start --single-run",
|
97
|
+
"test:coverage": "cat ./coverage/lcov.info | coveralls",
|
98
|
+
"test:node": "istanbul cover _mocha -- test.js"
|
99
|
+
},
|
100
|
+
"unpkg": "./dist/debug.js",
|
101
|
+
"version": "4.1.1"
|
89
102
|
}
|
@@ -1,31 +1,97 @@
|
|
1
|
+
/* eslint-env browser */
|
2
|
+
|
1
3
|
/**
|
2
4
|
* This is the web browser implementation of `debug()`.
|
3
|
-
*
|
4
|
-
* Expose `debug()` as the module.
|
5
5
|
*/
|
6
6
|
|
7
|
-
exports = module.exports = require('./debug');
|
8
7
|
exports.log = log;
|
9
8
|
exports.formatArgs = formatArgs;
|
10
9
|
exports.save = save;
|
11
10
|
exports.load = load;
|
12
11
|
exports.useColors = useColors;
|
13
|
-
exports.storage =
|
14
|
-
&& 'undefined' != typeof chrome.storage
|
15
|
-
? chrome.storage.local
|
16
|
-
: localstorage();
|
12
|
+
exports.storage = localstorage();
|
17
13
|
|
18
14
|
/**
|
19
15
|
* Colors.
|
20
16
|
*/
|
21
17
|
|
22
18
|
exports.colors = [
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
19
|
+
'#0000CC',
|
20
|
+
'#0000FF',
|
21
|
+
'#0033CC',
|
22
|
+
'#0033FF',
|
23
|
+
'#0066CC',
|
24
|
+
'#0066FF',
|
25
|
+
'#0099CC',
|
26
|
+
'#0099FF',
|
27
|
+
'#00CC00',
|
28
|
+
'#00CC33',
|
29
|
+
'#00CC66',
|
30
|
+
'#00CC99',
|
31
|
+
'#00CCCC',
|
32
|
+
'#00CCFF',
|
33
|
+
'#3300CC',
|
34
|
+
'#3300FF',
|
35
|
+
'#3333CC',
|
36
|
+
'#3333FF',
|
37
|
+
'#3366CC',
|
38
|
+
'#3366FF',
|
39
|
+
'#3399CC',
|
40
|
+
'#3399FF',
|
41
|
+
'#33CC00',
|
42
|
+
'#33CC33',
|
43
|
+
'#33CC66',
|
44
|
+
'#33CC99',
|
45
|
+
'#33CCCC',
|
46
|
+
'#33CCFF',
|
47
|
+
'#6600CC',
|
48
|
+
'#6600FF',
|
49
|
+
'#6633CC',
|
50
|
+
'#6633FF',
|
51
|
+
'#66CC00',
|
52
|
+
'#66CC33',
|
53
|
+
'#9900CC',
|
54
|
+
'#9900FF',
|
55
|
+
'#9933CC',
|
56
|
+
'#9933FF',
|
57
|
+
'#99CC00',
|
58
|
+
'#99CC33',
|
59
|
+
'#CC0000',
|
60
|
+
'#CC0033',
|
61
|
+
'#CC0066',
|
62
|
+
'#CC0099',
|
63
|
+
'#CC00CC',
|
64
|
+
'#CC00FF',
|
65
|
+
'#CC3300',
|
66
|
+
'#CC3333',
|
67
|
+
'#CC3366',
|
68
|
+
'#CC3399',
|
69
|
+
'#CC33CC',
|
70
|
+
'#CC33FF',
|
71
|
+
'#CC6600',
|
72
|
+
'#CC6633',
|
73
|
+
'#CC9900',
|
74
|
+
'#CC9933',
|
75
|
+
'#CCCC00',
|
76
|
+
'#CCCC33',
|
77
|
+
'#FF0000',
|
78
|
+
'#FF0033',
|
79
|
+
'#FF0066',
|
80
|
+
'#FF0099',
|
81
|
+
'#FF00CC',
|
82
|
+
'#FF00FF',
|
83
|
+
'#FF3300',
|
84
|
+
'#FF3333',
|
85
|
+
'#FF3366',
|
86
|
+
'#FF3399',
|
87
|
+
'#FF33CC',
|
88
|
+
'#FF33FF',
|
89
|
+
'#FF6600',
|
90
|
+
'#FF6633',
|
91
|
+
'#FF9900',
|
92
|
+
'#FF9933',
|
93
|
+
'#FFCC00',
|
94
|
+
'#FFCC33'
|
29
95
|
];
|
30
96
|
|
31
97
|
/**
|
@@ -36,38 +102,31 @@ exports.colors = [
|
|
36
102
|
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
37
103
|
*/
|
38
104
|
|
105
|
+
// eslint-disable-next-line complexity
|
39
106
|
function useColors() {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
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
|
-
|
59
|
-
/**
|
60
|
-
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
61
|
-
*/
|
107
|
+
// NB: In an Electron preload script, document will be defined but not fully
|
108
|
+
// initialized. Since we know we're in Chrome, we'll just detect this case
|
109
|
+
// explicitly
|
110
|
+
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
111
|
+
return true;
|
112
|
+
}
|
62
113
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
return '[UnexpectedJSONParseError]: ' + err.message;
|
68
|
-
}
|
69
|
-
};
|
114
|
+
// Internet Explorer and Edge do not support colors.
|
115
|
+
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
116
|
+
return false;
|
117
|
+
}
|
70
118
|
|
119
|
+
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
120
|
+
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
121
|
+
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
122
|
+
// Is firebug? http://stackoverflow.com/a/398120/376773
|
123
|
+
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
124
|
+
// Is firefox >= v31?
|
125
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
126
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
|
127
|
+
// Double check webkit in userAgent just in case we are in a worker
|
128
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
129
|
+
}
|
71
130
|
|
72
131
|
/**
|
73
132
|
* Colorize log arguments if enabled.
|
@@ -76,36 +135,38 @@ exports.formatters.j = function(v) {
|
|
76
135
|
*/
|
77
136
|
|
78
137
|
function formatArgs(args) {
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
138
|
+
args[0] = (this.useColors ? '%c' : '') +
|
139
|
+
this.namespace +
|
140
|
+
(this.useColors ? ' %c' : ' ') +
|
141
|
+
args[0] +
|
142
|
+
(this.useColors ? '%c ' : ' ') +
|
143
|
+
'+' + module.exports.humanize(this.diff);
|
144
|
+
|
145
|
+
if (!this.useColors) {
|
146
|
+
return;
|
147
|
+
}
|
148
|
+
|
149
|
+
const c = 'color: ' + this.color;
|
150
|
+
args.splice(1, 0, c, 'color: inherit');
|
151
|
+
|
152
|
+
// The final "%c" is somewhat tricky, because there could be other
|
153
|
+
// arguments passed either before or after the %c, so we need to
|
154
|
+
// figure out the correct index to insert the CSS into
|
155
|
+
let index = 0;
|
156
|
+
let lastC = 0;
|
157
|
+
args[0].replace(/%[a-zA-Z%]/g, match => {
|
158
|
+
if (match === '%%') {
|
159
|
+
return;
|
160
|
+
}
|
161
|
+
index++;
|
162
|
+
if (match === '%c') {
|
163
|
+
// We only are interested in the *last* %c
|
164
|
+
// (the user may have provided their own)
|
165
|
+
lastC = index;
|
166
|
+
}
|
167
|
+
});
|
168
|
+
|
169
|
+
args.splice(lastC, 0, c);
|
109
170
|
}
|
110
171
|
|
111
172
|
/**
|
@@ -114,13 +175,12 @@ function formatArgs(args) {
|
|
114
175
|
*
|
115
176
|
* @api public
|
116
177
|
*/
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
&& Function.prototype.apply.call(console.log, console, arguments);
|
178
|
+
function log(...args) {
|
179
|
+
// This hackery is required for IE8/9, where
|
180
|
+
// the `console.log` function doesn't have 'apply'
|
181
|
+
return typeof console === 'object' &&
|
182
|
+
console.log &&
|
183
|
+
console.log(...args);
|
124
184
|
}
|
125
185
|
|
126
186
|
/**
|
@@ -129,15 +189,17 @@ function log() {
|
|
129
189
|
* @param {String} namespaces
|
130
190
|
* @api private
|
131
191
|
*/
|
132
|
-
|
133
192
|
function save(namespaces) {
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
193
|
+
try {
|
194
|
+
if (namespaces) {
|
195
|
+
exports.storage.setItem('debug', namespaces);
|
196
|
+
} else {
|
197
|
+
exports.storage.removeItem('debug');
|
198
|
+
}
|
199
|
+
} catch (error) {
|
200
|
+
// Swallow
|
201
|
+
// XXX (@Qix-) should we be logging these?
|
202
|
+
}
|
141
203
|
}
|
142
204
|
|
143
205
|
/**
|
@@ -146,27 +208,23 @@ function save(namespaces) {
|
|
146
208
|
* @return {String} returns the previously persisted debug modes
|
147
209
|
* @api private
|
148
210
|
*/
|
149
|
-
|
150
211
|
function load() {
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
212
|
+
let r;
|
213
|
+
try {
|
214
|
+
r = exports.storage.getItem('debug');
|
215
|
+
} catch (error) {
|
216
|
+
// Swallow
|
217
|
+
// XXX (@Qix-) should we be logging these?
|
218
|
+
}
|
155
219
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
220
|
+
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
221
|
+
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
222
|
+
r = process.env.DEBUG;
|
223
|
+
}
|
160
224
|
|
161
|
-
|
225
|
+
return r;
|
162
226
|
}
|
163
227
|
|
164
|
-
/**
|
165
|
-
* Enable namespaces listed in `localStorage.debug` initially.
|
166
|
-
*/
|
167
|
-
|
168
|
-
exports.enable(load());
|
169
|
-
|
170
228
|
/**
|
171
229
|
* Localstorage attempts to return the localstorage.
|
172
230
|
*
|
@@ -179,7 +237,28 @@ exports.enable(load());
|
|
179
237
|
*/
|
180
238
|
|
181
239
|
function localstorage() {
|
182
|
-
|
183
|
-
|
184
|
-
|
240
|
+
try {
|
241
|
+
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
242
|
+
// The Browser also has localStorage in the global context.
|
243
|
+
return localStorage;
|
244
|
+
} catch (error) {
|
245
|
+
// Swallow
|
246
|
+
// XXX (@Qix-) should we be logging these?
|
247
|
+
}
|
185
248
|
}
|
249
|
+
|
250
|
+
module.exports = require('./common')(exports);
|
251
|
+
|
252
|
+
const {formatters} = module.exports;
|
253
|
+
|
254
|
+
/**
|
255
|
+
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
256
|
+
*/
|
257
|
+
|
258
|
+
formatters.j = function (v) {
|
259
|
+
try {
|
260
|
+
return JSON.stringify(v);
|
261
|
+
} catch (error) {
|
262
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
263
|
+
}
|
264
|
+
};
|