-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify function doc samples #717
Conversation
functions/http/index.js
Outdated
@@ -23,14 +23,14 @@ | |||
* @param {Object} res ExpressJS object containing the HTTP response to send. | |||
*/ | |||
exports.helloWorld = (req, res) => { | |||
if (req.body.message === undefined) { | |||
if (req.body.message) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing an !
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
functions/http/index.js
Outdated
name = req.body.name; | ||
break; | ||
|
||
let name = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmdobry @MylesBorins I like this pattern - is it sufficiently idiomatic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
functions/http/index.js
Outdated
|
||
res.status(200).send(`Hello ${name || 'World'}!`); | ||
}; | ||
// [END functions_http_content] | ||
|
||
// [START functions_http_method] | ||
function handleGET (req, res) { | ||
function handleGET(req, res) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this. This is enforced by our linter (semistandard
).
I'll have to fix the lint errors. |
I'm not sure exactly how to debug the failing tests, and this PR is only a stylistic change, so I'll close it. There's something failing here:
|
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]>
=== undefined