Skip to content

Commit e0f283b

Browse files
committed
Reworked endpoint logic for readability
1 parent 3ff604a commit e0f283b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/globals.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ export default class Globals {
6868
}
6969

7070
public static getServiceEndpoint (service: string) {
71-
if (!Globals.serverless.providers.aws.sdk) return null;
72-
const config = Globals.serverless.providers.aws.sdk.config;
73-
return config[service].endpoint || null;
71+
if (Globals.serverless.providers.aws.sdk) {
72+
const serviceConf = Globals.serverless.providers.aws.sdk.config[service];
73+
return serviceConf.endpoint || null;
74+
}
75+
return null;
7476
}
7577

7678
public static getRegion () {

0 commit comments

Comments
 (0)