Comparing version 1.0.0-pre-34 to 1.0.0-pre-35
@@ -22,5 +22,4 @@ import { isDryvValidatable } from './'; | ||
var _a, _b; | ||
console.log('***', validatable.path); | ||
validatable.required = !!((_b = (_a = ruleSet.validators) === null || _a === void 0 ? void 0 : _a[validatable.path]) === null || _b === void 0 ? void 0 : _b.find((rule) => { var _a; return (_a = rule.annotations) === null || _a === void 0 ? void 0 : _a.required; })); | ||
} | ||
//# sourceMappingURL=annotate.js.map |
@@ -15,3 +15,3 @@ import { dryvProxy, isDryvProxy } from '.'; | ||
this._validatable = null; | ||
this._values = {}; | ||
this._values = options.objectWrapper({}); | ||
} | ||
@@ -18,0 +18,0 @@ get(target, fieldSymbol, receiver) { |
@@ -190,3 +190,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
if (!field) { | ||
model[relatedField] = null; | ||
return; | ||
} | ||
@@ -193,0 +193,0 @@ session.validateField(field, model); |
@@ -1,1 +0,1 @@ | ||
export declare function getMemberByPath<TModel extends object, TResult = any>(obj: TModel, path: string | symbol): TResult | TModel; | ||
export declare function getMemberByPath<TModel extends object, TResult = any>(obj: TModel, path: string): TResult | TModel | null; |
@@ -6,7 +6,7 @@ export function getMemberByPath(obj, path) { | ||
let result = obj; | ||
for (const part of String(path).split('.')) { | ||
if (result == null) { | ||
return result; | ||
for (const part of path.split('.')) { | ||
result = result[part]; | ||
if (result === null) { | ||
return null; | ||
} | ||
result = result[part]; | ||
} | ||
@@ -13,0 +13,0 @@ return result; |
@@ -6,5 +6,5 @@ export type DryvValidateFunctionResult = DryvFieldValidationResult | string | null | undefined | Promise<DryvFieldValidationResult | string | null | undefined>; | ||
required?: boolean; | ||
[path: string | symbol]: unknown; | ||
[path: string]: unknown; | ||
}; | ||
related?: (string | symbol)[]; | ||
related?: string[]; | ||
group?: string; | ||
@@ -11,0 +11,0 @@ validate: ($m: TModel, session: DryvValidationSession<TModel>) => DryvValidateFunctionResult; |
{ | ||
"name": "dryvjs", | ||
"version": "1.0.0-pre-34", | ||
"version": "1.0.0-pre-35", | ||
"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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
83020
1118