Skip to content

Commit f02e277

Browse files
authored
Merge pull request #107 from serverless/replace-inlcudes-usages
Replace includes usages to support older Node.js versions
2 parents 43c9509 + 1b76cb4 commit f02e277

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

provider/googleProvider.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class GoogleProvider {
5151
return filArgs.reduce(((p, c) => p[c]), this.sdk).bind(serviceInstance)(requestParams)
5252
.then(result => result.data)
5353
.catch((error) => {
54-
if (error && error.errors && error.errors[0].message && error.errors[0].message.includes('project 1043443644444')) {
54+
if (error && error.errors && error.errors[0].message && _.includes(error.errors[0].message, 'project 1043443644444')) {
5555
throw new Error("Incorrect configuration. Please change the 'project' key in the 'provider' block in your Serverless config file.");
5656
} else if (error) {
5757
throw error;
@@ -77,7 +77,7 @@ class GoogleProvider {
7777
}
7878

7979
isServiceSupported(service) {
80-
if (!Object.keys(this.sdk).includes(service)) {
80+
if (!_.includes(Object.keys(this.sdk), service)) {
8181
const errorMessage = [
8282
`Unsupported service API "${service}".`,
8383
` Supported service APIs are: ${Object.keys(this.sdk).join(', ')}`,

shared/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = {
3838
const functions = this.serverless.service.functions;
3939

4040
_.forEach(functions, (funcVal, funcKey) => {
41-
if (funcVal.handler.includes('/') || funcVal.handler.includes('.')) {
41+
if (_.includes(funcVal.handler, '/') || _.includes(funcVal.handler, '.')) {
4242
const errorMessage = [
4343
`The "handler" property for the function "${funcKey}" is invalid.`,
4444
' Handlers should be plain strings referencing only the exported function name',

0 commit comments

Comments
 (0)