MCPcopy
hub / github.com/sequelize/sequelize / _customValidators

Method _customValidators

lib/instance-validator.js:161–176  ·  lib/instance-validator.js::InstanceValidator._customValidators

* Will run all the custom validators defined in the model's options. * * @returns {Promise<Array>} * @private

()

Source from the content-addressed store, hash-verified

159 * @private
160 */
161 async _customValidators() {
162 const validators = [];
163 _.each(this.modelInstance.constructor.options.validate, (validator, validatorType) => {
164 if (this.options.skip.includes(validatorType)) {
165 return;
166 }
167
168 const valprom = this._invokeCustomValidator(validator, validatorType)
169 class="cm">// errors are handled in settling, stub this
170 .catch(() => {});
171
172 validators.push(valprom);
173 });
174
175 return await Promise.all(validators);
176 }
177
178 /**
179 * Validate a single attribute with all the defined built-in validators and custom validators.

Callers 1

_validateMethod · 0.95

Calls 2

allMethod · 0.80

Tested by

no test coverage detected