@ztimson/utils 0.27.6 → 0.27.7
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/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/misc.d.ts +9 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1885,11 +1885,12 @@ ${opts.message || this.desc}`;
|
|
|
1885
1885
|
return tMajor > vMajor || tMinor > vMinor || tPatch > vPatch ? 1 : tMajor < vMajor || tMinor < vMinor || tPatch < vPatch ? -1 : 0;
|
|
1886
1886
|
}
|
|
1887
1887
|
function consoleInterceptor(out = console, map) {
|
|
1888
|
-
const
|
|
1888
|
+
const logs = { debug: [], log: [], info: [], warn: [], error: [], stderr: [], stdout: [] };
|
|
1889
1889
|
const cWrapper = (type) => (...args) => {
|
|
1890
1890
|
if (out) out[type](...args);
|
|
1891
|
-
|
|
1892
|
-
|
|
1891
|
+
logs[type].push(...args);
|
|
1892
|
+
if (type == "error") logs.stderr.push(...args);
|
|
1893
|
+
else logs.stdout.push(...args);
|
|
1893
1894
|
};
|
|
1894
1895
|
return {
|
|
1895
1896
|
debug: (map == null ? void 0 : map.debug) != "none" ? cWrapper((map == null ? void 0 : map.debug) || "debug") : () => {
|
|
@@ -1902,8 +1903,7 @@ ${opts.message || this.desc}`;
|
|
|
1902
1903
|
},
|
|
1903
1904
|
error: (map == null ? void 0 : map.error) != "none" ? cWrapper((map == null ? void 0 : map.error) || "error") : () => {
|
|
1904
1905
|
},
|
|
1905
|
-
|
|
1906
|
-
stdout
|
|
1906
|
+
output: logs
|
|
1907
1907
|
};
|
|
1908
1908
|
}
|
|
1909
1909
|
function escapeRegex(value) {
|