File tree Expand file tree Collapse file tree
packages/contentstack-config/src/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,5 +4,5 @@ fileignoreconfig:
44 - filename: package-lock.json
55 checksum: 0982a352c260f7dd5bdde813104c2db8268abc489c791ec467b63eb8badb3cf1
66 - filename: packages/contentstack-config/src/utils/region-handler.ts
7- checksum: ae2df0d7570c11e28a3306bd3ef03ca0ec9e04b3b9b320d6ed50a1764459072c
7+ checksum: 7b36342fda136ce73bcbde45fba78a9fa8f58536abfd6bd48eff1e5d95d3be52
88version: '1.0'
Original file line number Diff line number Diff line change 11import { configHandler } from '@contentstack/cli-utilities' ;
22import { getContentstackEndpoint } from '@contentstack/utils' ;
3+ import { Region } from '../interfaces' ;
4+ interface RegionsMap {
5+ [ key : string ] : Region ;
6+ }
37
48function validURL ( str ) {
59 const pattern = new RegExp (
@@ -54,7 +58,7 @@ function getComposableStudioUrl(cmaUrl: string): string {
5458 * @param {string } regionKey - Region identifier
5559 * @returns {object } Region object with all necessary URLs
5660 */
57- function getRegionObject ( regionKey : string ) {
61+ function getRegionObject ( regionKey : string ) : Region {
5862 try {
5963 // getContentstackEndpoint handles all aliases defined in regions.json
6064 const endpoints = getContentstackEndpoint ( regionKey ) as any ;
@@ -96,7 +100,7 @@ function getAvailableRegions() {
96100 'GCP-EU' ,
97101 ] ;
98102
99- const regions : any = { } ;
103+ const regions : RegionsMap = { } ;
100104
101105 for ( const key of regionKeys ) {
102106 const regionObj = getRegionObject ( key ) ;
You can’t perform that action at this time.
0 commit comments