@leftium/gg 0.0.21 → 0.0.23

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.
@@ -1,95 +0,0 @@
1
- declare const _exports: {
2
- (namespace: string): Function;
3
- debug: {
4
- (namespace: string): Function;
5
- debug: /*elided*/ any;
6
- default: /*elided*/ any;
7
- coerce: (val: Mixed) => Mixed;
8
- disable: () => string;
9
- enable: (namespaces: string) => void;
10
- enabled: (name: string) => boolean;
11
- humanize: (val: string | number, options?: Object) => string | number;
12
- destroy: () => void;
13
- names: any[];
14
- skips: any[];
15
- formatters: {};
16
- selectColor: (namespace: string) => number | string;
17
- };
18
- default: {
19
- (namespace: string): Function;
20
- debug: /*elided*/ any;
21
- default: /*elided*/ any;
22
- coerce: (val: Mixed) => Mixed;
23
- disable: () => string;
24
- enable: (namespaces: string) => void;
25
- enabled: (name: string) => boolean;
26
- humanize: (val: string | number, options?: Object) => string | number;
27
- destroy: () => void;
28
- names: any[];
29
- skips: any[];
30
- formatters: {};
31
- selectColor: (namespace: string) => number | string;
32
- };
33
- coerce: (val: Mixed) => Mixed;
34
- disable: () => string;
35
- enable: (namespaces: string) => void;
36
- enabled: (name: string) => boolean;
37
- humanize: (val: string | number, options?: Object) => string | number;
38
- destroy: (() => void) | (() => void);
39
- names: any[];
40
- skips: any[];
41
- formatters: {};
42
- selectColor: (namespace: string) => number | string;
43
- init: typeof init;
44
- log: typeof log;
45
- formatArgs: typeof formatArgs;
46
- save: typeof save;
47
- load: typeof load;
48
- useColors: typeof useColors;
49
- /**
50
- * Colors.
51
- */
52
- colors: number[];
53
- /**
54
- * Build up the default `inspectOpts` object from the environment variables.
55
- *
56
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
57
- */
58
- inspectOpts: {};
59
- };
60
- export = _exports;
61
- /**
62
- * Init logic for `debug` instances.
63
- *
64
- * Create a new `inspectOpts` object in case `useColors` is set
65
- * differently for a particular `debug` instance.
66
- */
67
- declare function init(debug: any): void;
68
- /**
69
- * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
70
- */
71
- declare function log(...args: any[]): boolean;
72
- /**
73
- * Adds ANSI color escape codes if enabled.
74
- *
75
- * @api public
76
- */
77
- declare function formatArgs(args: any): void;
78
- /**
79
- * Save `namespaces`.
80
- *
81
- * @param {String} namespaces
82
- * @api private
83
- */
84
- declare function save(namespaces: string): void;
85
- /**
86
- * Load `namespaces`.
87
- *
88
- * @return {String} returns the previously persisted debug modes
89
- * @api private
90
- */
91
- declare function load(): string;
92
- /**
93
- * Is stdout a TTY? Colored output is enabled when `true`.
94
- */
95
- declare function useColors(): boolean;
@@ -1,263 +0,0 @@
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${('+' + module.exports.humanize(this.diff)).padStart(6)} ${name} \u001B[0m`;
174
-
175
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
176
- args.push(colorCode + '' + '\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.formatWithOptions()` with the specified arguments and writes to stderr.
191
- */
192
-
193
- function log(...args) {
194
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...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
- };