MCPcopy Index your code
hub / github.com/bitnbytesio/node-input-validator / check

Method check

lib/validator.js:154–175  ·  view source on GitHub ↗

* validate inputs * @returns {Promise. }

()

Source from the content-addressed store, hash-verified

152 * @returns {Promise.<boolean>}
153 */
154 async check() {
155
156
157 let validations = [];
158
159 //console.log(this.validations);
160
161 for (let i in this.validations) {
162 //console.log('check method index', i, this.validations[i]);
163 validations.push(await this.evaluateField(this.validations[i]));
164 }
165
166 for (let j in this.postValidations) {
167 validations.push(await this.evaluateInput(this.postValidations[j]));
168 }
169
170 if (validations.length) {
171 await validations;
172 }
173
174 return (this.errors && Object.keys(this.errors) && Object.keys(this.errors).length) ? false : true;
175 }
176
177 /**
178 * validate input against rule

Callers 15

failsMethod · 0.95
pattern.jsFile · 0.80
multiple-rules.jsFile · 0.80
crashes.jsFile · 0.80
custom.jsFile · 0.80
conditions.jsFile · 0.80
numbers.jsFile · 0.80
custom-messages.jsFile · 0.80
date.jsFile · 0.80
edge.jsFile · 0.80
required-rules.jsFile · 0.80

Calls 2

evaluateFieldMethod · 0.95
evaluateInputMethod · 0.95

Tested by

no test coverage detected