react-dom-18 99.99.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of react-dom-18 might be problematic. Click here for more details.
- package/README.md +5 -0
- package/config/dev.env.js +37 -0
- package/config/hap.amend.js +29 -0
- package/config/index.js +8 -0
- package/config/prod.env.js +28 -0
- package/index.d.ts +130 -0
- package/index.js +1 -0
- package/package.json +47 -0
- package/src/index.html +12 -0
- package/src/lib/app.js +103 -0
- package/src/lib/axios/CHANGELOG.md +245 -0
- package/src/lib/axios/LICENSE +19 -0
- package/src/lib/axios/README.md +625 -0
- package/src/lib/axios/UPGRADE_GUIDE.md +162 -0
- package/src/lib/axios/dist/axios.js +1603 -0
- package/src/lib/axios/dist/axios.map +1 -0
- package/src/lib/axios/dist/axios.min.js +9 -0
- package/src/lib/axios/dist/axios.min.map +1 -0
- package/src/lib/axios/index.d.ts +131 -0
- package/src/lib/axios/index.js +1 -0
- package/src/lib/axios/lib/adapters/README.md +37 -0
- package/src/lib/axios/lib/adapters/http.js +237 -0
- package/src/lib/axios/lib/adapters/xhr.js +180 -0
- package/src/lib/axios/lib/axios.js +52 -0
- package/src/lib/axios/lib/cancel/Cancel.js +19 -0
- package/src/lib/axios/lib/cancel/CancelToken.js +57 -0
- package/src/lib/axios/lib/cancel/isCancel.js +5 -0
- package/src/lib/axios/lib/core/Axios.js +79 -0
- package/src/lib/axios/lib/core/InterceptorManager.js +52 -0
- package/src/lib/axios/lib/core/README.md +7 -0
- package/src/lib/axios/lib/core/createError.js +18 -0
- package/src/lib/axios/lib/core/dispatchRequest.js +86 -0
- package/src/lib/axios/lib/core/enhanceError.js +21 -0
- package/src/lib/axios/lib/core/settle.js +26 -0
- package/src/lib/axios/lib/core/transformData.js +20 -0
- package/src/lib/axios/lib/defaults.js +96 -0
- package/src/lib/axios/lib/helpers/README.md +7 -0
- package/src/lib/axios/lib/helpers/bind.js +11 -0
- package/src/lib/axios/lib/helpers/btoa.js +36 -0
- package/src/lib/axios/lib/helpers/buildURL.js +66 -0
- package/src/lib/axios/lib/helpers/combineURLs.js +14 -0
- package/src/lib/axios/lib/helpers/cookies.js +53 -0
- package/src/lib/axios/lib/helpers/deprecatedMethod.js +24 -0
- package/src/lib/axios/lib/helpers/isAbsoluteURL.js +14 -0
- package/src/lib/axios/lib/helpers/isURLSameOrigin.js +68 -0
- package/src/lib/axios/lib/helpers/normalizeHeaderName.js +12 -0
- package/src/lib/axios/lib/helpers/parseHeaders.js +53 -0
- package/src/lib/axios/lib/helpers/spread.js +27 -0
- package/src/lib/axios/lib/utils.js +303 -0
- package/src/lib/axios/modules/debug/CHANGELOG.md +395 -0
- package/src/lib/axios/modules/debug/LICENSE +19 -0
- package/src/lib/axios/modules/debug/README.md +437 -0
- package/src/lib/axios/modules/debug/dist/debug.js +886 -0
- package/src/lib/axios/modules/debug/node.js +1 -0
- package/src/lib/axios/modules/debug/package.json +96 -0
- package/src/lib/axios/modules/debug/src/browser.js +180 -0
- package/src/lib/axios/modules/debug/src/common.js +249 -0
- package/src/lib/axios/modules/debug/src/index.js +12 -0
- package/src/lib/axios/modules/debug/src/node.js +174 -0
- package/src/lib/axios/modules/follow-redirects/LICENSE +18 -0
- package/src/lib/axios/modules/follow-redirects/README.md +145 -0
- package/src/lib/axios/modules/follow-redirects/http.js +1 -0
- package/src/lib/axios/modules/follow-redirects/https.js +1 -0
- package/src/lib/axios/modules/follow-redirects/index.js +452 -0
- package/src/lib/axios/modules/follow-redirects/package.json +92 -0
- package/src/lib/axios/modules/is-buffer/LICENSE +21 -0
- package/src/lib/axios/modules/is-buffer/README.md +53 -0
- package/src/lib/axios/modules/is-buffer/index.js +21 -0
- package/src/lib/axios/modules/is-buffer/package.json +90 -0
- package/src/lib/axios/modules/is-buffer/test/basic.js +24 -0
- package/src/lib/axios/modules/ms/index.js +162 -0
- package/src/lib/axios/modules/ms/license.md +21 -0
- package/src/lib/axios/modules/ms/package.json +72 -0
- package/src/lib/axios/modules/ms/readme.md +60 -0
- package/src/lib/axios/package-lock.json +10437 -0
- package/src/lib/axios/package.json +111 -0
- package/src/lib/axios.min.js +10 -0
- package/src/lib/axiosRequest.js +84 -0
- package/src/lib/bmob.js +36 -0
- package/src/lib/common.js +227 -0
- package/src/lib/config.dev.js +62 -0
- package/src/lib/config.js +69 -0
- package/src/lib/dataType.js +17 -0
- package/src/lib/error.js +32 -0
- package/src/lib/file.js +250 -0
- package/src/lib/hapRequest.js +68 -0
- package/src/lib/hapStorage.js +62 -0
- package/src/lib/init.js +0 -0
- package/src/lib/nodestorage.js +14 -0
- package/src/lib/pay.js +19 -0
- package/src/lib/pointer.js +18 -0
- package/src/lib/query.js +689 -0
- package/src/lib/relation.js +45 -0
- package/src/lib/request.js +21 -0
- package/src/lib/sms.js +40 -0
- package/src/lib/socket.js +292 -0
- package/src/lib/storage.js +21 -0
- package/src/lib/user.js +225 -0
- package/src/lib/utf8md5.js +205 -0
- package/src/lib/utils.js +61 -0
- package/src/lib/webstorage.js +32 -0
- package/src/lib/wxRequest.js +88 -0
- package/src/lib/wxstorage.js +27 -0
- package/src/main.js +27 -0
- package/test/index.html +15 -0
- package/test/index.js +12 -0
- package/tsconfig.json +100 -0
@@ -0,0 +1 @@
|
|
1
|
+
module.exports = require('./src/node');
|
@@ -0,0 +1,96 @@
|
|
1
|
+
{
|
2
|
+
"_args": [
|
3
|
+
[
|
4
|
+
"debug@3.2.6",
|
5
|
+
"F:\\项目\\hydrogen-js-sdk\\src\\lib\\axios"
|
6
|
+
]
|
7
|
+
],
|
8
|
+
"_from": "debug@3.2.6",
|
9
|
+
"_id": "debug@3.2.6",
|
10
|
+
"_inBundle": false,
|
11
|
+
"_integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
|
12
|
+
"_location": "/debug",
|
13
|
+
"_phantomChildren": {},
|
14
|
+
"_requested": {
|
15
|
+
"type": "version",
|
16
|
+
"registry": true,
|
17
|
+
"raw": "debug@3.2.6",
|
18
|
+
"name": "debug",
|
19
|
+
"escapedName": "debug",
|
20
|
+
"rawSpec": "3.2.6",
|
21
|
+
"saveSpec": null,
|
22
|
+
"fetchSpec": "3.2.6"
|
23
|
+
},
|
24
|
+
"_requiredBy": [
|
25
|
+
"/follow-redirects",
|
26
|
+
"/https-proxy-agent",
|
27
|
+
"/sockjs-client",
|
28
|
+
"/tiny-lr"
|
29
|
+
],
|
30
|
+
"_resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
|
31
|
+
"_spec": "3.2.6",
|
32
|
+
"_where": "F:\\项目\\hydrogen-js-sdk\\src\\lib\\axios",
|
33
|
+
"author": {
|
34
|
+
"name": "TJ Holowaychuk",
|
35
|
+
"email": "tj@vision-media.ca"
|
36
|
+
},
|
37
|
+
"browser": "./src/browser.js",
|
38
|
+
"bugs": {
|
39
|
+
"url": "https://github.com/visionmedia/debug/issues"
|
40
|
+
},
|
41
|
+
"contributors": [
|
42
|
+
{
|
43
|
+
"name": "Nathan Rajlich",
|
44
|
+
"email": "nathan@tootallnate.net",
|
45
|
+
"url": "http://n8.io"
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"name": "Andrew Rhyne",
|
49
|
+
"email": "rhyneandrew@gmail.com"
|
50
|
+
}
|
51
|
+
],
|
52
|
+
"dependencies": {
|
53
|
+
"ms": "^2.1.1"
|
54
|
+
},
|
55
|
+
"description": "small debugging utility",
|
56
|
+
"devDependencies": {
|
57
|
+
"@babel/cli": "^7.0.0",
|
58
|
+
"@babel/core": "^7.0.0",
|
59
|
+
"@babel/preset-env": "^7.0.0",
|
60
|
+
"browserify": "14.4.0",
|
61
|
+
"chai": "^3.5.0",
|
62
|
+
"concurrently": "^3.1.0",
|
63
|
+
"coveralls": "^3.0.2",
|
64
|
+
"istanbul": "^0.4.5",
|
65
|
+
"karma": "^3.0.0",
|
66
|
+
"karma-chai": "^0.1.0",
|
67
|
+
"karma-mocha": "^1.3.0",
|
68
|
+
"karma-phantomjs-launcher": "^1.0.2",
|
69
|
+
"mocha": "^5.2.0",
|
70
|
+
"mocha-lcov-reporter": "^1.2.0",
|
71
|
+
"rimraf": "^2.5.4",
|
72
|
+
"xo": "^0.23.0"
|
73
|
+
},
|
74
|
+
"files": [
|
75
|
+
"src",
|
76
|
+
"node.js",
|
77
|
+
"dist/debug.js",
|
78
|
+
"LICENSE",
|
79
|
+
"README.md"
|
80
|
+
],
|
81
|
+
"homepage": "https://github.com/visionmedia/debug#readme",
|
82
|
+
"keywords": [
|
83
|
+
"debug",
|
84
|
+
"log",
|
85
|
+
"debugger"
|
86
|
+
],
|
87
|
+
"license": "MIT",
|
88
|
+
"main": "./src/index.js",
|
89
|
+
"name": "debug",
|
90
|
+
"repository": {
|
91
|
+
"type": "git",
|
92
|
+
"url": "git://github.com/visionmedia/debug.git"
|
93
|
+
},
|
94
|
+
"unpkg": "./dist/debug.js",
|
95
|
+
"version": "3.2.6"
|
96
|
+
}
|
@@ -0,0 +1,180 @@
|
|
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
|
+
|
7
|
+
/**
|
8
|
+
* This is the web browser implementation of `debug()`.
|
9
|
+
*/
|
10
|
+
exports.log = log;
|
11
|
+
exports.formatArgs = formatArgs;
|
12
|
+
exports.save = save;
|
13
|
+
exports.load = load;
|
14
|
+
exports.useColors = useColors;
|
15
|
+
exports.storage = localstorage();
|
16
|
+
/**
|
17
|
+
* Colors.
|
18
|
+
*/
|
19
|
+
|
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'];
|
21
|
+
/**
|
22
|
+
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
23
|
+
* and the Firebug extension (any Firefox version) are known
|
24
|
+
* to support "%c" CSS customizations.
|
25
|
+
*
|
26
|
+
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
27
|
+
*/
|
28
|
+
// eslint-disable-next-line complexity
|
29
|
+
|
30
|
+
function useColors() {
|
31
|
+
// NB: In an Electron preload script, document will be defined but not fully
|
32
|
+
// initialized. Since we know we're in Chrome, we'll just detect this case
|
33
|
+
// explicitly
|
34
|
+
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
35
|
+
return true;
|
36
|
+
} // Internet Explorer and Edge do not support colors.
|
37
|
+
|
38
|
+
|
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
|
43
|
+
|
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
|
+
}
|
51
|
+
/**
|
52
|
+
* Colorize log arguments if enabled.
|
53
|
+
*
|
54
|
+
* @api public
|
55
|
+
*/
|
56
|
+
|
57
|
+
|
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);
|
60
|
+
|
61
|
+
if (!this.useColors) {
|
62
|
+
return;
|
63
|
+
}
|
64
|
+
|
65
|
+
var c = 'color: ' + this.color;
|
66
|
+
args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
|
67
|
+
// arguments passed either before or after the %c, so we need to
|
68
|
+
// figure out the correct index to insert the CSS into
|
69
|
+
|
70
|
+
var index = 0;
|
71
|
+
var lastC = 0;
|
72
|
+
args[0].replace(/%[a-zA-Z%]/g, function (match) {
|
73
|
+
if (match === '%%') {
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
|
77
|
+
index++;
|
78
|
+
|
79
|
+
if (match === '%c') {
|
80
|
+
// We only are interested in the *last* %c
|
81
|
+
// (the user may have provided their own)
|
82
|
+
lastC = index;
|
83
|
+
}
|
84
|
+
});
|
85
|
+
args.splice(lastC, 0, c);
|
86
|
+
}
|
87
|
+
/**
|
88
|
+
* Invokes `console.log()` when available.
|
89
|
+
* No-op when `console.log` is not a "function".
|
90
|
+
*
|
91
|
+
* @api public
|
92
|
+
*/
|
93
|
+
|
94
|
+
|
95
|
+
function log() {
|
96
|
+
var _console;
|
97
|
+
|
98
|
+
// This hackery is required for IE8/9, where
|
99
|
+
// the `console.log` function doesn't have 'apply'
|
100
|
+
return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
|
101
|
+
}
|
102
|
+
/**
|
103
|
+
* Save `namespaces`.
|
104
|
+
*
|
105
|
+
* @param {String} namespaces
|
106
|
+
* @api private
|
107
|
+
*/
|
108
|
+
|
109
|
+
|
110
|
+
function save(namespaces) {
|
111
|
+
try {
|
112
|
+
if (namespaces) {
|
113
|
+
exports.storage.setItem('debug', namespaces);
|
114
|
+
} else {
|
115
|
+
exports.storage.removeItem('debug');
|
116
|
+
}
|
117
|
+
} catch (error) {// Swallow
|
118
|
+
// XXX (@Qix-) should we be logging these?
|
119
|
+
}
|
120
|
+
}
|
121
|
+
/**
|
122
|
+
* Load `namespaces`.
|
123
|
+
*
|
124
|
+
* @return {String} returns the previously persisted debug modes
|
125
|
+
* @api private
|
126
|
+
*/
|
127
|
+
|
128
|
+
|
129
|
+
function load() {
|
130
|
+
var r;
|
131
|
+
|
132
|
+
try {
|
133
|
+
r = exports.storage.getItem('debug');
|
134
|
+
} catch (error) {} // Swallow
|
135
|
+
// XXX (@Qix-) should we be logging these?
|
136
|
+
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
137
|
+
|
138
|
+
|
139
|
+
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
140
|
+
r = process.env.DEBUG;
|
141
|
+
}
|
142
|
+
|
143
|
+
return r;
|
144
|
+
}
|
145
|
+
/**
|
146
|
+
* Localstorage attempts to return the localstorage.
|
147
|
+
*
|
148
|
+
* This is necessary because safari throws
|
149
|
+
* when a user disables cookies/localstorage
|
150
|
+
* and you attempt to access it.
|
151
|
+
*
|
152
|
+
* @return {LocalStorage}
|
153
|
+
* @api private
|
154
|
+
*/
|
155
|
+
|
156
|
+
|
157
|
+
function localstorage() {
|
158
|
+
try {
|
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
|
+
}
|
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
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Detect Electron renderer / nwjs process, which is node, but we should
|
5
|
+
* treat as a browser.
|
6
|
+
*/
|
7
|
+
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
8
|
+
module.exports = require('./browser.js');
|
9
|
+
} else {
|
10
|
+
module.exports = require('./node.js');
|
11
|
+
}
|
12
|
+
|