diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-04-08 19:56:21 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-04-08 19:56:21 -0400 |
| commit | fe1ea91f73059c146369ccb2404fcaf6d03d2f4d (patch) | |
| tree | 9b8c5e37821e147048e5d1ddbe5435af47716949 /app/node_modules/okutil/index.js | |
| parent | 0c6d7edc0042464c8f05d38e6933186719dd259e (diff) | |
| parent | 32f87fcb58466e0e311349f96751c18e2a2cd7ea (diff) | |
k
Diffstat (limited to 'app/node_modules/okutil/index.js')
| -rw-r--r-- | app/node_modules/okutil/index.js | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/app/node_modules/okutil/index.js b/app/node_modules/okutil/index.js index 738c6a4..3142ae1 100644 --- a/app/node_modules/okutil/index.js +++ b/app/node_modules/okutil/index.js @@ -10,35 +10,6 @@ var Q = require('q'); module.exports = { /** - * Takes a meta data query and an array of resource queries - * and returns a promise for an object merging all queried - * data, pluralizing keys where necessary. - * - * Lil bit convoluted, sorry. - */ - fetchTemplateData: function fetchTemplateData(meta, queries, options) { - return Q.promise(function(resolve, reject) { - return Q.all( - [meta.get()].concat(queries.map(function(query) { - return query.get(options); - }))) - .then(function(results) { - var metadata = results.shift(); - var normalized = results.reduce(function(data, result, i) { - var type = queries[i].type; - if (isarray(result)) { - data[pluralize(type)] = result; - } else { - data[type] = result; - } - return data; - }, {meta: metadata}); - resolve(normalized); - }, reject); - }); - }, - - /** * Return a copy of the route with a trailing slash */ withTrailingSlash: function withTrailingSlash(route) { |
