@zayne-labs/toolkit-type-helpers 0.9.47 → 0.9.48
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/esm/index.d.ts +0 -6
- package/package.json +5 -5
package/dist/esm/index.d.ts
CHANGED
@@ -32,7 +32,6 @@ type LiteralUnion<TUnion extends TBase, TBase = string> = TUnion | (TBase & Reco
|
|
32
32
|
type Expect<TType extends true> = TType;
|
33
33
|
type GetGenericFn<TType> = <TGenericFnParam>() => TGenericFnParam extends TType ? true : false;
|
34
34
|
type Equal<TTypeOne, TTypeTwo> = GetGenericFn<TTypeOne> extends GetGenericFn<TTypeTwo> ? true : false;
|
35
|
-
|
36
35
|
//#endregion
|
37
36
|
//#region src/type-utils/writeable.d.ts
|
38
37
|
type ArrayOrObject = Record<number | string | symbol, unknown> | unknown[];
|
@@ -44,7 +43,6 @@ type WriteableLevel = "deep" | "shallow";
|
|
44
43
|
* @template TVariant - The level of writeable transformation ("shallow" | "deep")
|
45
44
|
*/
|
46
45
|
type Writeable<TObject, TLevel extends WriteableLevel = "shallow"> = TObject extends readonly [...infer TTupleItems] ? [...{ [Index in keyof TTupleItems]: TLevel extends "deep" ? Writeable<TTupleItems[Index], "deep"> : TTupleItems[Index] }] : TObject extends ArrayOrObject ? { -readonly [Key in keyof TObject]: TLevel extends "deep" ? Writeable<TObject[Key], "deep"> : TObject[Key] } : TObject;
|
47
|
-
|
48
46
|
//#endregion
|
49
47
|
//#region src/type-utils/union.d.ts
|
50
48
|
type ErrorMessages<TType extends number | string | symbol = never> = Partial<Record<"$all" | number | symbol | (AnyString | TType), unknown>> | null;
|
@@ -76,7 +74,6 @@ type UnionDiscriminator<TArrayOfTypes extends unknown[], TErrorMessages extends
|
|
76
74
|
type UnionVariant = "keys" | "values";
|
77
75
|
type ExtractUnion<TObject, TVariant extends UnionVariant = "values"> = TObject extends Array<infer TUnion> | ReadonlyArray<infer TUnion> | Set<infer TUnion> ? TUnion : TObject extends Record<infer TKeys, infer TValues> ? TVariant extends "keys" ? TKeys : Prettify<Writeable<TValues, "deep">> : never;
|
78
76
|
type UnionToIntersection<TUnion> = (TUnion extends unknown ? (param: TUnion) => void : never) extends ((param: infer TParam) => void) ? TParam : never;
|
79
|
-
|
80
77
|
//#endregion
|
81
78
|
//#region src/guard.d.ts
|
82
79
|
declare const isString: (value: unknown) => value is string;
|
@@ -97,7 +94,6 @@ declare const isFunction: <TFunction extends AnyFunction>(value: unknown) => val
|
|
97
94
|
declare const isAsyncFunction: <TAsyncFunction extends AnyAsyncFunction>(value: unknown) => value is TAsyncFunction;
|
98
95
|
declare const isFile: (value: unknown) => value is File;
|
99
96
|
declare const isIterable: <TIterable>(obj: object) => obj is Iterable<TIterable>;
|
100
|
-
|
101
97
|
//#endregion
|
102
98
|
//#region src/assert.d.ts
|
103
99
|
declare class AssertionError extends Error {
|
@@ -114,7 +110,6 @@ type AssertFn = {
|
|
114
110
|
<TValue>(value: TValue, messageOrOptions?: string | AssertOptions): asserts value is NonNullable<TValue>;
|
115
111
|
};
|
116
112
|
declare const assert: AssertFn;
|
117
|
-
|
118
113
|
//#endregion
|
119
114
|
//#region src/enum.d.ts
|
120
115
|
type DefineEnumOptions = {
|
@@ -140,7 +135,6 @@ declare const defineEnumDeep: <const TValue extends object, TOptions extends Def
|
|
140
135
|
writeableLevel: "deep";
|
141
136
|
})["unionVariant"] : "values">;
|
142
137
|
};
|
143
|
-
|
144
138
|
//#endregion
|
145
139
|
export { AnyAsyncFunction, AnyFunction, AnyNumber, AnyObject, AnyString, AssertionError, Awaitable, CallbackFn, EmptyObject, Equal, Expect, ExtractUnion, LiteralUnion, NonEmptyArray, NonFalsy, Prettify, PrettyOmit, PrettyPick, SelectorFn, UnionDiscriminator, UnionToIntersection, UnionVariant, UnknownObject, UnknownObjectWithAnyKey, UnmaskType, Writeable, WriteableLevel, assert, assertDefined, assertENV, defineEnum, defineEnumDeep, hasObjectPrototype, isArray, isAsyncFunction, isBoolean, isFile, isFormData, isFunction, isIterable, isNumber, isObject, isObjectAndNotArray, isPlainObject, isString, isSymbol };
|
146
140
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zayne-labs/toolkit-type-helpers",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.9.
|
4
|
+
"version": "0.9.48",
|
5
5
|
"description": "A collection of utility functions, types and composables used by my other projects. Nothing too fancy but can be useful.",
|
6
6
|
"author": "Ryan Zayne",
|
7
7
|
"license": "MIT",
|
@@ -35,16 +35,16 @@
|
|
35
35
|
"@size-limit/esbuild-why": "^11.2.0",
|
36
36
|
"@size-limit/preset-small-lib": "^11.2.0",
|
37
37
|
"@total-typescript/ts-reset": "^0.6.1",
|
38
|
-
"@types/node": "^22.15.
|
39
|
-
"@zayne-labs/tsconfig": "0.
|
38
|
+
"@types/node": "^22.15.30",
|
39
|
+
"@zayne-labs/tsconfig": "0.9.1",
|
40
40
|
"clsx": "^2.1.1",
|
41
41
|
"concurrently": "^9.1.2",
|
42
42
|
"cross-env": "^7.0.3",
|
43
43
|
"publint": "^0.3.12",
|
44
44
|
"size-limit": "^11.2.0",
|
45
|
-
"tsdown": "^0.12.
|
45
|
+
"tsdown": "^0.12.7",
|
46
46
|
"typescript": "5.8.3",
|
47
|
-
"vitest": "3.
|
47
|
+
"vitest": "3.2.2"
|
48
48
|
},
|
49
49
|
"publishConfig": {
|
50
50
|
"access": "public",
|