Merge pull request #190 from strongloop/feature/handle-connector-without-types
datasource: support connectors without `getTypes`
This commit is contained in:
commit
27add4ce0b
|
@ -647,7 +647,8 @@ DataSource.prototype.getModelDefinition = function (name) {
|
|||
* ['rest'], or ['db', 'rdbms', 'mysql']
|
||||
*/
|
||||
DataSource.prototype.getTypes = function () {
|
||||
var types = this.connector && this.connector.getTypes() || [];
|
||||
var getTypes = this.connector && this.connector.getTypes;
|
||||
var types = getTypes && getTypes() || [];
|
||||
if (typeof types === 'string') {
|
||||
types = types.split(/[\s,\/]+/);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue