@conform-to/dom
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -1,2 +0,2 @@ | ||
export declare type Constraint<Type> = (Type extends string | number | Date | undefined ? { | ||
export declare type Constraint = { | ||
required?: boolean; | ||
@@ -10,11 +10,3 @@ minLength?: number; | ||
pattern?: string; | ||
} : {}) & (undefined extends Type ? { | ||
required?: false; | ||
} : { | ||
required: true; | ||
}) & (Type extends Array<any> ? { | ||
multiple: true; | ||
} : { | ||
multiple?: false; | ||
}); | ||
}; | ||
export interface FieldConfig<Type = any> { | ||
@@ -25,7 +17,7 @@ name: string; | ||
form?: string; | ||
constraint?: Constraint<Type>; | ||
constraint?: Constraint; | ||
} | ||
export declare type Schema<Type extends Record<string, any>> = { | ||
fields: { | ||
[Key in keyof Type]-?: Constraint<Type[Key]>; | ||
[Key in keyof Type]-?: Constraint; | ||
}; | ||
@@ -32,0 +24,0 @@ validate?: (element: FieldsetElement) => void; |
@@ -66,3 +66,2 @@ 'use strict'; | ||
error: (_options$error = options.error) === null || _options$error === void 0 ? void 0 : _options$error[key], | ||
// @ts-expect-error | ||
constraint | ||
@@ -69,0 +68,0 @@ }; |
@@ -62,3 +62,2 @@ /** | ||
error: (_options$error = options.error) === null || _options$error === void 0 ? void 0 : _options$error[key], | ||
// @ts-expect-error | ||
constraint | ||
@@ -65,0 +64,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"main": "index.js", | ||
@@ -8,0 +8,0 @@ "module": "module/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17909
479