diff --git a/lib/plugins/aws/package/compile/events/cognitoUserPool/index.js b/lib/plugins/aws/package/compile/events/cognitoUserPool/index.js index 5d99d9d28b7..38622228b7a 100644 --- a/lib/plugins/aws/package/compile/events/cognitoUserPool/index.js +++ b/lib/plugins/aws/package/compile/events/cognitoUserPool/index.js @@ -49,9 +49,9 @@ class AwsCompileCognitoUserPoolEvents { // Generate CloudFormation templates for Cognito User Pool changes _.forEach(userPools, poolName => { - const currentPoolTriggerFunctions = _.filter(cognitoUserPoolTriggerFunctions, { - poolName, - }); + const currentPoolTriggerFunctions = cognitoUserPoolTriggerFunctions.filter( + triggerFn => triggerFn.poolName === poolName + ); const userPoolCFResource = this.generateTemplateForPool( poolName, currentPoolTriggerFunctions @@ -348,7 +348,9 @@ class AwsCompileCognitoUserPoolEvents { const userPools = result.userPools; _.forEach(userPools, poolName => { - const currentPoolTriggerFunctions = _.filter(cognitoUserPoolTriggerFunctions, { poolName }); + const currentPoolTriggerFunctions = cognitoUserPoolTriggerFunctions.filter( + triggerFn => triggerFn.poolName === poolName + ); const userPoolLogicalId = this.provider.naming.getCognitoUserPoolLogicalId(poolName); // If overrides exist in `Resources`, merge them in diff --git a/lib/plugins/package/lib/zipService.js b/lib/plugins/package/lib/zipService.js index de08b5ba4af..ef71bc613fb 100644 --- a/lib/plugins/package/lib/zipService.js +++ b/lib/plugins/package/lib/zipService.js @@ -168,7 +168,7 @@ function excludeNodeDevDependencies(servicePath) { ); // filter out non node_modules file paths - const packageJsonPaths = _.filter(packageJsonFilePaths, filePath => { + const packageJsonPaths = packageJsonFilePaths.filter(filePath => { const isNodeModulesDir = !!filePath.match(/node_modules/); return !isNodeModulesDir; });