Comparing version 1.0.0-pre-62 to 1.0.0-pre-63
@@ -10,3 +10,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import { createValidator } from './'; | ||
import { createValidator, isDryvArrayValidator, isDryvObjectValidator, isDryvFieldValidator } from './'; | ||
import { dryvEditingObject, dryvValidationObject, observableObjectProxy } from './internal'; | ||
@@ -39,3 +39,8 @@ import { DryvComplexValidator } from './DryvComplexValidator'; | ||
} | ||
if (validator === undefined) { | ||
const isObject = typeof event.newValue === 'object'; | ||
const isArray = Array.isArray(event.newValue); | ||
if (validator === undefined || | ||
(isArray && !isDryvArrayValidator(validator)) || | ||
(isObject && !isDryvObjectValidator(validator)) || | ||
(!isObject && !isArray && !isDryvFieldValidator(validator))) { | ||
validator = createValidator(this, event.newValue, proxy, event.field, this.session, this.options); | ||
@@ -42,0 +47,0 @@ this.fields[event.field] = validator; |
@@ -1,2 +0,2 @@ | ||
import { DryvValidator, DryvFieldValidator, DryvComplexValidator, DryvObjectValidator, DryvValidationArray } from './.'; | ||
import { DryvValidator, DryvFieldValidator, DryvComplexValidator, DryvObjectValidator, DryvArrayValidator } from './.'; | ||
export declare function isDryvValidator(value: any | DryvValidator): value is DryvValidator; | ||
@@ -6,2 +6,2 @@ export declare function isDryvFieldValidator(value: any | DryvFieldValidator): value is DryvFieldValidator; | ||
export declare function isDryvObjectValidator(value: any | DryvObjectValidator): value is DryvObjectValidator; | ||
export declare function isDryvValidationArray(value: any | DryvValidationArray): value is DryvValidationArray; | ||
export declare function isDryvArrayValidator(value: any | DryvArrayValidator): value is DryvArrayValidator; |
@@ -13,5 +13,5 @@ export function isDryvValidator(value) { | ||
} | ||
export function isDryvValidationArray(value) { | ||
return value === null || value === void 0 ? void 0 : value.$isDryvValidationArray; | ||
export function isDryvArrayValidator(value) { | ||
return value === null || value === void 0 ? void 0 : value.$isDryvArrayValidator; | ||
} | ||
//# sourceMappingURL=type-checks.js.map |
{ | ||
"name": "dryvjs", | ||
"version": "1.0.0-pre-62", | ||
"version": "1.0.0-pre-63", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2
121814
101
1794