zmdms-utils 0.0.80 → 0.0.81
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.
- package/declarations.d.ts +6 -0
- package/dist/es/_virtual/FastBufferList.js +7 -0
- package/dist/es/_virtual/_commonjs-dynamic-modules.js +5 -0
- package/dist/es/_virtual/browser.js +7 -0
- package/dist/es/_virtual/browser2.js +7 -0
- package/dist/es/_virtual/debug.js +7 -0
- package/dist/es/_virtual/event.js +7 -0
- package/dist/es/_virtual/http-parser.js +3 -0
- package/dist/es/_virtual/iframe.js +7 -0
- package/dist/es/_virtual/index.js +7 -0
- package/dist/es/_virtual/index2.js +7 -0
- package/dist/es/_virtual/index3.js +7 -0
- package/dist/es/_virtual/index4.js +7 -0
- package/dist/es/_virtual/index5.js +7 -0
- package/dist/es/_virtual/index6.js +7 -0
- package/dist/es/_virtual/index7.js +3 -0
- package/dist/es/_virtual/index8.js +7 -0
- package/dist/es/_virtual/index9.js +7 -0
- package/dist/es/_virtual/inherits.js +7 -0
- package/dist/es/_virtual/inherits_browser.js +7 -0
- package/dist/es/_virtual/json3.js +7 -0
- package/dist/es/_virtual/node.js +7 -0
- package/dist/es/_virtual/node2.js +7 -0
- package/dist/es/_virtual/stomp-node.js +3 -0
- package/dist/es/_virtual/stomp.js +3 -0
- package/dist/es/_virtual/streams.js +3 -0
- package/dist/es/_virtual/utils.js +3 -0
- package/dist/es/constants.d.ts +5 -1
- package/dist/es/constants.js +5 -1
- package/dist/es/node_modules/bufferutil/fallback.js +43 -0
- package/dist/es/node_modules/bufferutil/index.js +21 -0
- package/dist/es/node_modules/debug/src/browser.js +192 -0
- package/dist/es/node_modules/debug/src/common.js +259 -0
- package/dist/es/node_modules/debug/src/index.js +25 -0
- package/dist/es/node_modules/debug/src/node.js +192 -0
- package/dist/es/node_modules/eventsource/lib/eventsource.js +493 -0
- package/dist/es/node_modules/faye-websocket/lib/faye/eventsource.js +150 -0
- package/dist/es/node_modules/faye-websocket/lib/faye/websocket/api/event.js +31 -0
- package/dist/es/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js +41 -0
- package/dist/es/node_modules/faye-websocket/lib/faye/websocket/api.js +205 -0
- package/dist/es/node_modules/faye-websocket/lib/faye/websocket/client.js +107 -0
- package/dist/es/node_modules/faye-websocket/lib/faye/websocket.js +47 -0
- package/dist/es/node_modules/has-flag/index.js +17 -0
- package/dist/es/node_modules/http-parser-js/http-parser.js +471 -0
- package/dist/es/node_modules/inherits/inherits.js +14 -0
- package/dist/es/node_modules/inherits/inherits_browser.js +38 -0
- package/dist/es/node_modules/is-typedarray/index.js +51 -0
- package/dist/es/node_modules/json3/lib/json3.js +937 -0
- package/dist/es/node_modules/ms/index.js +172 -0
- package/dist/es/node_modules/node-gyp-build/index.js +21 -0
- package/dist/es/node_modules/node-gyp-build/node-gyp-build.js +222 -0
- package/dist/es/node_modules/querystringify/index.js +120 -0
- package/dist/es/node_modules/requires-port/index.js +38 -0
- package/dist/es/node_modules/safe-buffer/index.js +71 -0
- package/dist/es/node_modules/supports-color/index.js +143 -0
- package/dist/es/node_modules/typedarray-to-buffer/index.js +37 -0
- package/dist/es/node_modules/url-parse/index.js +594 -0
- package/dist/es/node_modules/utf-8-validate/fallback.js +71 -0
- package/dist/es/node_modules/utf-8-validate/index.js +21 -0
- package/dist/es/node_modules/websocket/index.js +15 -0
- package/dist/es/node_modules/websocket/lib/Deprecation.js +42 -0
- package/dist/es/node_modules/websocket/lib/W3CWebSocket.js +268 -0
- package/dist/es/node_modules/websocket/lib/WebSocketClient.js +380 -0
- package/dist/es/node_modules/websocket/lib/WebSocketConnection.js +914 -0
- package/dist/es/node_modules/websocket/lib/WebSocketFrame.js +293 -0
- package/dist/es/node_modules/websocket/lib/WebSocketRequest.js +543 -0
- package/dist/es/node_modules/websocket/lib/WebSocketRouter.js +172 -0
- package/dist/es/node_modules/websocket/lib/WebSocketRouterRequest.js +67 -0
- package/dist/es/node_modules/websocket/lib/WebSocketServer.js +272 -0
- package/dist/es/node_modules/websocket/lib/utils.js +80 -0
- package/dist/es/node_modules/websocket/lib/version.js +13 -0
- package/dist/es/node_modules/websocket/lib/websocket.js +31 -0
- package/dist/es/node_modules/websocket/node_modules/debug/src/browser.js +199 -0
- package/dist/es/node_modules/websocket/node_modules/debug/src/debug.js +215 -0
- package/dist/es/node_modules/websocket/node_modules/debug/src/index.js +25 -0
- package/dist/es/node_modules/websocket/node_modules/debug/src/node.js +266 -0
- package/dist/es/node_modules/websocket/node_modules/ms/index.js +162 -0
- package/dist/es/node_modules/websocket/package.json.js +77 -0
- package/dist/es/node_modules/websocket/vendor/FastBufferList.js +205 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/base.js +202 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/client.js +152 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/draft75.js +128 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/draft76.js +124 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/headers.js +44 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/hybi/frame.js +21 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/hybi/message.js +37 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/hybi.js +492 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/proxy.js +108 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/server.js +119 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/stream_reader.js +72 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver.js +47 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/http_parser.js +140 -0
- package/dist/es/node_modules/websocket-driver/lib/websocket/streams.js +150 -0
- package/dist/es/node_modules/websocket-extensions/lib/parser.js +103 -0
- package/dist/es/node_modules/websocket-extensions/lib/pipeline/cell.js +56 -0
- package/dist/es/node_modules/websocket-extensions/lib/pipeline/functor.js +74 -0
- package/dist/es/node_modules/websocket-extensions/lib/pipeline/index.js +50 -0
- package/dist/es/node_modules/websocket-extensions/lib/pipeline/pledge.js +39 -0
- package/dist/es/node_modules/websocket-extensions/lib/pipeline/ring_buffer.js +66 -0
- package/dist/es/node_modules/websocket-extensions/lib/websocket_extensions.js +165 -0
- package/dist/es/node_modules/yaeti/index.js +17 -0
- package/dist/es/node_modules/yaeti/lib/Event.js +24 -0
- package/dist/es/node_modules/yaeti/lib/EventTarget.js +130 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/entry.js +14 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/event/close.js +21 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/event/event.js +22 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/event/eventtarget.js +62 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/event/trans-message.js +19 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/facade.js +40 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/iframe-bootstrap.js +122 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/info-ajax.js +57 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/info-iframe-receiver.js +50 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/info-iframe.js +81 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/info-receiver.js +101 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/location.js +12 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/main.js +413 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/shims.js +449 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/driver/websocket.js +5 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/driver/xhr.js +80 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/eventsource.js +34 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/htmlfile.js +31 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/iframe.js +154 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/jsonp-polling.js +41 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/ajax-based.js +55 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/buffered-sender.js +92 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/iframe-wrap.js +39 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/polling.js +65 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/sender-receiver.js +52 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/eventsource.js +69 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/htmlfile.js +96 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/jsonp.js +193 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/xhr.js +75 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/jsonp.js +104 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xdr.js +113 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xhr-cors.js +19 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xhr-fake.js +28 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xhr-local.js +21 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/websocket.js +108 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/xdr-polling.js +30 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/xdr-streaming.js +38 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/xhr-polling.js +40 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/xhr-streaming.js +50 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/transport-list.js +28 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/browser.js +29 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/escape.js +53 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/event.js +78 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/iframe.js +205 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/log.js +20 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/object.js +24 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/random.js +30 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/transport.js +52 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/url.js +54 -0
- package/dist/es/node_modules/zt-sockjs-client/lib/version.js +11 -0
- package/dist/es/node_modules/zt-stompjs/index.js +23 -0
- package/dist/es/node_modules/zt-stompjs/lib/stomp-node.js +117 -0
- package/dist/es/node_modules/zt-stompjs/lib/stomp.js +536 -0
- package/dist/es/stompClient.d.ts +55 -0
- package/dist/es/stompClient.js +379 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/package.json +6 -2
- package/src/constants.ts +5 -0
- package/src/index.ts +4 -0
- package/src/stompClient.ts +449 -0
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
function commonjsRequire(path) {
|
|
2
|
+
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export { commonjsRequire };
|
package/dist/es/constants.d.ts
CHANGED
|
@@ -14,7 +14,11 @@ declare const EMITTER_TYPE: {
|
|
|
14
14
|
treeSearchWhitePath: string;
|
|
15
15
|
treeSearchSet: string;
|
|
16
16
|
};
|
|
17
|
+
declare const CLIENT_TYPE: {
|
|
18
|
+
web: number;
|
|
19
|
+
mobile: number;
|
|
20
|
+
};
|
|
17
21
|
declare const TOKEN_KEY: any;
|
|
18
22
|
declare const BASIC_KEY: any;
|
|
19
23
|
|
|
20
|
-
export { BASIC_KEY, EMITTER_CCP_KEY, EMITTER_PCC_KEY, EMITTER_TYPE, TOKEN_KEY };
|
|
24
|
+
export { BASIC_KEY, CLIENT_TYPE, EMITTER_CCP_KEY, EMITTER_PCC_KEY, EMITTER_TYPE, TOKEN_KEY };
|
package/dist/es/constants.js
CHANGED
|
@@ -19,6 +19,10 @@ var EMITTER_TYPE = {
|
|
|
19
19
|
treeSearchWhitePath: "treeSearchWhitePath",
|
|
20
20
|
treeSearchSet: "treeSearchSet", // 父应用传递搜索树的值
|
|
21
21
|
};
|
|
22
|
+
var CLIENT_TYPE = {
|
|
23
|
+
web: 1,
|
|
24
|
+
mobile: 2,
|
|
25
|
+
};
|
|
22
26
|
// token key 值
|
|
23
27
|
// export const TOKEN_KEY = "Zmdms-Auth";
|
|
24
28
|
var TOKEN_KEY = window.__TOKEN_KEY__ || "Cicoms-Auth";
|
|
@@ -30,4 +34,4 @@ var FILE_SERVICE = window.__FILE_SERVICE__ || "cicoms";
|
|
|
30
34
|
// 默认的附件预览服务地址
|
|
31
35
|
var FILE_PRVIEW_SERVICE_URL = window.__FILE_PRVIEW_SERVICE_URL__ || "";
|
|
32
36
|
|
|
33
|
-
export { BASIC_KEY, EMITTER_CCP_KEY, EMITTER_PCC_KEY, EMITTER_TYPE, FILE_PRVIEW_SERVICE_URL, FILE_SERVICE, PERSONNEL_CENTER_APPNAME, SALARY_CENTER_APPNAME, TOKEN_KEY };
|
|
37
|
+
export { BASIC_KEY, CLIENT_TYPE, EMITTER_CCP_KEY, EMITTER_PCC_KEY, EMITTER_TYPE, FILE_PRVIEW_SERVICE_URL, FILE_SERVICE, PERSONNEL_CENTER_APPNAME, SALARY_CENTER_APPNAME, TOKEN_KEY };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var fallback;
|
|
2
|
+
var hasRequiredFallback;
|
|
3
|
+
|
|
4
|
+
function requireFallback () {
|
|
5
|
+
if (hasRequiredFallback) return fallback;
|
|
6
|
+
hasRequiredFallback = 1;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Masks a buffer using the given mask.
|
|
10
|
+
*
|
|
11
|
+
* @param {Buffer} source The buffer to mask
|
|
12
|
+
* @param {Buffer} mask The mask to use
|
|
13
|
+
* @param {Buffer} output The buffer where to store the result
|
|
14
|
+
* @param {Number} offset The offset at which to start writing
|
|
15
|
+
* @param {Number} length The number of bytes to mask.
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
const mask = (source, mask, output, offset, length) => {
|
|
19
|
+
for (var i = 0; i < length; i++) {
|
|
20
|
+
output[offset + i] = source[i] ^ mask[i & 3];
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Unmasks a buffer using the given mask.
|
|
26
|
+
*
|
|
27
|
+
* @param {Buffer} buffer The buffer to unmask
|
|
28
|
+
* @param {Buffer} mask The mask to use
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
const unmask = (buffer, mask) => {
|
|
32
|
+
// Required until https://github.com/nodejs/node/issues/9006 is resolved.
|
|
33
|
+
const length = buffer.length;
|
|
34
|
+
for (var i = 0; i < length; i++) {
|
|
35
|
+
buffer[i] ^= mask[i & 3];
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
fallback = { mask, unmask };
|
|
40
|
+
return fallback;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { requireFallback as __require };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { exports as bufferutilExports, __module as bufferutil } from '../../_virtual/index4.js';
|
|
2
|
+
import { __require as requireNodeGypBuild } from '../node-gyp-build/index.js';
|
|
3
|
+
import { __require as requireFallback } from './fallback.js';
|
|
4
|
+
|
|
5
|
+
var hasRequiredBufferutil;
|
|
6
|
+
|
|
7
|
+
function requireBufferutil () {
|
|
8
|
+
if (hasRequiredBufferutil) return bufferutilExports;
|
|
9
|
+
hasRequiredBufferutil = 1;
|
|
10
|
+
(function (module) {
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
module.exports = requireNodeGypBuild()(__dirname);
|
|
14
|
+
} catch (e) {
|
|
15
|
+
module.exports = requireFallback();
|
|
16
|
+
}
|
|
17
|
+
} (bufferutil));
|
|
18
|
+
return bufferutilExports;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { requireBufferutil as __require };
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { exports as browserExports, __module as browser } from '../../../_virtual/browser2.js';
|
|
2
|
+
import { __require as requireCommon } from './common.js';
|
|
3
|
+
|
|
4
|
+
var hasRequiredBrowser;
|
|
5
|
+
|
|
6
|
+
function requireBrowser () {
|
|
7
|
+
if (hasRequiredBrowser) return browserExports;
|
|
8
|
+
hasRequiredBrowser = 1;
|
|
9
|
+
(function (module, exports) {
|
|
10
|
+
|
|
11
|
+
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); }
|
|
12
|
+
|
|
13
|
+
/* eslint-env browser */
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* This is the web browser implementation of `debug()`.
|
|
17
|
+
*/
|
|
18
|
+
exports.log = log;
|
|
19
|
+
exports.formatArgs = formatArgs;
|
|
20
|
+
exports.save = save;
|
|
21
|
+
exports.load = load;
|
|
22
|
+
exports.useColors = useColors;
|
|
23
|
+
exports.storage = localstorage();
|
|
24
|
+
/**
|
|
25
|
+
* Colors.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
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'];
|
|
29
|
+
/**
|
|
30
|
+
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
31
|
+
* and the Firebug extension (any Firefox version) are known
|
|
32
|
+
* to support "%c" CSS customizations.
|
|
33
|
+
*
|
|
34
|
+
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
35
|
+
*/
|
|
36
|
+
// eslint-disable-next-line complexity
|
|
37
|
+
|
|
38
|
+
function useColors() {
|
|
39
|
+
// NB: In an Electron preload script, document will be defined but not fully
|
|
40
|
+
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
41
|
+
// explicitly
|
|
42
|
+
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
43
|
+
return true;
|
|
44
|
+
} // Internet Explorer and Edge do not support colors.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
48
|
+
return false;
|
|
49
|
+
} // Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
50
|
+
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
54
|
+
typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
55
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
56
|
+
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
|
|
57
|
+
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Colorize log arguments if enabled.
|
|
61
|
+
*
|
|
62
|
+
* @api public
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
function formatArgs(args) {
|
|
67
|
+
args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
|
|
68
|
+
|
|
69
|
+
if (!this.useColors) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
var c = 'color: ' + this.color;
|
|
74
|
+
args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
|
|
75
|
+
// arguments passed either before or after the %c, so we need to
|
|
76
|
+
// figure out the correct index to insert the CSS into
|
|
77
|
+
|
|
78
|
+
var index = 0;
|
|
79
|
+
var lastC = 0;
|
|
80
|
+
args[0].replace(/%[a-zA-Z%]/g, function (match) {
|
|
81
|
+
if (match === '%%') {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
index++;
|
|
86
|
+
|
|
87
|
+
if (match === '%c') {
|
|
88
|
+
// We only are interested in the *last* %c
|
|
89
|
+
// (the user may have provided their own)
|
|
90
|
+
lastC = index;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
args.splice(lastC, 0, c);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Invokes `console.log()` when available.
|
|
97
|
+
* No-op when `console.log` is not a "function".
|
|
98
|
+
*
|
|
99
|
+
* @api public
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
function log() {
|
|
104
|
+
var _console;
|
|
105
|
+
|
|
106
|
+
// This hackery is required for IE8/9, where
|
|
107
|
+
// the `console.log` function doesn't have 'apply'
|
|
108
|
+
return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Save `namespaces`.
|
|
112
|
+
*
|
|
113
|
+
* @param {String} namespaces
|
|
114
|
+
* @api private
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
function save(namespaces) {
|
|
119
|
+
try {
|
|
120
|
+
if (namespaces) {
|
|
121
|
+
exports.storage.setItem('debug', namespaces);
|
|
122
|
+
} else {
|
|
123
|
+
exports.storage.removeItem('debug');
|
|
124
|
+
}
|
|
125
|
+
} catch (error) {// Swallow
|
|
126
|
+
// XXX (@Qix-) should we be logging these?
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Load `namespaces`.
|
|
131
|
+
*
|
|
132
|
+
* @return {String} returns the previously persisted debug modes
|
|
133
|
+
* @api private
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
function load() {
|
|
138
|
+
var r;
|
|
139
|
+
|
|
140
|
+
try {
|
|
141
|
+
r = exports.storage.getItem('debug');
|
|
142
|
+
} catch (error) {} // Swallow
|
|
143
|
+
// XXX (@Qix-) should we be logging these?
|
|
144
|
+
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|
148
|
+
r = process.env.DEBUG;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return r;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Localstorage attempts to return the localstorage.
|
|
155
|
+
*
|
|
156
|
+
* This is necessary because safari throws
|
|
157
|
+
* when a user disables cookies/localstorage
|
|
158
|
+
* and you attempt to access it.
|
|
159
|
+
*
|
|
160
|
+
* @return {LocalStorage}
|
|
161
|
+
* @api private
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
function localstorage() {
|
|
166
|
+
try {
|
|
167
|
+
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|
168
|
+
// The Browser also has localStorage in the global context.
|
|
169
|
+
return localStorage;
|
|
170
|
+
} catch (error) {// Swallow
|
|
171
|
+
// XXX (@Qix-) should we be logging these?
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
module.exports = requireCommon()(exports);
|
|
176
|
+
var formatters = module.exports.formatters;
|
|
177
|
+
/**
|
|
178
|
+
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
179
|
+
*/
|
|
180
|
+
|
|
181
|
+
formatters.j = function (v) {
|
|
182
|
+
try {
|
|
183
|
+
return JSON.stringify(v);
|
|
184
|
+
} catch (error) {
|
|
185
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
} (browser, browserExports));
|
|
189
|
+
return browserExports;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export { requireBrowser as __require };
|