Skip to content

Commit 58778bd

Browse files
renovate[bot]fhinkel
authored andcommitted
fix(deps): update dependency @google-cloud/translate to v2 (#961)
1 parent 1338cd8 commit 58778bd

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

functions/ocr/app/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ const storage = require('@google-cloud/storage')();
2626
// Get a reference to the Cloud Vision API component
2727
const vision = require('@google-cloud/vision')();
2828
// Get a reference to the Translate API component
29-
const translate = require('@google-cloud/translate')();
29+
const {Translate} = require('@google-cloud/translate');
30+
const translate = new Translate();
3031

3132
const Buffer = require('safe-buffer').Buffer;
3233
// [END functions_ocr_setup]

functions/ocr/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"@google-cloud/pubsub": "0.22.2",
1919
"@google-cloud/storage": "1.7.0",
20-
"@google-cloud/translate": "1.0.0",
20+
"@google-cloud/translate": "2.1.3",
2121
"@google-cloud/vision": "0.23.0",
2222
"safe-buffer": "5.1.2"
2323
},

functions/ocr/app/test/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function getSample() {
6868

6969
return {
7070
program: proxyquire(`../`, {
71-
'@google-cloud/translate': TranslateMock,
71+
'@google-cloud/translate': {Translate: TranslateMock},
7272
'@google-cloud/vision': VisionMock,
7373
'@google-cloud/pubsub': {PubSub: PubsubMock},
7474
'@google-cloud/storage': StorageMock,

0 commit comments

Comments
 (0)