typespeed 2.0.13 → 2.0.16
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/dist/core.decorator.js +0 -1
- package/dist/database.decorator.js +0 -1
- package/dist/default/express-server.class.js +0 -1
- package/dist/default/log-default.class.js +0 -1
- package/dist/default/node-cache.class.js +0 -1
- package/dist/default/rabbitmq.class.js +0 -1
- package/dist/default/read-write-db.class.js +0 -1
- package/dist/default/redis.class.js +0 -1
- package/dist/factory/cache-factory.class.js +0 -1
- package/dist/factory/data-source-factory.class.js +0 -1
- package/dist/factory/log-factory.class.js +0 -1
- package/dist/factory/server-factory.class.js +0 -1
- package/dist/route.decorator.js +0 -1
- package/dist/scaffold/command.js +0 -1
- package/dist/typespeed.d.ts +133 -12
- package/dist/typespeed.js +1 -1
- package/package.json +2 -2
- package/src/typespeed.d.ts +133 -0
- package/src/typespeed.ts +2 -1
- package/test/node_modules/.package-lock.json +112 -4
- package/test/node_modules/@acuminous/bitsyntax/.github/workflows/node-js-ci.yml +17 -0
- package/test/node_modules/@acuminous/bitsyntax/.github/workflows/node-js-publish.yml +30 -0
- package/test/node_modules/@acuminous/bitsyntax/LICENSE +6 -0
- package/test/node_modules/@acuminous/bitsyntax/LICENSE-MIT +21 -0
- package/test/node_modules/@acuminous/bitsyntax/Makefile +15 -0
- package/test/node_modules/@acuminous/bitsyntax/README.md +308 -0
- package/test/node_modules/@acuminous/bitsyntax/index.js +10 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/compile.js +303 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/constructor.js +142 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/grammar.pegjs +67 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/interp.js +232 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/parse.js +32 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/parser.js +1173 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/pattern.js +119 -0
- package/test/node_modules/@acuminous/bitsyntax/package.json +36 -0
- package/test/node_modules/@acuminous/bitsyntax/test/consing.test.js +50 -0
- package/test/node_modules/@acuminous/bitsyntax/test/matching.test.js +193 -0
- package/test/node_modules/@types/node/README.md +1 -1
- package/test/node_modules/@types/node/buffer.d.ts +5 -2
- package/test/node_modules/@types/node/child_process.d.ts +27 -0
- package/test/node_modules/@types/node/globals.d.ts +1 -0
- package/test/node_modules/@types/node/package.json +2 -2
- package/test/node_modules/@types/node/test.d.ts +43 -20
- package/test/node_modules/@types/node/ts4.8/buffer.d.ts +5 -2
- package/test/node_modules/@types/node/ts4.8/child_process.d.ts +27 -0
- package/test/node_modules/@types/node/ts4.8/globals.d.ts +1 -0
- package/test/node_modules/@types/node/ts4.8/test.d.ts +43 -19
- package/test/node_modules/@types/node/ts4.8/url.d.ts +3 -3
- package/test/node_modules/@types/node/ts4.8/util.d.ts +1 -1
- package/test/node_modules/@types/node/url.d.ts +3 -3
- package/test/node_modules/@types/node/util.d.ts +1 -1
- package/test/node_modules/amqplib/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/test/node_modules/amqplib/.github/workflows/test.yml +38 -0
- package/test/node_modules/amqplib/CHANGELOG.md +430 -0
- package/test/node_modules/amqplib/LICENSE +6 -0
- package/test/node_modules/amqplib/LICENSE-MIT +21 -0
- package/test/node_modules/amqplib/Makefile +47 -0
- package/test/node_modules/amqplib/README.md +157 -0
- package/test/node_modules/amqplib/bin/generate-defs.js +722 -0
- package/test/node_modules/amqplib/callback_api.js +22 -0
- package/test/node_modules/amqplib/channel_api.js +16 -0
- package/test/node_modules/amqplib/examples/headers.js +42 -0
- package/test/node_modules/amqplib/examples/receive_generator.js +39 -0
- package/test/node_modules/amqplib/examples/send_generators.js +42 -0
- package/test/node_modules/amqplib/examples/ssl.js +64 -0
- package/test/node_modules/amqplib/examples/tutorials/README.md +93 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log.js +28 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log_direct.js +30 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log_topic.js +27 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/new_task.js +27 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/receive.js +30 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs.js +36 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs_direct.js +56 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs_topic.js +55 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/rpc_client.js +49 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/rpc_server.js +45 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/send.js +29 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/worker.js +35 -0
- package/test/node_modules/amqplib/examples/tutorials/emit_log.js +19 -0
- package/test/node_modules/amqplib/examples/tutorials/emit_log_direct.js +20 -0
- package/test/node_modules/amqplib/examples/tutorials/emit_log_topic.js +19 -0
- package/test/node_modules/amqplib/examples/tutorials/new_task.js +18 -0
- package/test/node_modules/amqplib/examples/tutorials/package.json +16 -0
- package/test/node_modules/amqplib/examples/tutorials/receive.js +21 -0
- package/test/node_modules/amqplib/examples/tutorials/receive_logs.js +28 -0
- package/test/node_modules/amqplib/examples/tutorials/receive_logs_direct.js +44 -0
- package/test/node_modules/amqplib/examples/tutorials/receive_logs_topic.js +43 -0
- package/test/node_modules/amqplib/examples/tutorials/rpc_client.js +52 -0
- package/test/node_modules/amqplib/examples/tutorials/rpc_server.js +39 -0
- package/test/node_modules/amqplib/examples/tutorials/send.js +23 -0
- package/test/node_modules/amqplib/examples/tutorials/worker.js +28 -0
- package/test/node_modules/amqplib/examples/waitForConfirms.js +22 -0
- package/test/node_modules/amqplib/lib/api_args.js +314 -0
- package/test/node_modules/amqplib/lib/bitset.js +130 -0
- package/test/node_modules/amqplib/lib/callback_model.js +327 -0
- package/test/node_modules/amqplib/lib/channel.js +499 -0
- package/test/node_modules/amqplib/lib/channel_model.js +302 -0
- package/test/node_modules/amqplib/lib/codec.js +321 -0
- package/test/node_modules/amqplib/lib/connect.js +189 -0
- package/test/node_modules/amqplib/lib/connection.js +663 -0
- package/test/node_modules/amqplib/lib/credentials.js +42 -0
- package/test/node_modules/amqplib/lib/defs.js +4966 -0
- package/test/node_modules/amqplib/lib/error.js +24 -0
- package/test/node_modules/amqplib/lib/format.js +40 -0
- package/test/node_modules/amqplib/lib/frame.js +113 -0
- package/test/node_modules/amqplib/lib/heartbeat.js +89 -0
- package/test/node_modules/amqplib/lib/mux.js +129 -0
- package/test/node_modules/amqplib/package.json +37 -0
- package/test/node_modules/amqplib/test/bitset.js +69 -0
- package/test/node_modules/amqplib/test/callback_api.js +312 -0
- package/test/node_modules/amqplib/test/channel.js +621 -0
- package/test/node_modules/amqplib/test/channel_api.js +596 -0
- package/test/node_modules/amqplib/test/codec.js +237 -0
- package/test/node_modules/amqplib/test/connect.js +197 -0
- package/test/node_modules/amqplib/test/connection.js +390 -0
- package/test/node_modules/amqplib/test/data.js +254 -0
- package/test/node_modules/amqplib/test/frame.js +198 -0
- package/test/node_modules/amqplib/test/mux.js +204 -0
- package/test/node_modules/amqplib/test/util.js +219 -0
- package/test/node_modules/buffer-more-ints/.travis.yml +6 -0
- package/test/node_modules/buffer-more-ints/LICENSE +19 -0
- package/test/node_modules/buffer-more-ints/README.md +69 -0
- package/test/node_modules/buffer-more-ints/buffer-more-ints-tests.js +183 -0
- package/test/node_modules/buffer-more-ints/buffer-more-ints.js +432 -0
- package/test/node_modules/buffer-more-ints/package.json +19 -0
- package/test/node_modules/buffer-more-ints/polyfill.js +71 -0
- package/test/node_modules/core-util-is/LICENSE +19 -0
- package/test/node_modules/core-util-is/README.md +3 -0
- package/test/node_modules/core-util-is/lib/util.js +107 -0
- package/test/node_modules/core-util-is/package.json +38 -0
- package/test/node_modules/debug/LICENSE +20 -0
- package/test/node_modules/debug/README.md +481 -0
- package/test/node_modules/debug/package.json +59 -0
- package/test/node_modules/debug/src/browser.js +269 -0
- package/test/node_modules/debug/src/common.js +274 -0
- package/test/node_modules/debug/src/index.js +10 -0
- package/test/node_modules/debug/src/node.js +263 -0
- package/test/node_modules/inherits/LICENSE +16 -0
- package/test/node_modules/inherits/README.md +42 -0
- package/test/node_modules/inherits/inherits.js +9 -0
- package/test/node_modules/inherits/inherits_browser.js +27 -0
- package/test/node_modules/inherits/package.json +29 -0
- package/test/node_modules/isarray/README.md +54 -0
- package/test/node_modules/isarray/build/build.js +209 -0
- package/test/node_modules/isarray/component.json +19 -0
- package/test/node_modules/isarray/index.js +3 -0
- package/test/node_modules/isarray/package.json +25 -0
- package/test/node_modules/ms/index.js +162 -0
- package/test/node_modules/ms/license.md +21 -0
- package/test/node_modules/ms/package.json +37 -0
- package/test/node_modules/ms/readme.md +60 -0
- package/test/node_modules/querystringify/LICENSE +22 -0
- package/test/node_modules/querystringify/README.md +61 -0
- package/test/node_modules/querystringify/index.js +118 -0
- package/test/node_modules/querystringify/package.json +38 -0
- package/test/node_modules/readable-stream/LICENSE +18 -0
- package/test/node_modules/readable-stream/README.md +15 -0
- package/test/node_modules/readable-stream/duplex.js +1 -0
- package/test/node_modules/readable-stream/float.patch +923 -0
- package/test/node_modules/readable-stream/lib/_stream_duplex.js +89 -0
- package/test/node_modules/readable-stream/lib/_stream_passthrough.js +46 -0
- package/test/node_modules/readable-stream/lib/_stream_readable.js +951 -0
- package/test/node_modules/readable-stream/lib/_stream_transform.js +209 -0
- package/test/node_modules/readable-stream/lib/_stream_writable.js +477 -0
- package/test/node_modules/readable-stream/package.json +32 -0
- package/test/node_modules/readable-stream/passthrough.js +1 -0
- package/test/node_modules/readable-stream/readable.js +10 -0
- package/test/node_modules/readable-stream/transform.js +1 -0
- package/test/node_modules/readable-stream/writable.js +1 -0
- package/test/node_modules/requires-port/.travis.yml +19 -0
- package/test/node_modules/requires-port/LICENSE +22 -0
- package/test/node_modules/requires-port/README.md +47 -0
- package/test/node_modules/requires-port/index.js +38 -0
- package/test/node_modules/requires-port/package.json +47 -0
- package/test/node_modules/requires-port/test.js +98 -0
- package/test/node_modules/safe-buffer/LICENSE +21 -0
- package/test/node_modules/safe-buffer/README.md +584 -0
- package/test/node_modules/safe-buffer/index.d.ts +187 -0
- package/test/node_modules/safe-buffer/index.js +62 -0
- package/test/node_modules/safe-buffer/package.json +37 -0
- package/test/node_modules/string_decoder/LICENSE +20 -0
- package/test/node_modules/string_decoder/README.md +7 -0
- package/test/node_modules/string_decoder/index.js +221 -0
- package/test/node_modules/string_decoder/package.json +25 -0
- package/test/node_modules/url-parse/LICENSE +22 -0
- package/test/node_modules/url-parse/README.md +153 -0
- package/test/node_modules/url-parse/dist/url-parse.js +755 -0
- package/test/node_modules/url-parse/dist/url-parse.min.js +1 -0
- package/test/node_modules/url-parse/dist/url-parse.min.js.map +1 -0
- package/test/node_modules/url-parse/index.js +589 -0
- package/test/node_modules/url-parse/package.json +49 -0
- package/test/src/test-mq.class.ts +1 -2
- package/tsconfig.json +4 -3
- package/dist/core.decorator.d.ts +0 -18
- package/dist/core.decorator.js.map +0 -1
- package/dist/database.decorator.d.ts +0 -24
- package/dist/database.decorator.js.map +0 -1
- package/dist/default/express-server.class.d.ts +0 -15
- package/dist/default/express-server.class.js.map +0 -1
- package/dist/default/log-default.class.d.ts +0 -6
- package/dist/default/log-default.class.js.map +0 -1
- package/dist/default/node-cache.class.d.ts +0 -13
- package/dist/default/node-cache.class.js.map +0 -1
- package/dist/default/rabbitmq.class.d.ts +0 -9
- package/dist/default/rabbitmq.class.js.map +0 -1
- package/dist/default/read-write-db.class.d.ts +0 -10
- package/dist/default/read-write-db.class.js.map +0 -1
- package/dist/default/redis.class.d.ts +0 -5
- package/dist/default/redis.class.js.map +0 -1
- package/dist/factory/cache-factory.class.d.ts +0 -7
- package/dist/factory/cache-factory.class.js.map +0 -1
- package/dist/factory/data-source-factory.class.d.ts +0 -4
- package/dist/factory/data-source-factory.class.js.map +0 -1
- package/dist/factory/log-factory.class.d.ts +0 -4
- package/dist/factory/log-factory.class.js.map +0 -1
- package/dist/factory/server-factory.class.d.ts +0 -6
- package/dist/factory/server-factory.class.js.map +0 -1
- package/dist/route.decorator.d.ts +0 -8
- package/dist/route.decorator.js.map +0 -1
- package/dist/scaffold/command.d.ts +0 -2
- package/dist/scaffold/command.js.map +0 -1
- package/dist/typespeed.js.map +0 -1
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module dependencies.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const tty = require('tty');
|
|
6
|
+
const util = require('util');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This is the Node.js implementation of `debug()`.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
exports.init = init;
|
|
13
|
+
exports.log = log;
|
|
14
|
+
exports.formatArgs = formatArgs;
|
|
15
|
+
exports.save = save;
|
|
16
|
+
exports.load = load;
|
|
17
|
+
exports.useColors = useColors;
|
|
18
|
+
exports.destroy = util.deprecate(
|
|
19
|
+
() => {},
|
|
20
|
+
'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Colors.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
31
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
32
|
+
const supportsColor = require('supports-color');
|
|
33
|
+
|
|
34
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
35
|
+
exports.colors = [
|
|
36
|
+
20,
|
|
37
|
+
21,
|
|
38
|
+
26,
|
|
39
|
+
27,
|
|
40
|
+
32,
|
|
41
|
+
33,
|
|
42
|
+
38,
|
|
43
|
+
39,
|
|
44
|
+
40,
|
|
45
|
+
41,
|
|
46
|
+
42,
|
|
47
|
+
43,
|
|
48
|
+
44,
|
|
49
|
+
45,
|
|
50
|
+
56,
|
|
51
|
+
57,
|
|
52
|
+
62,
|
|
53
|
+
63,
|
|
54
|
+
68,
|
|
55
|
+
69,
|
|
56
|
+
74,
|
|
57
|
+
75,
|
|
58
|
+
76,
|
|
59
|
+
77,
|
|
60
|
+
78,
|
|
61
|
+
79,
|
|
62
|
+
80,
|
|
63
|
+
81,
|
|
64
|
+
92,
|
|
65
|
+
93,
|
|
66
|
+
98,
|
|
67
|
+
99,
|
|
68
|
+
112,
|
|
69
|
+
113,
|
|
70
|
+
128,
|
|
71
|
+
129,
|
|
72
|
+
134,
|
|
73
|
+
135,
|
|
74
|
+
148,
|
|
75
|
+
149,
|
|
76
|
+
160,
|
|
77
|
+
161,
|
|
78
|
+
162,
|
|
79
|
+
163,
|
|
80
|
+
164,
|
|
81
|
+
165,
|
|
82
|
+
166,
|
|
83
|
+
167,
|
|
84
|
+
168,
|
|
85
|
+
169,
|
|
86
|
+
170,
|
|
87
|
+
171,
|
|
88
|
+
172,
|
|
89
|
+
173,
|
|
90
|
+
178,
|
|
91
|
+
179,
|
|
92
|
+
184,
|
|
93
|
+
185,
|
|
94
|
+
196,
|
|
95
|
+
197,
|
|
96
|
+
198,
|
|
97
|
+
199,
|
|
98
|
+
200,
|
|
99
|
+
201,
|
|
100
|
+
202,
|
|
101
|
+
203,
|
|
102
|
+
204,
|
|
103
|
+
205,
|
|
104
|
+
206,
|
|
105
|
+
207,
|
|
106
|
+
208,
|
|
107
|
+
209,
|
|
108
|
+
214,
|
|
109
|
+
215,
|
|
110
|
+
220,
|
|
111
|
+
221
|
|
112
|
+
];
|
|
113
|
+
}
|
|
114
|
+
} catch (error) {
|
|
115
|
+
// Swallow - we only care if `supports-color` is available; it doesn't have to be.
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Build up the default `inspectOpts` object from the environment variables.
|
|
120
|
+
*
|
|
121
|
+
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
exports.inspectOpts = Object.keys(process.env).filter(key => {
|
|
125
|
+
return /^debug_/i.test(key);
|
|
126
|
+
}).reduce((obj, key) => {
|
|
127
|
+
// Camel-case
|
|
128
|
+
const prop = key
|
|
129
|
+
.substring(6)
|
|
130
|
+
.toLowerCase()
|
|
131
|
+
.replace(/_([a-z])/g, (_, k) => {
|
|
132
|
+
return k.toUpperCase();
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// Coerce string value into JS value
|
|
136
|
+
let val = process.env[key];
|
|
137
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
138
|
+
val = true;
|
|
139
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
140
|
+
val = false;
|
|
141
|
+
} else if (val === 'null') {
|
|
142
|
+
val = null;
|
|
143
|
+
} else {
|
|
144
|
+
val = Number(val);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
obj[prop] = val;
|
|
148
|
+
return obj;
|
|
149
|
+
}, {});
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Is stdout a TTY? Colored output is enabled when `true`.
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
function useColors() {
|
|
156
|
+
return 'colors' in exports.inspectOpts ?
|
|
157
|
+
Boolean(exports.inspectOpts.colors) :
|
|
158
|
+
tty.isatty(process.stderr.fd);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Adds ANSI color escape codes if enabled.
|
|
163
|
+
*
|
|
164
|
+
* @api public
|
|
165
|
+
*/
|
|
166
|
+
|
|
167
|
+
function formatArgs(args) {
|
|
168
|
+
const {namespace: name, useColors} = this;
|
|
169
|
+
|
|
170
|
+
if (useColors) {
|
|
171
|
+
const c = this.color;
|
|
172
|
+
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
|
173
|
+
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
|
174
|
+
|
|
175
|
+
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
|
176
|
+
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
|
177
|
+
} else {
|
|
178
|
+
args[0] = getDate() + name + ' ' + args[0];
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function getDate() {
|
|
183
|
+
if (exports.inspectOpts.hideDate) {
|
|
184
|
+
return '';
|
|
185
|
+
}
|
|
186
|
+
return new Date().toISOString() + ' ';
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Invokes `util.format()` with the specified arguments and writes to stderr.
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
function log(...args) {
|
|
194
|
+
return process.stderr.write(util.format(...args) + '\n');
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Save `namespaces`.
|
|
199
|
+
*
|
|
200
|
+
* @param {String} namespaces
|
|
201
|
+
* @api private
|
|
202
|
+
*/
|
|
203
|
+
function save(namespaces) {
|
|
204
|
+
if (namespaces) {
|
|
205
|
+
process.env.DEBUG = namespaces;
|
|
206
|
+
} else {
|
|
207
|
+
// If you set a process.env field to null or undefined, it gets cast to the
|
|
208
|
+
// string 'null' or 'undefined'. Just delete instead.
|
|
209
|
+
delete process.env.DEBUG;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Load `namespaces`.
|
|
215
|
+
*
|
|
216
|
+
* @return {String} returns the previously persisted debug modes
|
|
217
|
+
* @api private
|
|
218
|
+
*/
|
|
219
|
+
|
|
220
|
+
function load() {
|
|
221
|
+
return process.env.DEBUG;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Init logic for `debug` instances.
|
|
226
|
+
*
|
|
227
|
+
* Create a new `inspectOpts` object in case `useColors` is set
|
|
228
|
+
* differently for a particular `debug` instance.
|
|
229
|
+
*/
|
|
230
|
+
|
|
231
|
+
function init(debug) {
|
|
232
|
+
debug.inspectOpts = {};
|
|
233
|
+
|
|
234
|
+
const keys = Object.keys(exports.inspectOpts);
|
|
235
|
+
for (let i = 0; i < keys.length; i++) {
|
|
236
|
+
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
module.exports = require('./common')(exports);
|
|
241
|
+
|
|
242
|
+
const {formatters} = module.exports;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Map %o to `util.inspect()`, all on a single line.
|
|
246
|
+
*/
|
|
247
|
+
|
|
248
|
+
formatters.o = function (v) {
|
|
249
|
+
this.inspectOpts.colors = this.useColors;
|
|
250
|
+
return util.inspect(v, this.inspectOpts)
|
|
251
|
+
.split('\n')
|
|
252
|
+
.map(str => str.trim())
|
|
253
|
+
.join(' ');
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
|
258
|
+
*/
|
|
259
|
+
|
|
260
|
+
formatters.O = function (v) {
|
|
261
|
+
this.inspectOpts.colors = this.useColors;
|
|
262
|
+
return util.inspect(v, this.inspectOpts);
|
|
263
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
The ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Isaac Z. Schlueter
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
11
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Browser-friendly inheritance fully compatible with standard node.js
|
|
2
|
+
[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
|
|
3
|
+
|
|
4
|
+
This package exports standard `inherits` from node.js `util` module in
|
|
5
|
+
node environment, but also provides alternative browser-friendly
|
|
6
|
+
implementation through [browser
|
|
7
|
+
field](https://gist.github.com/shtylman/4339901). Alternative
|
|
8
|
+
implementation is a literal copy of standard one located in standalone
|
|
9
|
+
module to avoid requiring of `util`. It also has a shim for old
|
|
10
|
+
browsers with no `Object.create` support.
|
|
11
|
+
|
|
12
|
+
While keeping you sure you are using standard `inherits`
|
|
13
|
+
implementation in node.js environment, it allows bundlers such as
|
|
14
|
+
[browserify](https://github.com/substack/node-browserify) to not
|
|
15
|
+
include full `util` package to your client code if all you need is
|
|
16
|
+
just `inherits` function. It worth, because browser shim for `util`
|
|
17
|
+
package is large and `inherits` is often the single function you need
|
|
18
|
+
from it.
|
|
19
|
+
|
|
20
|
+
It's recommended to use this package instead of
|
|
21
|
+
`require('util').inherits` for any code that has chances to be used
|
|
22
|
+
not only in node.js but in browser too.
|
|
23
|
+
|
|
24
|
+
## usage
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
var inherits = require('inherits');
|
|
28
|
+
// then use exactly as the standard one
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## note on version ~1.0
|
|
32
|
+
|
|
33
|
+
Version ~1.0 had completely different motivation and is not compatible
|
|
34
|
+
neither with 2.0 nor with standard node.js `inherits`.
|
|
35
|
+
|
|
36
|
+
If you are using version ~1.0 and planning to switch to ~2.0, be
|
|
37
|
+
careful:
|
|
38
|
+
|
|
39
|
+
* new version uses `super_` instead of `super` for referencing
|
|
40
|
+
superclass
|
|
41
|
+
* new version overwrites current prototype while old one preserves any
|
|
42
|
+
existing fields on it
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
if (typeof Object.create === 'function') {
|
|
2
|
+
// implementation from standard node.js 'util' module
|
|
3
|
+
module.exports = function inherits(ctor, superCtor) {
|
|
4
|
+
if (superCtor) {
|
|
5
|
+
ctor.super_ = superCtor
|
|
6
|
+
ctor.prototype = Object.create(superCtor.prototype, {
|
|
7
|
+
constructor: {
|
|
8
|
+
value: ctor,
|
|
9
|
+
enumerable: false,
|
|
10
|
+
writable: true,
|
|
11
|
+
configurable: true
|
|
12
|
+
}
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
} else {
|
|
17
|
+
// old school shim for old browsers
|
|
18
|
+
module.exports = function inherits(ctor, superCtor) {
|
|
19
|
+
if (superCtor) {
|
|
20
|
+
ctor.super_ = superCtor
|
|
21
|
+
var TempCtor = function () {}
|
|
22
|
+
TempCtor.prototype = superCtor.prototype
|
|
23
|
+
ctor.prototype = new TempCtor()
|
|
24
|
+
ctor.prototype.constructor = ctor
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "inherits",
|
|
3
|
+
"description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
|
|
4
|
+
"version": "2.0.4",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"inheritance",
|
|
7
|
+
"class",
|
|
8
|
+
"klass",
|
|
9
|
+
"oop",
|
|
10
|
+
"object-oriented",
|
|
11
|
+
"inherits",
|
|
12
|
+
"browser",
|
|
13
|
+
"browserify"
|
|
14
|
+
],
|
|
15
|
+
"main": "./inherits.js",
|
|
16
|
+
"browser": "./inherits_browser.js",
|
|
17
|
+
"repository": "git://github.com/isaacs/inherits",
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "tap"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"tap": "^14.2.4"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"inherits.js",
|
|
27
|
+
"inherits_browser.js"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
|
|
2
|
+
# isarray
|
|
3
|
+
|
|
4
|
+
`Array#isArray` for older browsers.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
var isArray = require('isarray');
|
|
10
|
+
|
|
11
|
+
console.log(isArray([])); // => true
|
|
12
|
+
console.log(isArray({})); // => false
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
With [npm](http://npmjs.org) do
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
$ npm install isarray
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then bundle for the browser with
|
|
24
|
+
[browserify](https://github.com/substack/browserify).
|
|
25
|
+
|
|
26
|
+
With [component](http://component.io) do
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
$ component install juliangruber/isarray
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## License
|
|
33
|
+
|
|
34
|
+
(MIT)
|
|
35
|
+
|
|
36
|
+
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
|
37
|
+
|
|
38
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
39
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
40
|
+
the Software without restriction, including without limitation the rights to
|
|
41
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
42
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
43
|
+
so, subject to the following conditions:
|
|
44
|
+
|
|
45
|
+
The above copyright notice and this permission notice shall be included in all
|
|
46
|
+
copies or substantial portions of the Software.
|
|
47
|
+
|
|
48
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
49
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
50
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
51
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
52
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
53
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
54
|
+
SOFTWARE.
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Require the given path.
|
|
4
|
+
*
|
|
5
|
+
* @param {String} path
|
|
6
|
+
* @return {Object} exports
|
|
7
|
+
* @api public
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
function require(path, parent, orig) {
|
|
11
|
+
var resolved = require.resolve(path);
|
|
12
|
+
|
|
13
|
+
// lookup failed
|
|
14
|
+
if (null == resolved) {
|
|
15
|
+
orig = orig || path;
|
|
16
|
+
parent = parent || 'root';
|
|
17
|
+
var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
|
|
18
|
+
err.path = orig;
|
|
19
|
+
err.parent = parent;
|
|
20
|
+
err.require = true;
|
|
21
|
+
throw err;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var module = require.modules[resolved];
|
|
25
|
+
|
|
26
|
+
// perform real require()
|
|
27
|
+
// by invoking the module's
|
|
28
|
+
// registered function
|
|
29
|
+
if (!module.exports) {
|
|
30
|
+
module.exports = {};
|
|
31
|
+
module.client = module.component = true;
|
|
32
|
+
module.call(this, module.exports, require.relative(resolved), module);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return module.exports;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Registered modules.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
require.modules = {};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Registered aliases.
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
require.aliases = {};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Resolve `path`.
|
|
52
|
+
*
|
|
53
|
+
* Lookup:
|
|
54
|
+
*
|
|
55
|
+
* - PATH/index.js
|
|
56
|
+
* - PATH.js
|
|
57
|
+
* - PATH
|
|
58
|
+
*
|
|
59
|
+
* @param {String} path
|
|
60
|
+
* @return {String} path or null
|
|
61
|
+
* @api private
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
require.resolve = function(path) {
|
|
65
|
+
if (path.charAt(0) === '/') path = path.slice(1);
|
|
66
|
+
var index = path + '/index.js';
|
|
67
|
+
|
|
68
|
+
var paths = [
|
|
69
|
+
path,
|
|
70
|
+
path + '.js',
|
|
71
|
+
path + '.json',
|
|
72
|
+
path + '/index.js',
|
|
73
|
+
path + '/index.json'
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
for (var i = 0; i < paths.length; i++) {
|
|
77
|
+
var path = paths[i];
|
|
78
|
+
if (require.modules.hasOwnProperty(path)) return path;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (require.aliases.hasOwnProperty(index)) {
|
|
82
|
+
return require.aliases[index];
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Normalize `path` relative to the current path.
|
|
88
|
+
*
|
|
89
|
+
* @param {String} curr
|
|
90
|
+
* @param {String} path
|
|
91
|
+
* @return {String}
|
|
92
|
+
* @api private
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
require.normalize = function(curr, path) {
|
|
96
|
+
var segs = [];
|
|
97
|
+
|
|
98
|
+
if ('.' != path.charAt(0)) return path;
|
|
99
|
+
|
|
100
|
+
curr = curr.split('/');
|
|
101
|
+
path = path.split('/');
|
|
102
|
+
|
|
103
|
+
for (var i = 0; i < path.length; ++i) {
|
|
104
|
+
if ('..' == path[i]) {
|
|
105
|
+
curr.pop();
|
|
106
|
+
} else if ('.' != path[i] && '' != path[i]) {
|
|
107
|
+
segs.push(path[i]);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return curr.concat(segs).join('/');
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Register module at `path` with callback `definition`.
|
|
116
|
+
*
|
|
117
|
+
* @param {String} path
|
|
118
|
+
* @param {Function} definition
|
|
119
|
+
* @api private
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
require.register = function(path, definition) {
|
|
123
|
+
require.modules[path] = definition;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Alias a module definition.
|
|
128
|
+
*
|
|
129
|
+
* @param {String} from
|
|
130
|
+
* @param {String} to
|
|
131
|
+
* @api private
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
require.alias = function(from, to) {
|
|
135
|
+
if (!require.modules.hasOwnProperty(from)) {
|
|
136
|
+
throw new Error('Failed to alias "' + from + '", it does not exist');
|
|
137
|
+
}
|
|
138
|
+
require.aliases[to] = from;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Return a require function relative to the `parent` path.
|
|
143
|
+
*
|
|
144
|
+
* @param {String} parent
|
|
145
|
+
* @return {Function}
|
|
146
|
+
* @api private
|
|
147
|
+
*/
|
|
148
|
+
|
|
149
|
+
require.relative = function(parent) {
|
|
150
|
+
var p = require.normalize(parent, '..');
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* lastIndexOf helper.
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
function lastIndexOf(arr, obj) {
|
|
157
|
+
var i = arr.length;
|
|
158
|
+
while (i--) {
|
|
159
|
+
if (arr[i] === obj) return i;
|
|
160
|
+
}
|
|
161
|
+
return -1;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The relative require() itself.
|
|
166
|
+
*/
|
|
167
|
+
|
|
168
|
+
function localRequire(path) {
|
|
169
|
+
var resolved = localRequire.resolve(path);
|
|
170
|
+
return require(resolved, parent, path);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Resolve relative to the parent.
|
|
175
|
+
*/
|
|
176
|
+
|
|
177
|
+
localRequire.resolve = function(path) {
|
|
178
|
+
var c = path.charAt(0);
|
|
179
|
+
if ('/' == c) return path.slice(1);
|
|
180
|
+
if ('.' == c) return require.normalize(p, path);
|
|
181
|
+
|
|
182
|
+
// resolve deps by returning
|
|
183
|
+
// the dep in the nearest "deps"
|
|
184
|
+
// directory
|
|
185
|
+
var segs = parent.split('/');
|
|
186
|
+
var i = lastIndexOf(segs, 'deps') + 1;
|
|
187
|
+
if (!i) i = 0;
|
|
188
|
+
path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
|
|
189
|
+
return path;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Check if module is defined at `path`.
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
localRequire.exists = function(path) {
|
|
197
|
+
return require.modules.hasOwnProperty(localRequire.resolve(path));
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
return localRequire;
|
|
201
|
+
};
|
|
202
|
+
require.register("isarray/index.js", function(exports, require, module){
|
|
203
|
+
module.exports = Array.isArray || function (arr) {
|
|
204
|
+
return Object.prototype.toString.call(arr) == '[object Array]';
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
});
|
|
208
|
+
require.alias("isarray/index.js", "isarray/index.js");
|
|
209
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name" : "isarray",
|
|
3
|
+
"description" : "Array#isArray for older browsers",
|
|
4
|
+
"version" : "0.0.1",
|
|
5
|
+
"repository" : "juliangruber/isarray",
|
|
6
|
+
"homepage": "https://github.com/juliangruber/isarray",
|
|
7
|
+
"main" : "index.js",
|
|
8
|
+
"scripts" : [
|
|
9
|
+
"index.js"
|
|
10
|
+
],
|
|
11
|
+
"dependencies" : {},
|
|
12
|
+
"keywords": ["browser","isarray","array"],
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "Julian Gruber",
|
|
15
|
+
"email": "mail@juliangruber.com",
|
|
16
|
+
"url": "http://juliangruber.com"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT"
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name" : "isarray",
|
|
3
|
+
"description" : "Array#isArray for older browsers",
|
|
4
|
+
"version" : "0.0.1",
|
|
5
|
+
"repository" : {
|
|
6
|
+
"type" : "git",
|
|
7
|
+
"url" : "git://github.com/juliangruber/isarray.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/juliangruber/isarray",
|
|
10
|
+
"main" : "index.js",
|
|
11
|
+
"scripts" : {
|
|
12
|
+
"test" : "tap test/*.js"
|
|
13
|
+
},
|
|
14
|
+
"dependencies" : {},
|
|
15
|
+
"devDependencies" : {
|
|
16
|
+
"tap" : "*"
|
|
17
|
+
},
|
|
18
|
+
"keywords": ["browser","isarray","array"],
|
|
19
|
+
"author": {
|
|
20
|
+
"name": "Julian Gruber",
|
|
21
|
+
"email": "mail@juliangruber.com",
|
|
22
|
+
"url": "http://juliangruber.com"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT"
|
|
25
|
+
}
|