Skip to content

Commit

Permalink
style: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Mar 20, 2024
1 parent 2edf2ff commit aabddf4
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -2932,14 +2932,19 @@ Document.prototype.$__validate = function(pathsToValidate, options, callback) {
const validated = {};
let total = 0;

for (const path of paths) {
if (
Array.isArray(_this.$__.saveOptions?.pathsToSave) &&
_this.$__.saveOptions.pathsToSave.includes(path) === false
) {
continue;
let pathsToSave = this.$__.saveOptions?.pathsToSave;
if (Array.isArray(pathsToSave)) {
pathsToSave = new Set(pathsToSave);
for (const path of paths) {
if (!pathsToSave.has(path)) {
continue;
}
validatePath(path);
}
} else {
for (const path of paths) {
validatePath(path);
}
validatePath(path);
}

function validatePath(path) {
Expand Down

0 comments on commit aabddf4

Please sign in to comment.