1

Fixing JavaScript warnings, returning review ID with records

This commit is contained in:
Alex Yatskov 2014-10-17 18:07:06 +09:00
parent ad2f02e3af
commit 4ba4799083

View File

@ -1,3 +1,5 @@
#!/usr/bin/env node
/* /*
The MIT License (MIT) The MIT License (MIT)
@ -63,8 +65,8 @@ function add(values1, values2) {
function combine(dict, params) { function combine(dict, params) {
var result = {}; var result = {};
for (var key in params) { for (var paramIter in params) {
var values = scale(dict[key], params[key]); var values = scale(dict[paramIter], params[paramIter]);
result = add(values, result); result = add(values, result);
} }
@ -73,8 +75,8 @@ function combine(dict, params) {
}); });
if (max > 0.0) { if (max > 0.0) {
for (var key in result) { for (var resultIter in result) {
result[key] = result[key] / max; result[resultIter] = result[resultIter] / max;
} }
} }
@ -242,6 +244,7 @@ function getRecords(callback) {
var records = _.map(rows, function(row) { var records = _.map(rows, function(row) {
return { return {
name: row.name, name: row.name,
id: row.id,
relativeUrl: row.url, relativeUrl: row.url,
rating: { rating: {
food: row.food, food: row.food,
@ -290,7 +293,7 @@ function execQuery(query, callback) {
value: query.searchParams[keyword], value: query.searchParams[keyword],
hints: searchHints, hints: searchHints,
steps: query.hintSteps steps: query.hintSteps
} };
} }
callback({ callback({