@@ -9,26 +9,24 @@ import {ISequelizeAssociation} from "../../interfaces/ISequelizeAssociation";
99
1010export class Sequelize extends OriginSequelize implements BaseSequelize {
1111
12- throughMap : { [ through : string ] : any } = { } ;
13- _ : { [ modelName : string ] : typeof Model } = { } ;
12+ throughMap : { [ through : string ] : any } ;
13+ _ : { [ modelName : string ] : typeof Model } ;
1414 init : ( config : SequelizeConfig ) => void ;
1515 addModels : ( models : Array < typeof Model > | string [ ] ) => void ;
1616 associateModels : ( models : Array < typeof Model > ) => void ;
1717
1818 constructor ( config : SequelizeConfig | string ) {
19-
20- super (
21- ( typeof config === "string" ) ?
22- config : // URI string
23- BaseSequelize . isISequelizeUriConfig ( config ) ?
24- config . uri : // URI string from ISequelizeUriConfig
25- BaseSequelize . prepareConfig ( config ) // Config object (ISequelizeConfig)
26- ) ;
27-
28- if ( BaseSequelize . isISequelizeUriConfig ( config ) ) {
29- this . options = { ...this . options , ...config } ;
19+ if ( typeof config === "string" ) {
20+ super ( config ) ;
21+ } else if ( BaseSequelize . isISequelizeUriConfig ( config ) ) {
22+ super ( config . url , config ) ;
23+ } else {
24+ super ( BaseSequelize . prepareConfig ( config ) ) ;
3025 }
3126
27+ this . throughMap = { } ;
28+ this . _ = { } ;
29+
3230 if ( typeof config !== "string" ) {
3331 this . init ( config ) ;
3432 }
@@ -44,7 +42,8 @@ export class Sequelize extends OriginSequelize implements BaseSequelize {
4442 return Through ;
4543 }
4644
47- adjustAssociation ( model : any , association : ISequelizeAssociation ) : void { }
45+ adjustAssociation ( model : any , association : ISequelizeAssociation ) : void {
46+ }
4847
4948 /**
5049 * Creates sequelize models and registers these models
0 commit comments