@webdeveric/utils 0.47.0 → 0.48.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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { TypeAssertionFn } from './types/functions.js';
|
|
2
2
|
export type JsonReviver = Parameters<JSON['parse']>[1];
|
|
3
|
-
export declare function jsonParse(input: string): unknown;
|
|
4
3
|
export declare function jsonParse(input: string, reviver?: JsonReviver): unknown;
|
|
5
4
|
export declare function jsonParse<T>(input: string, reviver: JsonReviver | undefined, assertionFn: TypeAssertionFn<T>): T;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { TypePredicateFn } from '../types/functions.js';
|
|
2
|
-
export declare const createStringLengthRangePredicate: (min: number, max?: number) => TypePredicateFn<
|
|
2
|
+
export declare const createStringLengthRangePredicate: <Type extends string = string>(min: number, max?: number) => TypePredicateFn<Type>;
|
|
@@ -12,3 +12,4 @@ export type FirstChar<Type extends string> = Type extends `${infer First}${infer
|
|
|
12
12
|
export type AddSpaceAroundNumbers<Type extends string> = Type extends `${infer First}${infer Rest}` ? Rest extends EmptyString ? First : First extends AlphaCharacter | Capitalize<AlphaCharacter> ? FirstChar<Rest> extends NumericCharacter ? `${First}${Space}${AddSpaceAroundNumbers<Rest>}` : `${First}${AddSpaceAroundNumbers<Rest>}` : First extends NumericCharacter ? FirstChar<Rest> extends AlphaCharacter | Capitalize<AlphaCharacter> ? `${First}${Space}${AddSpaceAroundNumbers<Rest>}` : `${First}${AddSpaceAroundNumbers<Rest>}` : `${First}${AddSpaceAroundNumbers<Rest>}` : never;
|
|
13
13
|
export type CamelCase<Type extends string, Delimiter extends string = Space> = Type extends `${infer Left}${Delimiter}${infer Right}` ? `${Left}${CamelCase<Capitalize<Right>, Delimiter>}` : Type;
|
|
14
14
|
export type PascalCase<Type extends string, Delimiter extends string = Space> = Capitalize<CamelCase<AlphanumericOnly<AddSpaceAroundNumbers<Strip<Type, "'">>>, Delimiter>>;
|
|
15
|
+
export type StringLength<Type extends string, Accumulator extends never[] = []> = string extends Type ? never : Type extends `${infer _}${infer Rest}` ? StringLength<Rest, [never, ...Accumulator]> : Accumulator['length'];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webdeveric/utils",
|
|
3
3
|
"description": "Just another collection of utilities.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.48.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"url": "https://github.com/webdeveric/utils/issues"
|
|
67
67
|
},
|
|
68
68
|
"homepage": "https://github.com/webdeveric/utils/#readme",
|
|
69
|
-
"packageManager": "pnpm@10.
|
|
69
|
+
"packageManager": "pnpm@10.4.1+sha512.c753b6c3ad7afa13af388fa6d808035a008e30ea9993f58c6663e2bc5ff21679aa834db094987129aa4d488b86df57f7b634981b2f827cdcacc698cc0cfb88af",
|
|
70
70
|
"scripts": {
|
|
71
71
|
"clean": "rimraf ./dist/",
|
|
72
72
|
"prebuild": "pnpm clean",
|
|
@@ -87,26 +87,26 @@
|
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@commitlint/config-conventional": "^19.7.1",
|
|
89
89
|
"@commitlint/types": "^19.5.0",
|
|
90
|
-
"@types/node": "^22.13.
|
|
91
|
-
"@vitest/coverage-v8": "^3.0.
|
|
90
|
+
"@types/node": "^22.13.4",
|
|
91
|
+
"@vitest/coverage-v8": "^3.0.6",
|
|
92
92
|
"@webdeveric/eslint-config-ts": "^0.11.0",
|
|
93
93
|
"@webdeveric/prettier-config": "^0.3.0",
|
|
94
94
|
"commitlint": "^19.7.1",
|
|
95
95
|
"commitlint-plugin-cspell": "^0.1.1",
|
|
96
96
|
"conventional-changelog-conventionalcommits": "^8.0.0",
|
|
97
|
-
"cspell": "^8.17.
|
|
97
|
+
"cspell": "^8.17.4",
|
|
98
98
|
"eslint": "^8.57.1",
|
|
99
99
|
"eslint-config-prettier": "^10.0.1",
|
|
100
|
-
"eslint-import-resolver-typescript": "^3.
|
|
100
|
+
"eslint-import-resolver-typescript": "^3.8.2",
|
|
101
101
|
"eslint-plugin-import": "^2.31.0",
|
|
102
102
|
"husky": "^9.1.7",
|
|
103
103
|
"jsdom": "^26.0.0",
|
|
104
104
|
"lint-staged": "^15.4.3",
|
|
105
|
-
"prettier": "^3.
|
|
105
|
+
"prettier": "^3.5.1",
|
|
106
106
|
"rimraf": "^6.0.1",
|
|
107
|
-
"semantic-release": "^24.2.
|
|
107
|
+
"semantic-release": "^24.2.3",
|
|
108
108
|
"typescript": "^5.7.3",
|
|
109
109
|
"validate-package-exports": "^0.8.0",
|
|
110
|
-
"vitest": "^3.0.
|
|
110
|
+
"vitest": "^3.0.6"
|
|
111
111
|
}
|
|
112
112
|
}
|