@alextheman/utility 5.18.2 → 5.19.1
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 +2 -3
- package/dist/index.cjs +4 -10
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +4 -10
- package/dist/internal/index.cjs +4 -10
- package/dist/internal/index.js +4 -10
- package/package.json +14 -11
package/README.md
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
[](https://github.com/alextheman231/utility/actions/workflows/ci.yml)
|
|
8
8
|
[](https://github.com/alextheman231/utility/actions/workflows/publish.yml)
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
This is my personal utility package. It provides custom utility functions that can be used in more or less any TypeScript or JavaScript project, using either the browser or Node environment.
|
|
12
11
|
|
|
13
12
|
## Installation
|
|
@@ -35,6 +34,6 @@ const myVariable: NonUndefined<string> = formatDateAndTime(new Date());
|
|
|
35
34
|
|
|
36
35
|
## Documentation
|
|
37
36
|
|
|
38
|
-
You can find the relevant documentation of all features of the package in the hosted documentation site
|
|
37
|
+
You can find the relevant documentation of all features of the package in [the hosted documentation site](https://alextheman231.github.io/utility/).
|
|
39
38
|
|
|
40
|
-
See the GitHub repository
|
|
39
|
+
See [the GitHub repository](https://github.com/alextheman231/utility).
|
package/dist/index.cjs
CHANGED
|
@@ -1173,16 +1173,10 @@ function _parseZodSchema(parsedResult, input, onError) {
|
|
|
1173
1173
|
if (evaluatedError instanceof Error) throw evaluatedError;
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
}
|
|
1181
|
-
throw new DataError$1({ input }, Object.entries(allErrorCodes).toSorted(([_, firstCount], [__, secondCount]) => {
|
|
1182
|
-
return secondCount - firstCount;
|
|
1183
|
-
}).map(([code, count], _, allErrorCodes) => {
|
|
1184
|
-
return allErrorCodes.length === 1 && count === 1 ? code : `${code}×${count}`;
|
|
1185
|
-
}).join(","), `\n\n${zod.default.prettifyError(parsedResult.error)}\n`);
|
|
1176
|
+
throw new DataError$1({
|
|
1177
|
+
input,
|
|
1178
|
+
issues: parsedResult.error.issues
|
|
1179
|
+
}, "ZOD_ERROR", `\n\n${zod.default.prettifyError(parsedResult.error)}\n`);
|
|
1186
1180
|
}
|
|
1187
1181
|
return parsedResult.data;
|
|
1188
1182
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1373,4 +1373,10 @@ declare const az: {
|
|
|
1373
1373
|
};
|
|
1374
1374
|
};
|
|
1375
1375
|
//#endregion
|
|
1376
|
-
|
|
1376
|
+
//#region src/root/zod/_parseZodSchema.d.ts
|
|
1377
|
+
interface ZodParsingErrorData {
|
|
1378
|
+
input: unknown;
|
|
1379
|
+
issues: Array<z.core.$ZodIssue>;
|
|
1380
|
+
}
|
|
1381
|
+
//#endregion
|
|
1382
|
+
export { APIError, type ArrayElement, type CallReturnType, type CamelToKebabOptions, type CreateEnumType, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, DataError, type DisallowUndefined, Env, FILE_PATH_PATTERN, FILE_PATH_REGEX, type FormDataArrayResolutionStrategy, type FormDataNullableResolutionStrategy, type HTTPErrorCode, type IgnoreCase, type IsTypeArgumentString, type KebabToCamelOptions, type NonNull, type NonUndefined, type NormaliseIndentsFunction, type NormaliseIndentsOptions, type NormalizeIndentsFunction, type NormalizeIndentsOptions, type NullableOnCondition, ONE_DAY_IN_MILLISECONDS, type OptionalOnCondition, type ParallelTuple, type RecordKey, type RemoveUndefined, type StringListToArrayOptions, type ToTitleCaseOptions, UUID_PATTERN, UUID_REGEX, VERSION_NUMBER_PATTERN, VERSION_NUMBER_REGEX, VersionNumber, type FormatOptionsBase as VersionNumberToStringOptions, VersionType, type ZodParsingErrorData, addDaysToDate, appendSemicolon, assertNotNull, assertNotNullable, assertNotUndefined, az, calculateMonthlyDifference, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, escapeRegexPattern, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, getStringsAndInterpolations, httpErrorCodeLookup, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, isTemplateStringsArray, kebabToCamel, normaliseIndents, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEnv, parseFormData, parseIntStrict, parseUUID, parseVersionType, parseZodSchema, parseZodSchemaAsync, randomiseArray, range, removeDuplicates, removeUndefinedFromObject, sayHello, stringListToArray, stringifyDotenv, toTitleCase, truncate, wait, zodVersionNumber };
|
package/dist/index.d.ts
CHANGED
|
@@ -1373,4 +1373,10 @@ declare const az: {
|
|
|
1373
1373
|
};
|
|
1374
1374
|
};
|
|
1375
1375
|
//#endregion
|
|
1376
|
-
|
|
1376
|
+
//#region src/root/zod/_parseZodSchema.d.ts
|
|
1377
|
+
interface ZodParsingErrorData {
|
|
1378
|
+
input: unknown;
|
|
1379
|
+
issues: Array<z$1.core.$ZodIssue>;
|
|
1380
|
+
}
|
|
1381
|
+
//#endregion
|
|
1382
|
+
export { APIError, type ArrayElement, type CallReturnType, type CamelToKebabOptions, type CreateEnumType, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, DataError, type DisallowUndefined, Env, FILE_PATH_PATTERN, FILE_PATH_REGEX, type FormDataArrayResolutionStrategy, type FormDataNullableResolutionStrategy, type HTTPErrorCode, type IgnoreCase, type IsTypeArgumentString, type KebabToCamelOptions, type NonNull, type NonUndefined, type NormaliseIndentsFunction, type NormaliseIndentsOptions, type NormalizeIndentsFunction, type NormalizeIndentsOptions, type NullableOnCondition, ONE_DAY_IN_MILLISECONDS, type OptionalOnCondition, type ParallelTuple, type RecordKey, type RemoveUndefined, type StringListToArrayOptions, type ToTitleCaseOptions, UUID_PATTERN, UUID_REGEX, VERSION_NUMBER_PATTERN, VERSION_NUMBER_REGEX, VersionNumber, type FormatOptionsBase as VersionNumberToStringOptions, VersionType, type ZodParsingErrorData, addDaysToDate, appendSemicolon, assertNotNull, assertNotNullable, assertNotUndefined, az, calculateMonthlyDifference, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, escapeRegexPattern, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, getStringsAndInterpolations, httpErrorCodeLookup, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, isTemplateStringsArray, kebabToCamel, normaliseIndents, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEnv, parseFormData, parseIntStrict, parseUUID, parseVersionType, parseZodSchema, parseZodSchemaAsync, randomiseArray, range, removeDuplicates, removeUndefinedFromObject, sayHello, stringListToArray, stringifyDotenv, toTitleCase, truncate, wait, zodVersionNumber };
|
package/dist/index.js
CHANGED
|
@@ -1149,16 +1149,10 @@ function _parseZodSchema(parsedResult, input, onError) {
|
|
|
1149
1149
|
if (evaluatedError instanceof Error) throw evaluatedError;
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
}
|
|
1157
|
-
throw new DataError$1({ input }, Object.entries(allErrorCodes).toSorted(([_, firstCount], [__, secondCount]) => {
|
|
1158
|
-
return secondCount - firstCount;
|
|
1159
|
-
}).map(([code, count], _, allErrorCodes) => {
|
|
1160
|
-
return allErrorCodes.length === 1 && count === 1 ? code : `${code}×${count}`;
|
|
1161
|
-
}).join(","), `\n\n${z$1.prettifyError(parsedResult.error)}\n`);
|
|
1152
|
+
throw new DataError$1({
|
|
1153
|
+
input,
|
|
1154
|
+
issues: parsedResult.error.issues
|
|
1155
|
+
}, "ZOD_ERROR", `\n\n${z$1.prettifyError(parsedResult.error)}\n`);
|
|
1162
1156
|
}
|
|
1163
1157
|
return parsedResult.data;
|
|
1164
1158
|
}
|
package/dist/internal/index.cjs
CHANGED
|
@@ -644,16 +644,10 @@ function _parseZodSchema(parsedResult, input, onError) {
|
|
|
644
644
|
if (evaluatedError instanceof Error) throw evaluatedError;
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
}
|
|
652
|
-
throw new DataError({ input }, Object.entries(allErrorCodes).toSorted(([_, firstCount], [__, secondCount]) => {
|
|
653
|
-
return secondCount - firstCount;
|
|
654
|
-
}).map(([code, count], _, allErrorCodes) => {
|
|
655
|
-
return allErrorCodes.length === 1 && count === 1 ? code : `${code}×${count}`;
|
|
656
|
-
}).join(","), `\n\n${zod.default.prettifyError(parsedResult.error)}\n`);
|
|
647
|
+
throw new DataError({
|
|
648
|
+
input,
|
|
649
|
+
issues: parsedResult.error.issues
|
|
650
|
+
}, "ZOD_ERROR", `\n\n${zod.default.prettifyError(parsedResult.error)}\n`);
|
|
657
651
|
}
|
|
658
652
|
return parsedResult.data;
|
|
659
653
|
}
|
package/dist/internal/index.js
CHANGED
|
@@ -619,16 +619,10 @@ function _parseZodSchema(parsedResult, input, onError) {
|
|
|
619
619
|
if (evaluatedError instanceof Error) throw evaluatedError;
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}
|
|
627
|
-
throw new DataError({ input }, Object.entries(allErrorCodes).toSorted(([_, firstCount], [__, secondCount]) => {
|
|
628
|
-
return secondCount - firstCount;
|
|
629
|
-
}).map(([code, count], _, allErrorCodes) => {
|
|
630
|
-
return allErrorCodes.length === 1 && count === 1 ? code : `${code}×${count}`;
|
|
631
|
-
}).join(","), `\n\n${z.prettifyError(parsedResult.error)}\n`);
|
|
622
|
+
throw new DataError({
|
|
623
|
+
input,
|
|
624
|
+
issues: parsedResult.error.issues
|
|
625
|
+
}, "ZOD_ERROR", `\n\n${z.prettifyError(parsedResult.error)}\n`);
|
|
632
626
|
}
|
|
633
627
|
return parsedResult.data;
|
|
634
628
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/utility",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.19.1",
|
|
4
4
|
"description": "Helpful utility functions.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,26 +40,27 @@
|
|
|
40
40
|
"execa": "9.6.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@alextheman/eslint-plugin": "5.
|
|
44
|
-
"@types/node": "25.
|
|
45
|
-
"alex-c-line": "2.
|
|
43
|
+
"@alextheman/eslint-plugin": "5.15.0",
|
|
44
|
+
"@types/node": "25.9.1",
|
|
45
|
+
"alex-c-line": "2.8.1",
|
|
46
46
|
"cross-env": "10.1.0",
|
|
47
47
|
"dotenv-cli": "11.0.0",
|
|
48
|
-
"eslint": "10.
|
|
48
|
+
"eslint": "10.4.0",
|
|
49
49
|
"globals": "17.6.0",
|
|
50
50
|
"husky": "9.1.7",
|
|
51
51
|
"jsdom": "29.1.1",
|
|
52
|
+
"markdownlint-cli2": "0.22.1",
|
|
52
53
|
"prettier": "3.8.3",
|
|
53
54
|
"tempy": "3.2.0",
|
|
54
55
|
"tsdown": "0.22.0",
|
|
55
|
-
"tsx": "4.
|
|
56
|
+
"tsx": "4.22.3",
|
|
56
57
|
"typedoc": "0.28.19",
|
|
57
58
|
"typedoc-plugin-markdown": "4.11.0",
|
|
58
59
|
"typedoc-rhineai-theme": "1.2.0",
|
|
59
60
|
"typescript": "6.0.3",
|
|
60
|
-
"typescript-eslint": "8.59.
|
|
61
|
-
"vite": "8.0.
|
|
62
|
-
"vitest": "4.1.
|
|
61
|
+
"typescript-eslint": "8.59.4",
|
|
62
|
+
"vite": "8.0.14",
|
|
63
|
+
"vitest": "4.1.7",
|
|
63
64
|
"zod": "4.4.3"
|
|
64
65
|
},
|
|
65
66
|
"engines": {
|
|
@@ -74,14 +75,16 @@
|
|
|
74
75
|
"create-feature-docs": "typedoc",
|
|
75
76
|
"create-local-package": "pnpm run build && rm -f alextheman-utility-*.tgz && pnpm pack",
|
|
76
77
|
"create-release-note": "bash -c 'git pull origin main && alex-c-line template release-note create $@' --",
|
|
77
|
-
"format": "pnpm run format-prettier && pnpm run format-eslint",
|
|
78
|
+
"format": "pnpm run format-prettier && pnpm run format-eslint && pnpm run format-markdownlint",
|
|
78
79
|
"format-eslint": "eslint --fix --suppress-all \"package.json\" \"{src,tests,configs}/**/*.ts\" && rm -f eslint-suppressions.json",
|
|
80
|
+
"format-markdownlint": "pnpm exec markdownlint-cli2 --fix \"**/*.md\" \"!{node_modules,dist}/**\" | grep -v \"^Finding:\"",
|
|
79
81
|
"format-prettier": "pnpm run format-prettier-typescript && pnpm run format-prettier-javascript && pnpm run format-prettier-yml",
|
|
80
82
|
"format-prettier-javascript": "prettier --write \"./**/*.js\"",
|
|
81
83
|
"format-prettier-typescript": "prettier --write --parser typescript \"./**/*.ts\"",
|
|
82
84
|
"format-prettier-yml": "prettier --write \"./**/*.{yml,yaml}\"",
|
|
83
|
-
"lint": "pnpm run lint-tsc && pnpm run lint-eslint && pnpm run lint-prettier && pnpm run lint-pre-release",
|
|
85
|
+
"lint": "pnpm run lint-tsc && pnpm run lint-eslint && pnpm run lint-markdownlint pnpm run lint-prettier && pnpm run lint-pre-release",
|
|
84
86
|
"lint-eslint": "eslint \"package.json\" \"{src,tests,configs}/**/*.ts\"",
|
|
87
|
+
"lint-markdownlint": "bash -o pipefail -c 'pnpm exec markdownlint-cli2 \"**/*.md\" \"!{node_modules,dist}/**\"| grep -v \"^Finding:\"'",
|
|
85
88
|
"lint-pre-release": "alex-c-line package-json check --rules no-pre-release-dependencies",
|
|
86
89
|
"lint-prettier": "pnpm run lint-prettier-typescript && pnpm run lint-prettier-javascript && pnpm run lint-prettier-yml",
|
|
87
90
|
"lint-prettier-javascript": "prettier --check \"./**/*.js\"",
|