@@ -600,7 +600,6 @@ var Stack = function () {
600
600
this . config = _config2 . default ;
601
601
this . cachePolicy = _index2 . default . policies . IGNORE_CACHE ;
602
602
this . provider = _index2 . default . providers ( 'localstorage' ) ;
603
- console . error ( stack_arguments . length ) ;
604
603
605
604
switch ( stack_arguments . length ) {
606
605
case 1 :
@@ -632,39 +631,39 @@ var Stack = function () {
632
631
access_token : stack_arguments [ 1 ]
633
632
} ;
634
633
this . environment = stack_arguments [ 2 ] ;
635
- return this ;
636
634
} else {
637
635
console . error ( "Kindly provide valid string parameters." ) ;
638
636
}
639
637
if ( stack_arguments [ 3 ] ) {
640
638
if ( typeof stack_arguments [ 3 ] === "string" && stack_arguments [ 3 ] . region !== "us" && stack_arguments [ 3 ] . region === "eu" ) {
641
- _config2 . default [ 'host' ] = stack_arguments [ 0 ] . region + "-" + "cdn.contentstack.com" ;
639
+ _config2 . default [ 'host' ] = stack_arguments [ 3 ] + "-" + "cdn.contentstack.com" ;
642
640
} else if ( _typeof ( stack_arguments [ 3 ] ) === 'object' ) {
643
641
this . fetchOptions = stack_arguments [ 3 ] ;
644
642
}
645
643
}
644
+ return this ;
646
645
case 5 :
647
646
if ( typeof stack_arguments [ 0 ] === "string" && typeof stack_arguments [ 1 ] === "string" && typeof stack_arguments [ 2 ] === "string" ) {
648
647
this . headers = {
649
648
api_key : stack_arguments [ 0 ] ,
650
649
access_token : stack_arguments [ 1 ]
651
650
} ;
652
651
this . environment = stack_arguments [ 2 ] ;
653
- return this ;
654
652
} else {
655
653
console . error ( "Kindly provide valid string parameters." ) ;
656
654
}
655
+
657
656
if ( stack_arguments [ 3 ] ) {
658
- if ( typeof stack_arguments [ 3 ] === "string" && stack_arguments [ 3 ] . region !== "us" && stack_arguments [ 3 ] . region === "eu" ) {
659
- _config2 . default [ 'host' ] = stack_arguments [ 0 ] . region + "-" + "cdn.contentstack.com" ;
657
+ if ( typeof stack_arguments [ 3 ] === "string" && stack_arguments [ 3 ] . region !== "us" ) {
658
+ _config2 . default [ 'host' ] = stack_arguments [ 3 ] + "-" + "cdn.contentstack.com" ;
660
659
} else if ( _typeof ( stack_arguments [ 3 ] ) === 'object' ) {
661
660
this . fetchOptions = stack_arguments [ 3 ] ;
662
661
}
663
662
}
664
663
if ( stack_arguments [ 4 ] && _typeof ( stack_arguments [ 4 ] ) === 'object' ) {
665
- this . fetchOptions = stack_arguments [ 3 ] ;
664
+ this . fetchOptions = stack_arguments [ 4 ] ;
666
665
}
667
-
666
+ return this ;
668
667
default :
669
668
console . error ( "Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack." ) ;
670
669
}
@@ -1151,7 +1150,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
1151
1150
function _interopRequireWildcard ( obj ) { if ( obj && obj . __esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
1152
1151
1153
1152
//JS SDK version
1154
- var version = '3.9.0 ' ;
1153
+ var version = '3.9.1 ' ;
1155
1154
var environment = void 0 ,
1156
1155
api_key = void 0 ;
1157
1156
0 commit comments