refactor: Replace _.toUpper(string) with string.toUpperCase (#7808)

This commit is contained in:
Wing-Kam 2020-06-03 20:39:49 +08:00 committed by GitHub
parent b5feb2ff67
commit 22a4ed27e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -220,9 +220,9 @@ class Utils {
if (_.has(event, 'http.authorizer')) {
if (
(_.isString(event.http.authorizer) &&
_.toUpper(event.http.authorizer) === 'AWS_IAM') ||
event.http.authorizer.toUpperCase() === 'AWS_IAM') ||
(event.http.authorizer.type &&
_.toUpper(event.http.authorizer.type) === 'AWS_IAM')
event.http.authorizer.type.toUpperCase() === 'AWS_IAM')
) {
hasIAMAuthorizer = true;
}
@ -235,7 +235,7 @@ class Utils {
if (
(_.isString(event.http.authorizer) &&
_.toUpper(event.http.authorizer) !== 'AWS_IAM' &&
event.http.authorizer.toUpperCase() !== 'AWS_IAM' &&
!awsArnRegExs.cognitoIdpArnExpr.test(event.http.authorizer)) ||
event.http.authorizer.name ||
(event.http.authorizer.arn &&

View File

@ -82,9 +82,10 @@ module.exports = {
},
});
} else if (type === 'HTTP' || type === 'HTTP_PROXY') {
const integrationHttpMethod = (http.request && http.request.method) || http.method;
Object.assign(integration, {
Uri: http.request && http.request.uri,
IntegrationHttpMethod: _.toUpper((http.request && http.request.method) || http.method),
IntegrationHttpMethod: integrationHttpMethod.toUpperCase(),
});
if (http.connectionType) {
Object.assign(integration, {