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