Skip to content

Commit 9072557

Browse files
authored
Merge pull request #32 from contentstack/automation
Stack instance issue resolved
2 parents c9cd565 + 37f486c commit 9072557

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

dist/nativescript/contentstack.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ var Stack = function () {
600600
this.config = _config2.default;
601601
this.cachePolicy = _index2.default.policies.IGNORE_CACHE;
602602
this.provider = _index2.default.providers('localstorage');
603-
console.error(stack_arguments.length);
604603

605604
switch (stack_arguments.length) {
606605
case 1:
@@ -632,39 +631,39 @@ var Stack = function () {
632631
access_token: stack_arguments[1]
633632
};
634633
this.environment = stack_arguments[2];
635-
return this;
636634
} else {
637635
console.error("Kindly provide valid string parameters.");
638636
}
639637
if (stack_arguments[3]) {
640638
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";
642640
} else if (_typeof(stack_arguments[3]) === 'object') {
643641
this.fetchOptions = stack_arguments[3];
644642
}
645643
}
644+
return this;
646645
case 5:
647646
if (typeof stack_arguments[0] === "string" && typeof stack_arguments[1] === "string" && typeof stack_arguments[2] === "string") {
648647
this.headers = {
649648
api_key: stack_arguments[0],
650649
access_token: stack_arguments[1]
651650
};
652651
this.environment = stack_arguments[2];
653-
return this;
654652
} else {
655653
console.error("Kindly provide valid string parameters.");
656654
}
655+
657656
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";
660659
} else if (_typeof(stack_arguments[3]) === 'object') {
661660
this.fetchOptions = stack_arguments[3];
662661
}
663662
}
664663
if (stack_arguments[4] && _typeof(stack_arguments[4]) === 'object') {
665-
this.fetchOptions = stack_arguments[3];
664+
this.fetchOptions = stack_arguments[4];
666665
}
667-
666+
return this;
668667
default:
669668
console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.");
670669
}
@@ -1151,7 +1150,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11511150
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; } }
11521151

11531152
//JS SDK version
1154-
var version = '3.9.0';
1153+
var version = '3.9.1';
11551154
var environment = void 0,
11561155
api_key = void 0;
11571156

dist/react-native/contentstack.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ var Stack = function () {
600600
this.config = _config2.default;
601601
this.cachePolicy = _index2.default.policies.IGNORE_CACHE;
602602
this.provider = _index2.default.providers('localstorage');
603-
console.error(stack_arguments.length);
604603

605604
switch (stack_arguments.length) {
606605
case 1:
@@ -632,39 +631,39 @@ var Stack = function () {
632631
access_token: stack_arguments[1]
633632
};
634633
this.environment = stack_arguments[2];
635-
return this;
636634
} else {
637635
console.error("Kindly provide valid string parameters.");
638636
}
639637
if (stack_arguments[3]) {
640638
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";
642640
} else if (_typeof(stack_arguments[3]) === 'object') {
643641
this.fetchOptions = stack_arguments[3];
644642
}
645643
}
644+
return this;
646645
case 5:
647646
if (typeof stack_arguments[0] === "string" && typeof stack_arguments[1] === "string" && typeof stack_arguments[2] === "string") {
648647
this.headers = {
649648
api_key: stack_arguments[0],
650649
access_token: stack_arguments[1]
651650
};
652651
this.environment = stack_arguments[2];
653-
return this;
654652
} else {
655653
console.error("Kindly provide valid string parameters.");
656654
}
655+
657656
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";
660659
} else if (_typeof(stack_arguments[3]) === 'object') {
661660
this.fetchOptions = stack_arguments[3];
662661
}
663662
}
664663
if (stack_arguments[4] && _typeof(stack_arguments[4]) === 'object') {
665-
this.fetchOptions = stack_arguments[3];
664+
this.fetchOptions = stack_arguments[4];
666665
}
667-
666+
return this;
668667
default:
669668
console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.");
670669
}
@@ -1151,7 +1150,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11511150
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; } }
11521151

11531152
//JS SDK version
1154-
var version = '3.9.0';
1153+
var version = '3.9.1';
11551154
var environment = void 0,
11561155
api_key = void 0;
11571156

0 commit comments

Comments
 (0)