Skip to content

Commit

Permalink
added private for commonCheck method
Browse files Browse the repository at this point in the history
  • Loading branch information
Bespaliy committed Dec 6, 2023
1 parent d071ca6 commit 44e8756
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/prototypes/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class AbstractType {
}

check(value, path) {
return this.commonCheck(value, path, false);
return this.#commonCheck(value, path, false);
}

partialCheck(value, path) {
return this.commonCheck(value, path, true);
return this.#commonCheck(value, path, true);
}

commonCheck(value, path, isPartial) {
#commonCheck(value, path, isPartial) {
const result = new ValidationResult(path);
const isEmpty = value === null || value === undefined;
const isRequiredAndMissing = !isPartial
Expand Down
6 changes: 3 additions & 3 deletions lib/struct.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ class Struct {
}

check(source, path = '') {
return this.commonCheck(source, path, false);
return this.#commonCheck(source, path, false);
}

partialCheck(source, path = '') {
return this.commonCheck(source, path, true);
return this.#commonCheck(source, path, true);
}

commonCheck(source, path, isPartial) {
#commonCheck(source, path, isPartial) {
const result = new ValidationResult(path || this.name);
const keys = Object.keys(source);
const fields = !isPartial ? Object.keys(this) : [];
Expand Down

0 comments on commit 44e8756

Please sign in to comment.