@regle/core 0.5.10 → 0.5.11
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 +0 -1
- package/dist/regle-core.d.cts +6 -0
- package/dist/regle-core.d.ts +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,6 @@ It's heavily inspired by Vuelidate.
|
|
|
20
20
|
| [](https://stackblitz.com/~/github.com/victorgarciaesgi/regle-examples/tree/main/examples/simple-example?file=examples/simple-example/src/App.vue&configPath=examples/simple-example) | [](https://stackblitz.com/~/github.com/victorgarciaesgi/regle-examples/tree/main/examples/advanced-example?file=examples/advanced-example/src/App.vue&configPath=examples/advanced-example) |
|
|
21
21
|
|
|
22
22
|
## 🧰 Features
|
|
23
|
-
- ✅ Typescript first
|
|
24
23
|
- 🤖 100% type inference
|
|
25
24
|
- 📖 Model based validation
|
|
26
25
|
- 🛒 Collection validation
|
package/dist/regle-core.d.cts
CHANGED
|
@@ -1056,6 +1056,10 @@ type MismatchInfo<Actual, Expected> = And<[Extends<PrintType<Actual>, '...'>, No
|
|
|
1056
1056
|
|
|
1057
1057
|
type RemoveCommonKey<T extends readonly any[], K extends PropertyKey> = T extends [infer F, ...infer R] ? [Prettify<Omit<F, K>>, ...RemoveCommonKey<R, K>] : [];
|
|
1058
1058
|
type JoinDiscriminatedUnions<TUnion extends unknown> = isRecordLiteral<TUnion> extends true ? Prettify<Partial<UnionToIntersection$1<RemoveCommonKey<UnionToTuple$1<TUnion>, keyof NonNullable<TUnion>>[number]>> & Pick<NonNullable<TUnion>, keyof NonNullable<TUnion>>> : TUnion;
|
|
1059
|
+
type EnumLike = {
|
|
1060
|
+
[k: string]: string | number;
|
|
1061
|
+
[nu: number]: string;
|
|
1062
|
+
};
|
|
1059
1063
|
|
|
1060
1064
|
type CreateFn<T extends any[]> = (...args: T) => any;
|
|
1061
1065
|
/**
|
|
@@ -1229,7 +1233,9 @@ type DefaultValidators = {
|
|
|
1229
1233
|
maxValue: RegleRuleWithParamsDefinition<number, [count: number], false, boolean>;
|
|
1230
1234
|
minLength: RegleRuleWithParamsDefinition<string | any[] | Record<PropertyKey, any>, [count: number], false, boolean>;
|
|
1231
1235
|
minValue: RegleRuleWithParamsDefinition<number, [count: number], false, boolean>;
|
|
1236
|
+
nativeEnum: RegleRuleDefinition<string | number, [enumLike: EnumLike], false, boolean, string | number>;
|
|
1232
1237
|
numeric: RegleRuleDefinition<string | number, [], false, boolean, string | number>;
|
|
1238
|
+
oneOf: RegleRuleDefinition<string | number, [options: (string | number)[]], false, boolean, string | number>;
|
|
1233
1239
|
regex: RegleRuleWithParamsDefinition<string, [regexp: RegExp], false, boolean>;
|
|
1234
1240
|
required: RegleRuleDefinition<unknown, []>;
|
|
1235
1241
|
sameAs: RegleRuleWithParamsDefinition<unknown, [target: unknown, otherName?: string], false, boolean>;
|
package/dist/regle-core.d.ts
CHANGED
|
@@ -1056,6 +1056,10 @@ type MismatchInfo<Actual, Expected> = And<[Extends<PrintType<Actual>, '...'>, No
|
|
|
1056
1056
|
|
|
1057
1057
|
type RemoveCommonKey<T extends readonly any[], K extends PropertyKey> = T extends [infer F, ...infer R] ? [Prettify<Omit<F, K>>, ...RemoveCommonKey<R, K>] : [];
|
|
1058
1058
|
type JoinDiscriminatedUnions<TUnion extends unknown> = isRecordLiteral<TUnion> extends true ? Prettify<Partial<UnionToIntersection$1<RemoveCommonKey<UnionToTuple$1<TUnion>, keyof NonNullable<TUnion>>[number]>> & Pick<NonNullable<TUnion>, keyof NonNullable<TUnion>>> : TUnion;
|
|
1059
|
+
type EnumLike = {
|
|
1060
|
+
[k: string]: string | number;
|
|
1061
|
+
[nu: number]: string;
|
|
1062
|
+
};
|
|
1059
1063
|
|
|
1060
1064
|
type CreateFn<T extends any[]> = (...args: T) => any;
|
|
1061
1065
|
/**
|
|
@@ -1229,7 +1233,9 @@ type DefaultValidators = {
|
|
|
1229
1233
|
maxValue: RegleRuleWithParamsDefinition<number, [count: number], false, boolean>;
|
|
1230
1234
|
minLength: RegleRuleWithParamsDefinition<string | any[] | Record<PropertyKey, any>, [count: number], false, boolean>;
|
|
1231
1235
|
minValue: RegleRuleWithParamsDefinition<number, [count: number], false, boolean>;
|
|
1236
|
+
nativeEnum: RegleRuleDefinition<string | number, [enumLike: EnumLike], false, boolean, string | number>;
|
|
1232
1237
|
numeric: RegleRuleDefinition<string | number, [], false, boolean, string | number>;
|
|
1238
|
+
oneOf: RegleRuleDefinition<string | number, [options: (string | number)[]], false, boolean, string | number>;
|
|
1233
1239
|
regex: RegleRuleWithParamsDefinition<string, [regexp: RegExp], false, boolean>;
|
|
1234
1240
|
required: RegleRuleDefinition<unknown, []>;
|
|
1235
1241
|
sameAs: RegleRuleWithParamsDefinition<unknown, [target: unknown, otherName?: string], false, boolean>;
|