endpoints-controller
Advanced tools
Comparing version 0.1.3 to 0.1.4
module.exports = function (req, res) { | ||
var output = req.output; | ||
var result; | ||
if (!req) { | ||
@@ -8,9 +9,17 @@ res.send(404); | ||
if(Array.isArray(output)) { | ||
res.json(output.map(function (item) { | ||
return item.serialize(); | ||
})); | ||
result = output.map(function (item) { | ||
if (item.serialize) { | ||
return item.serialize(); | ||
} | ||
return item; | ||
}); | ||
} else { | ||
res.json(output.serialize()); | ||
if (output.serialize) { | ||
result = output.serialize(); | ||
} else { | ||
result = output; | ||
} | ||
} | ||
res.json(result); | ||
} | ||
}; |
{ | ||
"name": "endpoints-controller", | ||
"description": "controller layer for the endpoints framework.", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"homepage": "https://github.com/endpoints/controller", | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7137
162