@astral/validations 1.39.4 → 1.40.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/esm/types.d.ts +4 -4
- package/esm/yupAdapter/yupAdapter.d.ts +1 -1
- package/package.json +1 -1
- package/types.d.ts +4 -4
- package/yupAdapter/yupAdapter.d.ts +1 -1
package/esm/types.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export
|
1
|
+
export type RuleError = string | string[];
|
2
|
+
export type ValidationResult = RuleError | undefined;
|
3
|
+
export type InitializedRule = (value?: unknown) => ValidationResult;
|
4
|
+
export type Rule<Params extends object, RequiredParams extends boolean> = RequiredParams extends true ? (params: Params) => InitializedRule : (params?: Params) => InitializedRule;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { InitializedRule } from '../types';
|
2
|
-
|
2
|
+
type YupValidationResult = boolean | string | string[];
|
3
3
|
/**
|
4
4
|
* @description Адаптирует правило созданное createRule к интерфейсу yup
|
5
5
|
* @example yupAdapter(isMinLength(22))('word')
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export
|
1
|
+
export type RuleError = string | string[];
|
2
|
+
export type ValidationResult = RuleError | undefined;
|
3
|
+
export type InitializedRule = (value?: unknown) => ValidationResult;
|
4
|
+
export type Rule<Params extends object, RequiredParams extends boolean> = RequiredParams extends true ? (params: Params) => InitializedRule : (params?: Params) => InitializedRule;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { InitializedRule } from '../types';
|
2
|
-
|
2
|
+
type YupValidationResult = boolean | string | string[];
|
3
3
|
/**
|
4
4
|
* @description Адаптирует правило созданное createRule к интерфейсу yup
|
5
5
|
* @example yupAdapter(isMinLength(22))('word')
|