@reliverse/rempts 1.7.44 → 1.7.46
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/README.md +1 -1
- package/dist-npm/bin/mod.d.mts +2333 -0
- package/dist-npm/bin/mod.mjs +8310 -0
- package/package.json +82 -42
- package/bin/libs/animate/animate-mod.d.ts +0 -14
- package/bin/libs/animate/animate-mod.js +0 -62
- package/bin/libs/anykey/anykey-mod.d.ts +0 -12
- package/bin/libs/anykey/anykey-mod.js +0 -125
- package/bin/libs/cancel/cancel.d.ts +0 -45
- package/bin/libs/cancel/cancel.js +0 -72
- package/bin/libs/confirm/confirm-alias.d.ts +0 -2
- package/bin/libs/confirm/confirm-alias.js +0 -2
- package/bin/libs/confirm/confirm-mod.d.ts +0 -5
- package/bin/libs/confirm/confirm-mod.js +0 -179
- package/bin/libs/date/date.d.ts +0 -2
- package/bin/libs/date/date.js +0 -236
- package/bin/libs/editor/editor-mod.d.ts +0 -25
- package/bin/libs/editor/editor-mod.js +0 -897
- package/bin/libs/figures/figures-mod.d.ts +0 -461
- package/bin/libs/figures/figures-mod.js +0 -285
- package/bin/libs/group/group-mod.d.ts +0 -33
- package/bin/libs/group/group-mod.js +0 -93
- package/bin/libs/input/input-alias.d.ts +0 -5
- package/bin/libs/input/input-alias.js +0 -4
- package/bin/libs/input/input-mod.d.ts +0 -16
- package/bin/libs/input/input-mod.js +0 -372
- package/bin/libs/intro/intro-alias.d.ts +0 -2
- package/bin/libs/intro/intro-alias.js +0 -3
- package/bin/libs/intro/intro-mod.d.ts +0 -20
- package/bin/libs/intro/intro-mod.js +0 -81
- package/bin/libs/launcher/command-runner.d.ts +0 -18
- package/bin/libs/launcher/command-runner.js +0 -79
- package/bin/libs/launcher/command-typed.d.ts +0 -16
- package/bin/libs/launcher/command-typed.js +0 -60
- package/bin/libs/launcher/launcher-alias.d.ts +0 -2
- package/bin/libs/launcher/launcher-alias.js +0 -2
- package/bin/libs/launcher/launcher-mod.d.ts +0 -162
- package/bin/libs/launcher/launcher-mod.js +0 -1222
- package/bin/libs/launcher/launcher-types.d.ts +0 -159
- package/bin/libs/launcher/launcher-types.js +0 -0
- package/bin/libs/launcher/trpc-orpc-support/completions.d.ts +0 -4
- package/bin/libs/launcher/trpc-orpc-support/completions.js +0 -45
- package/bin/libs/launcher/trpc-orpc-support/errors.d.ts +0 -11
- package/bin/libs/launcher/trpc-orpc-support/errors.js +0 -10
- package/bin/libs/launcher/trpc-orpc-support/index.d.ts +0 -34
- package/bin/libs/launcher/trpc-orpc-support/index.js +0 -641
- package/bin/libs/launcher/trpc-orpc-support/json-schema.d.ts +0 -17
- package/bin/libs/launcher/trpc-orpc-support/json-schema.js +0 -168
- package/bin/libs/launcher/trpc-orpc-support/json.d.ts +0 -44
- package/bin/libs/launcher/trpc-orpc-support/json.js +0 -41
- package/bin/libs/launcher/trpc-orpc-support/logging.d.ts +0 -11
- package/bin/libs/launcher/trpc-orpc-support/logging.js +0 -26
- package/bin/libs/launcher/trpc-orpc-support/parse-procedure.d.ts +0 -2
- package/bin/libs/launcher/trpc-orpc-support/parse-procedure.js +0 -486
- package/bin/libs/launcher/trpc-orpc-support/prompts.d.ts +0 -18
- package/bin/libs/launcher/trpc-orpc-support/prompts.js +0 -534
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/contract.d.ts +0 -53
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/contract.js +0 -0
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/errors.d.ts +0 -9
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/errors.js +0 -47
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/utils.d.ts +0 -3
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/utils.js +0 -6
- package/bin/libs/launcher/trpc-orpc-support/trpc-compat.d.ts +0 -71
- package/bin/libs/launcher/trpc-orpc-support/trpc-compat.js +0 -11
- package/bin/libs/launcher/trpc-orpc-support/types.d.ts +0 -276
- package/bin/libs/launcher/trpc-orpc-support/types.js +0 -0
- package/bin/libs/launcher/trpc-orpc-support/util.d.ts +0 -9
- package/bin/libs/launcher/trpc-orpc-support/util.js +0 -9
- package/bin/libs/log/log-alias.d.ts +0 -1
- package/bin/libs/log/log-alias.js +0 -2
- package/bin/libs/msg-fmt/colors.d.ts +0 -30
- package/bin/libs/msg-fmt/colors.js +0 -42
- package/bin/libs/msg-fmt/logger.d.ts +0 -17
- package/bin/libs/msg-fmt/logger.js +0 -103
- package/bin/libs/msg-fmt/mapping.d.ts +0 -3
- package/bin/libs/msg-fmt/mapping.js +0 -49
- package/bin/libs/msg-fmt/messages.d.ts +0 -35
- package/bin/libs/msg-fmt/messages.js +0 -319
- package/bin/libs/msg-fmt/terminal.d.ts +0 -15
- package/bin/libs/msg-fmt/terminal.js +0 -60
- package/bin/libs/msg-fmt/variants.d.ts +0 -11
- package/bin/libs/msg-fmt/variants.js +0 -52
- package/bin/libs/multiselect/multiselect-alias.d.ts +0 -2
- package/bin/libs/multiselect/multiselect-alias.js +0 -2
- package/bin/libs/multiselect/multiselect-prompt.d.ts +0 -2
- package/bin/libs/multiselect/multiselect-prompt.js +0 -348
- package/bin/libs/next-steps/next-steps.d.ts +0 -14
- package/bin/libs/next-steps/next-steps.js +0 -24
- package/bin/libs/number/number-mod.d.ts +0 -28
- package/bin/libs/number/number-mod.js +0 -194
- package/bin/libs/outro/outro-alias.d.ts +0 -2
- package/bin/libs/outro/outro-alias.js +0 -3
- package/bin/libs/outro/outro-mod.d.ts +0 -8
- package/bin/libs/outro/outro-mod.js +0 -55
- package/bin/libs/results/results.d.ts +0 -7
- package/bin/libs/results/results.js +0 -27
- package/bin/libs/select/nummultiselect-prompt.d.ts +0 -6
- package/bin/libs/select/nummultiselect-prompt.js +0 -105
- package/bin/libs/select/numselect-prompt.d.ts +0 -7
- package/bin/libs/select/numselect-prompt.js +0 -115
- package/bin/libs/select/select-alias.d.ts +0 -9
- package/bin/libs/select/select-alias.js +0 -9
- package/bin/libs/select/select-prompt.d.ts +0 -5
- package/bin/libs/select/select-prompt.js +0 -314
- package/bin/libs/select/toggle-prompt.d.ts +0 -5
- package/bin/libs/select/toggle-prompt.js +0 -209
- package/bin/libs/spinner/spinner-alias.d.ts +0 -1
- package/bin/libs/spinner/spinner-alias.js +0 -2
- package/bin/libs/spinner/spinner-mod.d.ts +0 -106
- package/bin/libs/spinner/spinner-mod.js +0 -265
- package/bin/libs/task/progress.d.ts +0 -2
- package/bin/libs/task/progress.js +0 -57
- package/bin/libs/task/task-spin.d.ts +0 -15
- package/bin/libs/task/task-spin.js +0 -110
- package/bin/libs/utils/colorize.d.ts +0 -2
- package/bin/libs/utils/colorize.js +0 -135
- package/bin/libs/utils/errors.d.ts +0 -1
- package/bin/libs/utils/errors.js +0 -17
- package/bin/libs/utils/prevent.d.ts +0 -8
- package/bin/libs/utils/prevent.js +0 -65
- package/bin/libs/utils/prompt-end.d.ts +0 -8
- package/bin/libs/utils/prompt-end.js +0 -34
- package/bin/libs/utils/stream-text.d.ts +0 -18
- package/bin/libs/utils/stream-text.js +0 -136
- package/bin/libs/utils/system.d.ts +0 -6
- package/bin/libs/utils/system.js +0 -7
- package/bin/libs/utils/validate.d.ts +0 -21
- package/bin/libs/utils/validate.js +0 -17
- package/bin/libs/visual/visual-mod.d.ts +0 -6
- package/bin/libs/visual/visual-mod.js +0 -13
- package/bin/mod.d.ts +0 -69
- package/bin/mod.js +0 -159
- package/bin/types.d.ts +0 -371
- package/bin/types.js +0 -0
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
const capitaliseFromCamelCase = (camel) => {
|
|
2
|
-
const parts = camel.split(/(?=[A-Z])/);
|
|
3
|
-
return capitalise(parts.map((p) => p.toLowerCase()).join(" "));
|
|
4
|
-
};
|
|
5
|
-
const capitalise = (s) => s.slice(0, 1).toUpperCase() + s.slice(1);
|
|
6
|
-
export const flattenedProperties = (sch) => {
|
|
7
|
-
if ("properties" in sch) {
|
|
8
|
-
return sch.properties;
|
|
9
|
-
}
|
|
10
|
-
if ("allOf" in sch) {
|
|
11
|
-
return Object.fromEntries(
|
|
12
|
-
sch.allOf.flatMap(
|
|
13
|
-
(subSchema) => Object.entries(flattenedProperties(subSchema))
|
|
14
|
-
)
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
if ("anyOf" in sch) {
|
|
18
|
-
const isExcluded = (v) => Object.keys(v).join(",") === "not";
|
|
19
|
-
const entries = sch.anyOf.flatMap((subSchema) => {
|
|
20
|
-
const flattened = flattenedProperties(subSchema);
|
|
21
|
-
const excluded = Object.entries(flattened).flatMap(
|
|
22
|
-
([name, propSchema]) => {
|
|
23
|
-
return isExcluded(propSchema) ? [`--${name}`] : [];
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
return Object.entries(flattened).map(([k, v]) => {
|
|
27
|
-
if (!isExcluded(v) && excluded.length > 0) {
|
|
28
|
-
return [
|
|
29
|
-
k,
|
|
30
|
-
Object.assign({}, v, { "Do not use with": excluded })
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
return [k, v];
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
return Object.fromEntries(
|
|
37
|
-
entries.sort((a, b) => {
|
|
38
|
-
const scores = [a, b].map(([_k, v]) => isExcluded(v) ? 0 : 1);
|
|
39
|
-
return scores[0] - scores[1];
|
|
40
|
-
})
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
return {};
|
|
44
|
-
};
|
|
45
|
-
export const incompatiblePropertyPairs = (sch) => {
|
|
46
|
-
const isUnion = "anyOf" in sch;
|
|
47
|
-
if (!isUnion) return [];
|
|
48
|
-
const sets = sch.anyOf.map((subSchema) => {
|
|
49
|
-
const keys = Object.keys(flattenedProperties(subSchema));
|
|
50
|
-
return { keys, set: new Set(keys) };
|
|
51
|
-
});
|
|
52
|
-
const compatiblityEntries = sets.flatMap(({ keys }) => {
|
|
53
|
-
return keys.map((key) => {
|
|
54
|
-
return [
|
|
55
|
-
key,
|
|
56
|
-
new Set(
|
|
57
|
-
sets.filter((other) => other.set.has(key)).flatMap((other) => other.keys)
|
|
58
|
-
)
|
|
59
|
-
];
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
const allKeys = sets.flatMap(({ keys }) => keys);
|
|
63
|
-
return compatiblityEntries.flatMap(([key, compatibleWith]) => {
|
|
64
|
-
const incompatibleEntries = allKeys.filter((other) => key < other && !compatibleWith.has(other)).map((other) => [key, other]);
|
|
65
|
-
return incompatibleEntries;
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
export const getDescription = (v, depth = 0) => {
|
|
69
|
-
if ("items" in v && v.items) {
|
|
70
|
-
const { items, ...rest } = v;
|
|
71
|
-
return [
|
|
72
|
-
getDescription(items, 1),
|
|
73
|
-
getDescription(rest),
|
|
74
|
-
"array"
|
|
75
|
-
].filter(Boolean).join(" ");
|
|
76
|
-
}
|
|
77
|
-
return Object.entries(v).filter(([k, vv]) => {
|
|
78
|
-
if (k === "default" || k === "additionalProperties" || k === "optional")
|
|
79
|
-
return false;
|
|
80
|
-
if (k === "type" && typeof vv === "string") return depth > 0;
|
|
81
|
-
if (k.startsWith("$")) return false;
|
|
82
|
-
if (k === "maximum" && vv === Number.MAX_SAFE_INTEGER) return false;
|
|
83
|
-
if (depth <= 1 && k === "enum" && getEnumChoices(v)?.type === "string_enum")
|
|
84
|
-
return false;
|
|
85
|
-
return true;
|
|
86
|
-
}).sort(([a], [b]) => {
|
|
87
|
-
const scores = [a, b].map((k) => k === "description" ? 0 : 1);
|
|
88
|
-
return scores[0] - scores[1];
|
|
89
|
-
}).map(([k, vv], i) => {
|
|
90
|
-
if (k === "type" && Array.isArray(vv))
|
|
91
|
-
return `type: ${vv.join(" or ")}`;
|
|
92
|
-
if (k === "description" && i === 0) return String(vv);
|
|
93
|
-
if (k === "properties") return "Object (json formatted)";
|
|
94
|
-
if (typeof vv === "object")
|
|
95
|
-
return `${capitaliseFromCamelCase(k)}: ${JSON.stringify(vv)}`;
|
|
96
|
-
return `${capitaliseFromCamelCase(k)}: ${vv}`;
|
|
97
|
-
}).join("; ") || "";
|
|
98
|
-
};
|
|
99
|
-
export const getSchemaTypes = (propertyValue) => {
|
|
100
|
-
const array = [];
|
|
101
|
-
if ("type" in propertyValue) {
|
|
102
|
-
array.push(...[propertyValue.type].flat());
|
|
103
|
-
}
|
|
104
|
-
if ("enum" in propertyValue && Array.isArray(propertyValue.enum)) {
|
|
105
|
-
array.push(...propertyValue.enum.flatMap((s) => typeof s));
|
|
106
|
-
}
|
|
107
|
-
if ("const" in propertyValue && propertyValue.const === null) {
|
|
108
|
-
array.push("null");
|
|
109
|
-
} else if ("const" in propertyValue) {
|
|
110
|
-
array.push(typeof propertyValue.const);
|
|
111
|
-
}
|
|
112
|
-
if ("oneOf" in propertyValue) {
|
|
113
|
-
array.push(
|
|
114
|
-
...propertyValue.oneOf.flatMap(getSchemaTypes)
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
if ("anyOf" in propertyValue) {
|
|
118
|
-
array.push(
|
|
119
|
-
...propertyValue.anyOf.flatMap(getSchemaTypes)
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
return [...new Set(array)];
|
|
123
|
-
};
|
|
124
|
-
export const getEnumChoices = (propertyValue) => {
|
|
125
|
-
if (!propertyValue) return null;
|
|
126
|
-
if (!("enum" in propertyValue && Array.isArray(propertyValue.enum))) {
|
|
127
|
-
if ("anyOf" in propertyValue && propertyValue.anyOf?.every((subSchema) => {
|
|
128
|
-
if (subSchema && "const" in subSchema && Object.keys(subSchema).length === 1 && typeof subSchema.const === "string") {
|
|
129
|
-
return true;
|
|
130
|
-
}
|
|
131
|
-
return false;
|
|
132
|
-
})) {
|
|
133
|
-
return {
|
|
134
|
-
type: "string_enum",
|
|
135
|
-
choices: propertyValue.anyOf.map(
|
|
136
|
-
(subSchema) => subSchema.const
|
|
137
|
-
)
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
if ("anyOf" in propertyValue && propertyValue.anyOf?.every((subSchema) => {
|
|
141
|
-
if (subSchema && "const" in subSchema && Object.keys(subSchema).length === 1 && typeof subSchema.const === "number") {
|
|
142
|
-
return true;
|
|
143
|
-
}
|
|
144
|
-
return false;
|
|
145
|
-
})) {
|
|
146
|
-
return {
|
|
147
|
-
type: "number_enum",
|
|
148
|
-
choices: propertyValue.anyOf.map(
|
|
149
|
-
(subSchema) => subSchema.const
|
|
150
|
-
)
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return null;
|
|
154
|
-
}
|
|
155
|
-
if (propertyValue.enum.every((s) => typeof s === "string")) {
|
|
156
|
-
return {
|
|
157
|
-
type: "string_enum",
|
|
158
|
-
choices: propertyValue.enum
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
if (propertyValue.enum.every((s) => typeof s === "number")) {
|
|
162
|
-
return {
|
|
163
|
-
type: "number_enum",
|
|
164
|
-
choices: propertyValue.enum
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
return null;
|
|
168
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Command } from "commander";
|
|
2
|
-
/**
|
|
3
|
-
* JSON representation of a commander `Command` instance
|
|
4
|
-
* Note: this is not necessarily a _complete_ representation of the command - it aims to be a big enough subset to be useful for generating documentation etc.
|
|
5
|
-
*/
|
|
6
|
-
export interface CommandJSON {
|
|
7
|
-
name?: string;
|
|
8
|
-
version?: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
usage?: string;
|
|
11
|
-
commands?: CommandJSON[];
|
|
12
|
-
arguments?: {
|
|
13
|
-
name: string;
|
|
14
|
-
description?: string;
|
|
15
|
-
required: boolean;
|
|
16
|
-
defaultValue?: {};
|
|
17
|
-
defaultValueDescription?: string;
|
|
18
|
-
variadic: boolean;
|
|
19
|
-
choices?: string[];
|
|
20
|
-
}[];
|
|
21
|
-
options?: {
|
|
22
|
-
name: string;
|
|
23
|
-
description?: string;
|
|
24
|
-
required: boolean;
|
|
25
|
-
defaultValue?: {};
|
|
26
|
-
defaultValueDescription?: string;
|
|
27
|
-
variadic: boolean;
|
|
28
|
-
attributeName?: string;
|
|
29
|
-
flags?: string;
|
|
30
|
-
short?: string;
|
|
31
|
-
negate: boolean;
|
|
32
|
-
optional: boolean;
|
|
33
|
-
choices?: string[];
|
|
34
|
-
}[];
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Convert a commander `Command` instance to a JSON object.
|
|
38
|
-
*
|
|
39
|
-
* Note: in theory you could use this with any `Command` instance, it doesn't have
|
|
40
|
-
* to be one built by `@reliverse/rempts`. Implementing here because it's pretty simple to do and `commander` doesn't seem to provide a way to do it.
|
|
41
|
-
*
|
|
42
|
-
* Note: falsy values for strings are replaced with `undefined` in the output - e.g. if there's an empty description, it will be `undefined` in the output.
|
|
43
|
-
*/
|
|
44
|
-
export declare const commandToJSON: (command: Command) => CommandJSON;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export const commandToJSON = (command) => {
|
|
2
|
-
const json = {};
|
|
3
|
-
const name = command.name();
|
|
4
|
-
if (name) json.name = name;
|
|
5
|
-
const version = command.version();
|
|
6
|
-
if (version) json.version = version;
|
|
7
|
-
const description = command.description();
|
|
8
|
-
if (description) json.description = description;
|
|
9
|
-
const usage = command.usage();
|
|
10
|
-
if (usage) json.usage = usage;
|
|
11
|
-
json.arguments = command.registeredArguments.map((arg) => {
|
|
12
|
-
const result = { name: arg.name() };
|
|
13
|
-
result.variadic = arg.variadic;
|
|
14
|
-
result.required = arg.required;
|
|
15
|
-
if (arg.description) result.description = arg.description;
|
|
16
|
-
if (arg.defaultValue) result.defaultValue = arg.defaultValue;
|
|
17
|
-
if (arg.defaultValueDescription)
|
|
18
|
-
result.defaultValueDescription = arg.defaultValueDescription;
|
|
19
|
-
if (arg.argChoices) result.choices = arg.argChoices;
|
|
20
|
-
return result;
|
|
21
|
-
});
|
|
22
|
-
json.options = command.options.map((o) => {
|
|
23
|
-
const result = { name: o.name() };
|
|
24
|
-
result.required = o.required;
|
|
25
|
-
result.optional = o.optional;
|
|
26
|
-
result.negate = o.negate;
|
|
27
|
-
result.variadic = o.variadic;
|
|
28
|
-
if (o.flags) result.flags = o.flags;
|
|
29
|
-
if (o.short) result.short = o.short;
|
|
30
|
-
if (o.description) result.description = o.description;
|
|
31
|
-
if (o.argChoices) result.choices = o.argChoices;
|
|
32
|
-
const attributeName = o.attributeName();
|
|
33
|
-
if (attributeName) result.attributeName = attributeName;
|
|
34
|
-
if (o.defaultValue) result.defaultValue = o.defaultValue;
|
|
35
|
-
if (o.defaultValueDescription)
|
|
36
|
-
result.defaultValueDescription = o.defaultValueDescription;
|
|
37
|
-
return result;
|
|
38
|
-
});
|
|
39
|
-
json.commands = command.commands.map((c) => commandToJSON(c));
|
|
40
|
-
return json;
|
|
41
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Logger } from "./types";
|
|
2
|
-
export declare const lineByLineLogger: (logger: Logger) => Logger;
|
|
3
|
-
/**
|
|
4
|
-
* A logger which uses `console.log` and `console.error` to log in the following way:
|
|
5
|
-
* - Primitives are logged directly
|
|
6
|
-
* - Arrays are logged item-by-item
|
|
7
|
-
* - Objects are logged as JSON
|
|
8
|
-
*
|
|
9
|
-
* This is useful for logging structured data in a human-readable way, and for piping logs to other tools.
|
|
10
|
-
*/
|
|
11
|
-
export declare const lineByLineConsoleLogger: Logger;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export const lineByLineLogger = getLoggerTransformer((log) => {
|
|
2
|
-
const wrapper = (args, depth) => {
|
|
3
|
-
if (args.length === 1 && Array.isArray(args[0]) && depth === 0) {
|
|
4
|
-
args[0].forEach((item) => wrapper([item], 1));
|
|
5
|
-
} else if (args.every(isPrimitive)) {
|
|
6
|
-
log(...args);
|
|
7
|
-
} else if (args.length === 1) {
|
|
8
|
-
log(JSON.stringify(args[0], null, 2));
|
|
9
|
-
} else {
|
|
10
|
-
log(JSON.stringify(args, null, 2));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
return (...args) => wrapper(args, 0);
|
|
14
|
-
});
|
|
15
|
-
const isPrimitive = (value) => {
|
|
16
|
-
const type = typeof value;
|
|
17
|
-
return type === "string" || type === "number" || type === "boolean";
|
|
18
|
-
};
|
|
19
|
-
function getLoggerTransformer(transform) {
|
|
20
|
-
return (logger) => {
|
|
21
|
-
const info = logger.info && transform(logger.info);
|
|
22
|
-
const error = logger.error && transform(logger.error);
|
|
23
|
-
return { info, error };
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export const lineByLineConsoleLogger = lineByLineLogger(console);
|