@reliverse/relinka 1.1.4 → 1.1.6

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.
Files changed (118) hide show
  1. package/dist-npm/components/anykey/index.js +77 -57
  2. package/dist-npm/components/block/block.js +61 -48
  3. package/dist-npm/components/checkbox/index.js +211 -178
  4. package/dist-npm/components/confirm/confirm-main.js +122 -86
  5. package/dist-npm/components/confirm/confirm-three.js +27 -24
  6. package/dist-npm/components/confirm/index.js +45 -36
  7. package/dist-npm/components/core/Separator.js +17 -15
  8. package/dist-npm/components/core/create-prompt.js +124 -101
  9. package/dist-npm/components/core/errors.js +15 -19
  10. package/dist-npm/components/core/hook-engine.js +120 -91
  11. package/dist-npm/components/core/index.js +12 -12
  12. package/dist-npm/components/core/key.js +6 -16
  13. package/dist-npm/components/core/lines.js +54 -45
  14. package/dist-npm/components/core/make-theme.js +30 -21
  15. package/dist-npm/components/core/position.js +23 -27
  16. package/dist-npm/components/core/promise-polyfill.js +14 -11
  17. package/dist-npm/components/core/screen-manager.js +74 -59
  18. package/dist-npm/components/core/theme.js +32 -22
  19. package/dist-npm/components/core/use-effect.js +15 -9
  20. package/dist-npm/components/core/use-keypress.js +23 -19
  21. package/dist-npm/components/core/use-memo.js +16 -10
  22. package/dist-npm/components/core/use-pagination.js +32 -33
  23. package/dist-npm/components/core/use-prefix.js +38 -40
  24. package/dist-npm/components/core/use-ref.js +5 -2
  25. package/dist-npm/components/core/use-state.js +23 -15
  26. package/dist-npm/components/core/useKeyPress.js +17 -14
  27. package/dist-npm/components/core/usePromptState.js +14 -8
  28. package/dist-npm/components/core/utils.js +16 -7
  29. package/dist-npm/components/date/date.js +204 -168
  30. package/dist-npm/components/editor/index.js +92 -71
  31. package/dist-npm/components/expand/index.js +124 -96
  32. package/dist-npm/components/figures/index.js +294 -283
  33. package/dist-npm/components/input/index.js +87 -61
  34. package/dist-npm/components/input/text-main.js +124 -86
  35. package/dist-npm/components/input/text.js +28 -24
  36. package/dist-npm/components/instance/basic.js +25 -17
  37. package/dist-npm/components/instance/browser.js +18 -14
  38. package/dist-npm/components/instance/reporter/basic.js +65 -46
  39. package/dist-npm/components/instance/reporter/browser.js +47 -44
  40. package/dist-npm/components/instance/reporter/fancy.js +96 -83
  41. package/dist-npm/components/instance/shared.js +2 -2
  42. package/dist-npm/components/mono/mono.js +62 -52
  43. package/dist-npm/components/mono/monoTwo.js +49 -35
  44. package/dist-npm/components/multiselect/group-multiselect.js +71 -55
  45. package/dist-npm/components/multiselect/multi-select-two.js +130 -98
  46. package/dist-npm/components/multiselect/multi-select.js +49 -43
  47. package/dist-npm/components/multiselect/multiselect-main.js +146 -120
  48. package/dist-npm/components/multiselect/num-multi-select.js +130 -98
  49. package/dist-npm/components/multiselect/num-multiselect-main.js +35 -24
  50. package/dist-npm/components/next-steps/next-steps.js +25 -24
  51. package/dist-npm/components/number/index.js +112 -78
  52. package/dist-npm/components/number/number-main.js +2 -96
  53. package/dist-npm/components/password/index.js +73 -54
  54. package/dist-npm/components/password/password-main.js +2 -120
  55. package/dist-npm/components/password/password-three.js +30 -26
  56. package/dist-npm/components/progressbar/ProgressBar.js +64 -45
  57. package/dist-npm/components/progressbar/helper.js +40 -33
  58. package/dist-npm/components/progressbar/index.js +1 -1
  59. package/dist-npm/components/prompts/create.js +44 -29
  60. package/dist-npm/components/prompts/index.js +45 -45
  61. package/dist-npm/components/prompts/prompt.js +260 -211
  62. package/dist-npm/components/prompts/promptTwo.js +605 -561
  63. package/dist-npm/components/prompts/relinka.js +295 -237
  64. package/dist-npm/components/range/range.js +294 -247
  65. package/dist-npm/components/rawlist/index.js +107 -87
  66. package/dist-npm/components/results/results.js +37 -31
  67. package/dist-npm/components/search/index.js +193 -148
  68. package/dist-npm/components/select/index.js +186 -148
  69. package/dist-npm/components/select/num-select-main.js +27 -27
  70. package/dist-npm/components/select/num-select.js +5 -125
  71. package/dist-npm/components/select/select-key.js +25 -24
  72. package/dist-npm/components/select/select-main.js +133 -109
  73. package/dist-npm/components/select/select-three.js +36 -32
  74. package/dist-npm/components/select/select-two.js +87 -95
  75. package/dist-npm/components/spinner/index.js +136 -107
  76. package/dist-npm/components/st-end/end.d.ts +1 -1
  77. package/dist-npm/components/st-end/end.js +26 -35
  78. package/dist-npm/components/st-end/start.d.ts +1 -1
  79. package/dist-npm/components/st-end/start.js +15 -30
  80. package/dist-npm/components/toggle/index.js +137 -113
  81. package/dist-npm/components/visual/animate/animate.js +10 -53
  82. package/dist-npm/components/visual/ascii-art/ascii-art.js +1 -12
  83. package/dist-npm/mod.js +2 -1
  84. package/dist-npm/testing/index.js +83 -58
  85. package/dist-npm/types/general.d.ts +2 -1
  86. package/dist-npm/types/general.js +1 -0
  87. package/dist-npm/types/index.js +3 -2
  88. package/dist-npm/types/keypress.js +36 -35
  89. package/dist-npm/types/readline.js +1 -0
  90. package/dist-npm/types/relinka.js +1 -0
  91. package/dist-npm/types/utils.js +1 -0
  92. package/dist-npm/utils/box.js +137 -135
  93. package/dist-npm/utils/color.js +74 -65
  94. package/dist-npm/utils/colorize.js +156 -124
  95. package/dist-npm/utils/component.js +657 -532
  96. package/dist-npm/utils/constants.js +63 -64
  97. package/dist-npm/utils/core.js +3 -2
  98. package/dist-npm/utils/decoder.js +223 -244
  99. package/dist-npm/utils/error.js +9 -4
  100. package/dist-npm/utils/errors.js +4 -14
  101. package/dist-npm/utils/format.js +24 -19
  102. package/dist-npm/utils/keypress.js +414 -316
  103. package/dist-npm/utils/log.js +15 -11
  104. package/dist-npm/utils/mapping.js +52 -45
  105. package/dist-npm/utils/messages.js +183 -183
  106. package/dist-npm/utils/platforms.js +20 -16
  107. package/dist-npm/utils/prompt-tmp.js +286 -235
  108. package/dist-npm/utils/prompt-two.js +286 -235
  109. package/dist-npm/utils/readline.js +7 -5
  110. package/dist-npm/utils/skeleton.js +170 -130
  111. package/dist-npm/utils/stream.js +2 -2
  112. package/dist-npm/utils/string.js +58 -44
  113. package/dist-npm/utils/terminal.js +34 -23
  114. package/dist-npm/utils/tree.js +41 -30
  115. package/dist-npm/utils/types.js +1 -0
  116. package/dist-npm/utils/utils.js +8 -8
  117. package/dist-npm/utils/variants.js +44 -36
  118. package/package.json +20 -28
@@ -1,280 +1,338 @@
1
- import { defu } from "defu";
2
- import { LogTypes } from "../../utils/constants.js";
3
- import { isLogObj } from "../../utils/log.js";
1
+ import {defu} from 'defu';
2
+ import {LogTypes} from '../../utils/constants.js';
3
+ import {isLogObj} from '../../utils/log.js';
4
+
5
+ const {isArray} = Array;
6
+ const isNumber = (a) => typeof a === 'number';
7
+ const isString = (a) => typeof a === 'string';
8
+ const isFn = (a) => typeof a === 'function';
9
+ const maybeArray = (a) => isArray(a) ? a : [a];
4
10
  let paused = false;
5
11
  const queue = [];
12
+
6
13
  export class Relinka {
7
- options;
8
- _lastLog;
9
- _mockFn;
14
+ options;
15
+ _lastLog;
16
+ _mockFn;
10
17
  constructor(options = {}) {
11
- const types = options.types || LogTypes;
12
- this.options = defu(
13
- {
14
- ...options,
15
- defaults: { ...options.defaults },
16
- level: _normalizeLogLevel(options.level, types),
17
- reporters: [...options.reporters || []]
18
- },
19
- {
20
- types: LogTypes,
21
- throttle: 1e3,
22
- throttleMin: 5,
23
- formatOptions: {
24
- date: true,
25
- colors: false,
26
- compact: true
18
+ const types = options.types || LogTypes;
19
+
20
+ this.options = defu({
21
+ ...options,
22
+ defaults: {...options.defaults},
23
+ level: _normalizeLogLevel(options.level, types),
24
+ reporters: options.reporters || [].slice(),
25
+ }, {
26
+ types: LogTypes,
27
+ throttle: 1e3,
28
+ throttleMin: 5,
29
+ formatOptions: {
30
+ date: true,
31
+ colors: false,
32
+ compact: true,
33
+ },
34
+ });
35
+ for (const type in types) {
36
+ const defaults = {
37
+ type,
38
+ ...this.options.defaults,
39
+ ...types[type],
40
+ };
41
+
42
+ this[type] = this._wrapLogFn(defaults);
43
+ this[type].raw = this._wrapLogFn(defaults, true);
27
44
  }
28
- }
29
- );
30
- for (const type in types) {
31
- const defaults = {
32
- type,
33
- ...this.options.defaults,
34
- ...types[type]
35
- };
36
- this[type] = this._wrapLogFn(defaults);
37
- this[type].raw = this._wrapLogFn(
38
- defaults,
39
- true
40
- );
41
- }
42
- if (this.options.mockFn) {
43
- this.mockTypes();
45
+ if (this.options.mockFn) {
46
+ this.mockTypes();
47
+ }
48
+
49
+ this._lastLog = {};
44
50
  }
45
- this._lastLog = {};
46
- }
51
+
47
52
  get level() {
48
- return this.options.level;
49
- }
53
+ return this.options.level;
54
+ }
55
+
50
56
  set level(level) {
51
- this.options.level = _normalizeLogLevel(
52
- level,
53
- this.options.types,
54
- this.options.level
55
- );
56
- }
57
+ this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
58
+ }
59
+
57
60
  prompt(message, opts) {
58
- if (!this.options.prompt) {
59
- throw new Error("prompt is not supported!");
61
+ if (!this.options.prompt) {
62
+ throw Error('prompt is not supported!');
63
+ }
64
+
65
+ return this.options.prompt(message, opts);
60
66
  }
61
- return this.options.prompt(message, opts);
62
- }
67
+
63
68
  create(options) {
64
- const instance = new Relinka({
65
- ...this.options,
66
- ...options
67
- });
68
- if (this._mockFn) {
69
- instance.mockTypes(this._mockFn);
69
+ const instance = new Relinka({
70
+ ...this.options,
71
+ ...options,
72
+ });
73
+
74
+ if (this._mockFn) {
75
+ instance.mockTypes(this._mockFn);
76
+ }
77
+
78
+ return instance;
70
79
  }
71
- return instance;
72
- }
80
+
73
81
  withDefaults(defaults) {
74
- return this.create({
75
- ...this.options,
76
- defaults: {
77
- ...this.options.defaults,
78
- ...defaults
79
- }
80
- });
81
- }
82
+ return this.create({
83
+ ...this.options,
84
+ defaults: {
85
+ ...this.options.defaults,
86
+ ...defaults,
87
+ },
88
+ });
89
+ }
90
+
82
91
  withTag(tag) {
83
- return this.withDefaults({
84
- tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
85
- });
86
- }
92
+ return this.withDefaults({
93
+ tag: this.options.defaults.tag ? this.options.defaults.tag + ':' + tag : tag,
94
+ });
95
+ }
96
+
87
97
  addReporter(reporter) {
88
- this.options.reporters.push(reporter);
89
- return this;
90
- }
98
+ this.options.reporters.push(reporter);
99
+ return this;
100
+ }
101
+
91
102
  removeReporter(reporter) {
92
- if (reporter) {
93
- const i = this.options.reporters.indexOf(reporter);
94
- if (i >= 0) {
95
- return this.options.reporters.splice(i, 1);
96
- }
97
- } else {
98
- this.options.reporters.splice(0);
103
+ if (reporter) {
104
+ const i = this.options.reporters.indexOf(reporter);
105
+
106
+ if (i >= 0) {
107
+ return this.options.reporters.splice(i, 1);
108
+ }
109
+ } else {
110
+ this.options.reporters.splice(0);
111
+ }
112
+
113
+ return this;
99
114
  }
100
- return this;
101
- }
115
+
102
116
  setReporters(reporters) {
103
- this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
104
- return this;
105
- }
106
- wrapAll() {
107
- this.wrapConsole();
108
- this.wrapStd();
109
- }
110
- restoreAll() {
111
- this.restoreConsole();
112
- this.restoreStd();
113
- }
117
+ this.options.reporters = maybeArray(reporters);
118
+ return this;
119
+ }
120
+
121
+ wrapAll() {
122
+ this.wrapConsole();
123
+ this.wrapStd();
124
+ }
125
+
126
+ restoreAll() {
127
+ this.restoreConsole();
128
+ this.restoreStd();
129
+ }
130
+
114
131
  wrapConsole() {
115
- for (const type in this.options.types) {
116
- if (!console["__" + type]) {
117
- console["__" + type] = console[type];
118
- }
119
- console[type] = this[type].raw;
132
+ for (const type in this.options.types) {
133
+ if (!console[`__${type}`]) {
134
+ console[`__${type}`] = console[type];
135
+ }
136
+
137
+ console[type] = this[type].raw;
138
+ }
120
139
  }
121
- }
140
+
122
141
  restoreConsole() {
123
- for (const type in this.options.types) {
124
- if (console["__" + type]) {
125
- console[type] = console["__" + type];
126
- delete console["__" + type];
127
- }
142
+ for (const type in this.options.types) {
143
+ if (console[`__${type}`]) {
144
+ console[type] = console[`__${type}`];
145
+ delete console[`__${type}`];
146
+ }
147
+ }
128
148
  }
129
- }
149
+
130
150
  wrapStd() {
131
- this._wrapStream(this.options.stdout, "log");
132
- this._wrapStream(this.options.stderr, "log");
133
- }
134
- _wrapStream(stream, type) {
135
- if (!stream) {
136
- return;
151
+ this._wrapStream(this.options.stdout, 'log');
152
+ this._wrapStream(this.options.stderr, 'log');
137
153
  }
138
- if (!stream.__write) {
139
- stream.__write = stream.write;
154
+
155
+ _wrapStream(stream, type) {
156
+ if (!stream) {
157
+ return;
158
+ }
159
+
160
+ if (!stream.__write) {
161
+ stream.__write = stream.write;
162
+ }
163
+
164
+ stream.write = (data) => {
165
+ this[type].raw(String(data).trim());
166
+ };
140
167
  }
141
- stream.write = (data) => {
142
- this[type].raw(String(data).trim());
143
- };
144
- }
168
+
145
169
  restoreStd() {
146
- this._restoreStream(this.options.stdout);
147
- this._restoreStream(this.options.stderr);
148
- }
149
- _restoreStream(stream) {
150
- if (!stream) {
151
- return;
170
+ this._restoreStream(this.options.stdout);
171
+ this._restoreStream(this.options.stderr);
152
172
  }
153
- if (stream.__write) {
154
- stream.write = stream.__write;
155
- delete stream.__write;
173
+
174
+ _restoreStream(stream) {
175
+ if (!stream) {
176
+ return;
177
+ }
178
+
179
+ if (stream.__write) {
180
+ stream.write = stream.__write;
181
+ delete stream.__write;
182
+ }
156
183
  }
157
- }
184
+
158
185
  pauseLogs() {
159
- paused = true;
160
- }
186
+ paused = true;
187
+ }
188
+
161
189
  resumeLogs() {
162
- paused = false;
163
- const _queue = queue.splice(0);
164
- for (const item of _queue) {
165
- item[0]._logFn(item[1], item[2]);
190
+ paused = false;
191
+ const _queue = queue.splice(0);
192
+
193
+ for (const item of _queue) {
194
+ item[0]._logFn(item[1], item[2]);
195
+ }
166
196
  }
167
- }
197
+
168
198
  mockTypes(mockFn) {
169
- const _mockFn = mockFn || this.options.mockFn;
170
- this._mockFn = _mockFn;
171
- if (typeof _mockFn !== "function") {
172
- return;
173
- }
174
- for (const type in this.options.types) {
175
- this[type] = _mockFn(type, this.options.types[type]) || this[type];
176
- this[type].raw = this[type];
199
+ const _mockFn = mockFn || this.options.mockFn;
200
+
201
+ this._mockFn = _mockFn;
202
+ if (!isFn(_mockFn)) {
203
+ return;
204
+ }
205
+
206
+ for (const type in this.options.types) {
207
+ this[type] = _mockFn(type, this.options.types[type]) || this[type];
208
+ this[type].raw = this[type];
209
+ }
177
210
  }
178
- }
179
- _wrapLogFn(defaults, isRaw) {
180
- return (...args) => {
181
- if (paused) {
182
- queue.push([this, defaults, args, isRaw]);
183
- return;
184
- }
185
- return this._logFn(defaults, args, isRaw);
186
- };
187
- }
188
- _logFn(defaults, args, isRaw) {
189
- if ((defaults.level || 0) > this.level) {
190
- return false;
211
+
212
+ _wrapLogFn(defaults, isRaw) {
213
+ return (...args) => {
214
+ if (paused) {
215
+ queue.push([
216
+ this,
217
+ defaults,
218
+ args,
219
+ isRaw,
220
+ ]);
221
+ return;
222
+ }
223
+
224
+ return this._logFn(defaults, args, isRaw);
225
+ };
191
226
  }
192
- const logObj = {
193
- date: new Date(),
194
- args: [],
195
- ...defaults,
196
- level: _normalizeLogLevel(defaults.level, this.options.types)
197
- };
198
- if (!isRaw && args.length === 1 && isLogObj(args[0])) {
199
- Object.assign(logObj, args[0]);
200
- } else {
201
- logObj.args = [...args];
227
+
228
+ _logFn(defaults, args, isRaw) {
229
+ if (this.level < (defaults.level || 0)) {
230
+ return false;
231
+ }
232
+
233
+ const logObj = {
234
+ date: new Date(),
235
+ args: [],
236
+ ...defaults,
237
+ level: _normalizeLogLevel(defaults.level, this.options.types),
238
+ };
239
+
240
+ if (!isRaw && args.length === 1 && isLogObj(args[0])) {
241
+ Object.assign(logObj, args[0]);
242
+ } else {
243
+ logObj.args = args.slice();
244
+ }
245
+
246
+ if (logObj.message) {
247
+ logObj.args.unshift(logObj.message);
248
+ delete logObj.message;
249
+ }
250
+
251
+ if (logObj.additional) {
252
+ if (!Array.isArray(logObj.additional)) {
253
+ logObj.additional = logObj.additional.split('\n');
254
+ }
255
+
256
+ logObj.args.push('\n' + logObj.additional.join('\n'));
257
+ delete logObj.additional;
258
+ }
259
+
260
+ logObj.type = isString(logObj.type) ? logObj.type.toLowerCase() : 'log';
261
+ if (!isString(logObj.tag))
262
+ logObj.tag = '';
263
+
264
+ const resolveLog = (newLog = false) => {
265
+ const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
266
+
267
+ if (this._lastLog.object && repeated > 0) {
268
+ const args2 = this._lastLog.object.args.slice();
269
+
270
+ if (repeated > 1) {
271
+ args2.push(`(repeated ${repeated} times)`);
272
+ }
273
+
274
+ this._log({ ...this._lastLog.object,
275
+ args: args2});
276
+ this._lastLog.count = 1;
277
+ }
278
+
279
+ if (newLog) {
280
+ this._lastLog.object = logObj;
281
+ this._log(logObj);
282
+ }
283
+ };
284
+
285
+ clearTimeout(this._lastLog.timeout);
286
+ const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
287
+
288
+ this._lastLog.time = logObj.date;
289
+ if (diffTime < this.options.throttle) {
290
+ try {
291
+ const serializedLog = JSON.stringify([
292
+ logObj.type,
293
+ logObj.tag,
294
+ logObj.args,
295
+ ]);
296
+
297
+ const isSameLog = this._lastLog.serialized === serializedLog;
298
+
299
+ this._lastLog.serialized = serializedLog;
300
+ if (isSameLog) {
301
+ this._lastLog.count = (this._lastLog.count || 0) + 1;
302
+ if (this._lastLog.count > this.options.throttleMin) {
303
+ this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
304
+ return;
305
+ }
306
+ }
307
+ } catch {}
308
+ }
309
+
310
+ resolveLog(true);
202
311
  }
203
- if (logObj.message) {
204
- logObj.args.unshift(logObj.message);
205
- delete logObj.message;
312
+
313
+ _log(logObj) {
314
+ for (const reporter of this.options.reporters) {
315
+ reporter.log(logObj, {
316
+ options: this.options,
317
+ });
318
+ }
206
319
  }
207
- if (logObj.additional) {
208
- if (!Array.isArray(logObj.additional)) {
209
- logObj.additional = logObj.additional.split("\n");
210
- }
211
- logObj.args.push("\n" + logObj.additional.join("\n"));
212
- delete logObj.additional;
320
+ }function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
321
+ if (input === void 0) {
322
+ return defaultLevel;
213
323
  }
214
- logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
215
- logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
216
- const resolveLog = (newLog = false) => {
217
- const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
218
- if (this._lastLog.object && repeated > 0) {
219
- const args2 = [...this._lastLog.object.args];
220
- if (repeated > 1) {
221
- args2.push(`(repeated ${repeated} times)`);
222
- }
223
- this._log({ ...this._lastLog.object, args: args2 });
224
- this._lastLog.count = 1;
225
- }
226
- if (newLog) {
227
- this._lastLog.object = logObj;
228
- this._log(logObj);
229
- }
230
- };
231
- clearTimeout(this._lastLog.timeout);
232
- const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
233
- this._lastLog.time = logObj.date;
234
- if (diffTime < this.options.throttle) {
235
- try {
236
- const serializedLog = JSON.stringify([
237
- logObj.type,
238
- logObj.tag,
239
- logObj.args
240
- ]);
241
- const isSameLog = this._lastLog.serialized === serializedLog;
242
- this._lastLog.serialized = serializedLog;
243
- if (isSameLog) {
244
- this._lastLog.count = (this._lastLog.count || 0) + 1;
245
- if (this._lastLog.count > this.options.throttleMin) {
246
- this._lastLog.timeout = setTimeout(
247
- resolveLog,
248
- this.options.throttle
249
- );
250
- return;
251
- }
252
- }
253
- } catch {
254
- }
324
+
325
+ if (isNumber(input)) {
326
+ return input;
255
327
  }
256
- resolveLog(true);
257
- }
258
- _log(logObj) {
259
- for (const reporter of this.options.reporters) {
260
- reporter.log(logObj, {
261
- options: this.options
262
- });
328
+
329
+ if (types[input] && types[input].level !== void 0) {
330
+ return types[input].level;
263
331
  }
264
- }
265
- }
266
- function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
267
- if (input === void 0) {
332
+
268
333
  return defaultLevel;
269
- }
270
- if (typeof input === "number") {
271
- return input;
272
- }
273
- if (types[input] && types[input].level !== void 0) {
274
- return types[input].level;
275
- }
276
- return defaultLevel;
277
334
  }
335
+
278
336
  Relinka.prototype.add = Relinka.prototype.addReporter;
279
337
  Relinka.prototype.remove = Relinka.prototype.removeReporter;
280
338
  Relinka.prototype.clear = Relinka.prototype.removeReporter;
@@ -283,5 +341,5 @@ Relinka.prototype.mock = Relinka.prototype.mockTypes;
283
341
  Relinka.prototype.pause = Relinka.prototype.pauseLogs;
284
342
  Relinka.prototype.resume = Relinka.prototype.resumeLogs;
285
343
  export function createRelinka(options = {}) {
286
- return new Relinka(options);
344
+ return new Relinka(options);
287
345
  }