MCPcopy
hub / github.com/sequelize/sequelize / validate

Method validate

src/data-types.js:71–79  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

69 ]);
70 }
71 validate(value) {
72 if (Object.prototype.toString.call(value) !== '[object String]') {
73 if (this.options.binary && Buffer.isBuffer(value) || typeof value === 'number') {
74 return true;
75 }
76 throw new sequelizeErrors.ValidationError(util.format('%j is not a valid string', value));
77 }
78 return true;
79 }
80
81 get BINARY() {
82 this._binary = true;

Callers

nothing calls this directly

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected