Comparing version 1.0.0-pre-0 to 1.0.0-pre-1
import type { DryvOptions, DryvProxy } from './typings'; | ||
import type { DryvValidationSession } from './typings'; | ||
export declare function dryvProxy<TModel extends object>(model: TModel | DryvProxy<TModel>, field: keyof TModel | undefined, session: DryvValidationSession<TModel> | undefined, options?: DryvOptions): DryvProxy<TModel>; | ||
export declare function dryvProxy<TModel extends object>(model: TModel | DryvProxy<TModel>, field: keyof TModel | undefined, session: DryvValidationSession<TModel>, options?: DryvOptions): DryvProxy<TModel>; |
import type { DryvOptions } from './typings'; | ||
import type { DryvValidationSession } from './typings'; | ||
export declare function dryvProxyHandler<TModel extends object>(field: keyof TModel | undefined, session: DryvValidationSession<TModel> | undefined, options: DryvOptions): ProxyHandler<TModel>; | ||
export declare function dryvProxyHandler<TModel extends object>(field: keyof TModel | undefined, session: DryvValidationSession<TModel>, options: DryvOptions): ProxyHandler<TModel>; |
@@ -21,3 +21,3 @@ import { dryvProxy, isDryvProxy } from '.'; | ||
if (typeof originalValue === 'object') { | ||
resultValue = ensureObjectProxy(originalValue, field, receiver); | ||
resultValue = ensureObjectProxy(originalValue, field, receiver, session); | ||
if (resultValue !== originalValue) { | ||
@@ -52,3 +52,3 @@ Reflect.set(target, fieldName, resultValue); | ||
if (typeof value === 'object') { | ||
targetValue = ensureObjectProxy(value, field, receiver); | ||
targetValue = ensureObjectProxy(value, field, receiver, session); | ||
} | ||
@@ -64,5 +64,5 @@ else { | ||
}; | ||
function ensureObjectProxy(value, field, receiver) { | ||
function ensureObjectProxy(value, field, receiver, session) { | ||
const proxy = !isDryvProxy(value) | ||
? dryvProxy(value, field, undefined, options) | ||
? dryvProxy(value, field, session, options) | ||
: value; | ||
@@ -69,0 +69,0 @@ const dryv = getDryv(receiver); |
@@ -16,4 +16,4 @@ export type DryvValidateFunctionResult = DryvFieldValidationResult | string | null | undefined | Promise<DryvFieldValidationResult | string | null | undefined>; | ||
validators: DrvvRuleInvocations<TModel>; | ||
disablers: DrvvRuleInvocations<TModel>; | ||
parameters: TParameters; | ||
disablers?: DrvvRuleInvocations<TModel>; | ||
parameters?: TParameters; | ||
} | ||
@@ -20,0 +20,0 @@ export interface DryvValidationRuleSetResolver { |
@@ -1,2 +0,2 @@ | ||
import type { DryvOptions } from '../core/typings'; | ||
import { DryvOptions } from '../core'; | ||
export interface DryTransaction<TModel extends object = any> { | ||
@@ -3,0 +3,0 @@ rollback: () => void; |
@@ -1,2 +0,2 @@ | ||
import { defaultDryvOptions } from '../core/defaultDryvOptions'; | ||
import { defaultDryvOptions } from '../core'; | ||
export function dryvTransaction(model, options) { | ||
@@ -3,0 +3,0 @@ options = Object.assign(defaultDryvOptions, options); |
{ | ||
"name": "dryvjs", | ||
"version": "1.0.0-pre-0", | ||
"version": "1.0.0-pre-1", | ||
"main": "dist/index.js", | ||
@@ -27,2 +27,2 @@ "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
59507