diff --git a/lib/prototypes/abstract.js b/lib/prototypes/abstract.js index 2e8e72a..cf485f4 100644 --- a/lib/prototypes/abstract.js +++ b/lib/prototypes/abstract.js @@ -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 diff --git a/lib/struct.js b/lib/struct.js index 0bfada5..9742e17 100644 --- a/lib/struct.js +++ b/lib/struct.js @@ -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) : [];