Skip to content

Commit 1ebcde0

Browse files
add unit tests
1 parent 395b590 commit 1ebcde0

2 files changed

Lines changed: 385 additions & 2 deletions

File tree

lib/translate/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Translate.prototype.detect = function(input, callback) {
156156
}
157157

158158
var results = resp.data.detections.map(function(detection, index) {
159-
var result = extend(detection[0], {
159+
var result = extend({}, detection[0], {
160160
input: input[index]
161161
});
162162

@@ -311,7 +311,7 @@ Translate.prototype.translate = function(input, options, callback) {
311311

312312
var translations = resp.data.translations.map(prop('translatedText'));
313313

314-
if (input.length === 1) {
314+
if (query.q.length === 1) {
315315
translations = translations[0];
316316
}
317317

0 commit comments

Comments
 (0)