| 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)) { |