MCPcopy Index your code
hub / github.com/dresende/node-orm2 / appendFunction

Function appendFunction

lib/AggregateFunctions.js:19–36  ·  view source on GitHub ↗
(fun)

Source from the content-addressed store, hash-verified

17 var used_distinct = false;
18
19 var appendFunction = function (fun) {
20 return function () {
21 var args = (arguments.length && Array.isArray(arguments[0]) ? arguments[0] : Array.prototype.slice.apply(arguments));
22
23 if (args.length > 0) {
24 aggregates[aggregates.length - 1].push({ f: fun, a: args, alias: aggregateAlias(fun, args) });
25 aggregates.push([]);
26 } else {
27 aggregates[aggregates.length - 1].push({ f: fun, alias: aggregateAlias(fun, args) });
28 }
29
30 if (fun === "distinct") {
31 used_distinct = true;
32 }
33
34 return proto;
35 };
36 };
37 var proto = {
38 groupBy: function () {
39 group_by = Array.prototype.slice.apply(arguments);

Callers

nothing calls this directly

Calls 1

aggregateAliasFunction · 0.85

Tested by

no test coverage detected