How to use the comb.merge function in comb

To help you get started, we’ve selected a few comb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github C2FO / hare / test / helper.js View on Github external
function addCall(name, cb) {
        return function () {
            if (name in stats) {
                stats[name].push(comb(arguments).toArray());
            } else {
                stats[name] = [comb(arguments).toArray()];
            }
            return cb.apply(this, arguments);
        }
    }

    for (var key in proto) {
        proto[key] = addCall(key, proto[key]);
    }

    return comb.merge({
        reset: function reset() {
            stats = {};
        },

        calledWith: function (name, args) {
            return stats[name].some(function (called) {
                return JSON.stringify(called) === JSON.stringify(args);
            });
        },

        getCallCount: function (name) {
            return (stats[name] || []).length;
        }
    }, proto);
}
github C2FO / hare / lib / rpc.js View on Github external
return when(queue.queue, this.__subscribeHandler(), rpcQueue.queue).chain(function (q) {
                q = q[0];
                var ret = new Promise(),
                    correlationId = uuid.v4();
                requests[correlationId] = ret;
                rpcQueue.publish(msg, comb.merge({replyTo: q.name, correlationId: correlationId}, opts)).addErrback(ret.errback);
                return ret.promise();
            }).classic(cb);
        },
github C2FO / hare / lib / index.js View on Github external
hare.connectionOptions = function subsribeOptions(opts) {
    comb.merge(CONNECTION_OPTIONS, opts || {});
    return hare;
};
github C2FO / patio / lib / plugins / columnMapper.js View on Github external
mappedColumn: function (name, table, condition, opts) {
            opts = opts || {};
            if (name) {
                name = sql.stringToIdentifier(name);
                if (table && condition) {
                    opts = comb.merge({joinType: "left", table: table, condition: condition, column: name}, opts);
                    this._mappedColumns[name] = opts;
                } else {
                    throw new ModelError("mapped column requires a table and join condition");
                }
            }
            return this;
        },
github C2FO / patio / lib / plugins / index.js View on Github external
var comb = require("comb"), inheritance = require("./inheritance");
/**
 * @ignore
 * @namespace
 * @name patio.plugins
 */
comb.merge(exports, {
    QueryPlugin:require("./query").QueryPlugin,
    CachePlugin:require("./cache").CachePlugin,
    AssociationPlugin:require("./association").AssociationPlugin,
    TimeStampPlugin:require("./timestamp"),
    ClassTableInheritancePlugin:inheritance.ClassTableInheritance,
    ColumnMapper:require("./columnMapper.js"),
    ValidatorPlugin:require("./validation.js")
});
github C2FO / hare / lib / index.js View on Github external
hare.queueOptions = function subsribeOptions(opts) {
    comb.merge(SUBSCRIBE_OPTIONS, opts || {});
    return hare;
};