Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1
# Changelog | ||
## [2.0.0-alpha.0] - 2022-09-02 | ||
## [2.0.0-alpha.x] - 2022-09-02 | ||
@@ -5,0 +5,0 @@ ### Added |
@@ -41,5 +41,2 @@ "use strict"; | ||
} | ||
if (validatorOptions.shouldRemoveUnknownKeys) { | ||
validatorOptions.inoutUnknownKeysByPath[path] = 'allow-all'; | ||
} | ||
let errorResult; | ||
@@ -55,2 +52,14 @@ let valueKeys; | ||
} | ||
let unknownKeysSet; | ||
if (validatorOptions.shouldRemoveUnknownKeys) { | ||
const unknownKeys = validatorOptions.inoutUnknownKeysByPath[path]; | ||
if (unknownKeys === undefined) { | ||
// If this path hasn't been examined before | ||
unknownKeysSet = new Set(valueKeys); | ||
validatorOptions.inoutUnknownKeysByPath[path] = unknownKeysSet; | ||
} | ||
else if (unknownKeys instanceof Set) { | ||
unknownKeysSet = unknownKeys; | ||
} | ||
} | ||
for (const valueKey of valueKeys) { | ||
@@ -62,2 +71,5 @@ if (keys instanceof RegExp) { | ||
} | ||
else { | ||
unknownKeysSet === null || unknownKeysSet === void 0 ? void 0 : unknownKeysSet.delete(valueKey); | ||
} | ||
} | ||
@@ -70,2 +82,5 @@ else { | ||
} | ||
else { | ||
unknownKeysSet === null || unknownKeysSet === void 0 ? void 0 : unknownKeysSet.delete(valueKey); | ||
} | ||
} | ||
@@ -72,0 +87,0 @@ const result = valueSchema.internalValidate( |
{ | ||
"name": "yaschema", | ||
"version": "2.0.0-alpha.0", | ||
"version": "2.0.0-alpha.1", | ||
"description": "Yet another schema", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
379956
4125