Skip to content

Add Node version clarification comments #822

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

Merged
merged 3 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion functions/imagemagick/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const client = new vision.ImageAnnotatorClient();
// [START functions_imagemagick_analyze]
// Blurs uploaded images that are flagged as Adult or Violence.
exports.blurOffensiveImages = (event) => {
const object = event.data || event;
const object = event.data || event; // Node 6: event.data === Node 8+: event

// Exit if this is a deletion or a deploy event.
if (object.resourceState === 'not_exists') {
Expand Down
3 changes: 2 additions & 1 deletion functions/log/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ function getMetrics (callback) {

// [START functions_log_stackdriver]
exports.processLogEntry = (data) => {
// Node 6: data.data === Node 8+: data
const dataBuffer = Buffer.from(data.data.data || data.data, 'base64');
const logEntry = JSON.parse(dataBuffer.toString('ascii')).protoPayload;

const logEntry = JSON.parse(dataBuffer.toString('ascii')).protoPayload;
console.log(`Method: ${logEntry.methodName}`);
console.log(`Resource: ${logEntry.resourceName}`);
console.log(`Initiator: ${logEntry.authenticationInfo.principalEmail}`);
Expand Down