diff --git a/naming.js b/naming.js index 4fd281b..f68f8dc 100644 --- a/naming.js +++ b/naming.js @@ -49,7 +49,7 @@ module.exports = { const self = this var logGroup _.forEach(self.provider.serverless.service.functions, (functionObj, name) => { - if (JSON.stringify(functionName).includes(name + '"') || JSON.stringify(functionName).includes(name + '-')) { + if (new RegExp(`(-|^)${name}(-|$)`).test(functionName)) { logGroup = this._getMappings(name).logGroup return false }