@code-pushup/utils 0.53.1 → 0.54.0
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/index.js +3 -3
- package/package.json +2 -2
- package/src/lib/transform.d.ts +0 -1
package/index.js
CHANGED
|
@@ -106,7 +106,6 @@ var fileNameSchema = z.string().trim().regex(filenameRegex, {
|
|
|
106
106
|
message: `The filename has to be valid`
|
|
107
107
|
}).min(1, { message: "file name is invalid" });
|
|
108
108
|
var positiveIntSchema = z.number().int().positive();
|
|
109
|
-
var nonnegativeIntSchema = z.number().int().nonnegative();
|
|
110
109
|
var nonnegativeNumberSchema = z.number().nonnegative();
|
|
111
110
|
function packageVersionSchema(options) {
|
|
112
111
|
const { versionDescription = "NPM version of the package", required } = options ?? {};
|
|
@@ -650,7 +649,7 @@ var auditDiffSchema = scorableWithPluginDiffSchema.merge(
|
|
|
650
649
|
z16.object({
|
|
651
650
|
values: makeComparisonSchema(auditValueSchema).merge(
|
|
652
651
|
z16.object({
|
|
653
|
-
diff: z16.number().
|
|
652
|
+
diff: z16.number().describe("Value change (`values.after - values.before`)")
|
|
654
653
|
})
|
|
655
654
|
).describe("Audit `value` comparison"),
|
|
656
655
|
displayValues: makeComparisonSchema(auditDisplayValueSchema).describe(
|
|
@@ -997,6 +996,7 @@ function executeProcess(cfg) {
|
|
|
997
996
|
return new Promise((resolve, reject) => {
|
|
998
997
|
const spawnedProcess = spawn(command, args ?? [], {
|
|
999
998
|
shell: true,
|
|
999
|
+
windowsHide: true,
|
|
1000
1000
|
...options
|
|
1001
1001
|
});
|
|
1002
1002
|
let stdout = "";
|
|
@@ -2695,7 +2695,7 @@ function reportToHeaderSection(report) {
|
|
|
2695
2695
|
function logPlugins(plugins, verbose) {
|
|
2696
2696
|
plugins.forEach((plugin) => {
|
|
2697
2697
|
const { title, audits } = plugin;
|
|
2698
|
-
const filteredAudits = verbose ? audits : audits.filter(({ score }) => score !== 1);
|
|
2698
|
+
const filteredAudits = verbose || audits.length === 1 ? audits : audits.filter(({ score }) => score !== 1);
|
|
2699
2699
|
const diff = audits.length - filteredAudits.length;
|
|
2700
2700
|
logAudits(title, filteredAudits);
|
|
2701
2701
|
if (diff > 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-pushup/utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "Low-level utilities (helper functions, etc.) used by Code PushUp CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/code-pushup/cli/tree/main/packages/utils#readme",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"main": "./index.js",
|
|
27
27
|
"types": "./src/index.d.ts",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@code-pushup/models": "0.
|
|
29
|
+
"@code-pushup/models": "0.54.0",
|
|
30
30
|
"@isaacs/cliui": "^8.0.2",
|
|
31
31
|
"@poppinss/cliui": "^6.4.0",
|
|
32
32
|
"ansis": "^3.3.0",
|
package/src/lib/transform.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export declare function objectToKeys<T extends object>(obj: T): (keyof T)[];
|
|
|
3
3
|
export declare function objectToEntries<T extends object>(obj: T): [keyof T, T[keyof T]][];
|
|
4
4
|
export declare function objectFromEntries<K extends PropertyKey, V>(entries: [K, V][]): Record<K, V>;
|
|
5
5
|
export declare function countOccurrences<T extends PropertyKey>(values: T[]): Partial<Record<T, number>>;
|
|
6
|
-
export declare function exists<T>(value: T): value is NonNullable<T>;
|
|
7
6
|
export declare function distinct<T extends string | number | boolean>(array: T[]): T[];
|
|
8
7
|
export declare function deepClone<T>(obj: T): T;
|
|
9
8
|
export declare function factorOf<T>(items: T[], filterFn: (i: T) => boolean): number;
|