@astral/validations 4.9.1 → 4.9.2
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.
@@ -5,10 +5,8 @@ export function createGuard(executor) {
|
|
5
5
|
const createInnerGuard = (defOptions = {}) => {
|
6
6
|
const guard = (value, prevCtx) => {
|
7
7
|
const actualDefOptions = Object.assign(Object.assign({}, defOptions), { isOptional: (prevCtx === null || prevCtx === void 0 ? void 0 : prevCtx.isOptional) || defOptions.isOptional });
|
8
|
-
const ctx = createContext(prevCtx,
|
9
|
-
|
10
|
-
value, {
|
11
|
-
lastSchemaValue: value,
|
8
|
+
const ctx = createContext(prevCtx, value, {
|
9
|
+
// данная конструкция останавливает погружение isOptional в последующие guard
|
12
10
|
isOptional: false,
|
13
11
|
});
|
14
12
|
const requiredResult = required({
|