MCPcopy Index your code
hub / github.com/sequelize/sequelize / normalizeDataType

Method normalizeDataType

src/sequelize.js:1297–1315  ·  view source on GitHub ↗
(Type)

Source from the content-addressed store, hash-verified

1295 }
1296
1297 normalizeDataType(Type) {
1298 let type = typeof Type === 'function' ? new Type() : Type;
1299 const dialectTypes = this.dialect.DataTypes || {};
1300
1301 if (dialectTypes[type.key]) {
1302 type = dialectTypes[type.key].extend(type);
1303 }
1304
1305 if (type instanceof DataTypes.ARRAY) {
1306 if (!type.type) {
1307 throw new Error('ARRAY is missing type definition for its values.');
1308 }
1309 if (dialectTypes[type.type.key]) {
1310 type.type = dialectTypes[type.type.key].extend(type.type);
1311 }
1312 }
1313
1314 return type;
1315 }
1316
1317 normalizeAttribute(attribute) {
1318 if (!_.isPlainObject(attribute)) {

Callers 5

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

Calls 1

extendMethod · 0.80

Tested by 1

testsqlFunction · 0.64