MCPcopy
hub / github.com/sequelize/sequelize / normalizeDataType

Method normalizeDataType

lib/sequelize.js:1215–1233  ·  lib/sequelize.js::Sequelize.normalizeDataType
(Type)

Source from the content-addressed store, hash-verified

1213 }
1214
1215 normalizeDataType(Type) {
1216 let type = typeof Type === class="st">'function' ? new Type() : Type;
1217 const dialectTypes = this.dialect.DataTypes || {};
1218
1219 if (dialectTypes[type.key]) {
1220 type = dialectTypes[type.key].extend(type);
1221 }
1222
1223 if (type instanceof DataTypes.ARRAY) {
1224 if (!type.type) {
1225 throw new Error(class="st">'ARRAY is missing type definition for its values.');
1226 }
1227 if (dialectTypes[type.type.key]) {
1228 type.type = dialectTypes[type.type.key].extend(type.type);
1229 }
1230 }
1231
1232 return type;
1233 }
1234
1235 normalizeAttribute(attribute) {
1236 if (!_.isPlainObject(attribute)) {

Callers 5

normalizeAttributeMethod · 0.95
refreshAttributesMethod · 0.80
aggregateMethod · 0.80
testsqlFunction · 0.80

Calls 1

extendMethod · 0.80

Tested by 1

testsqlFunction · 0.64