How to use the mout/object.merge function in mout

To help you get started, we’ve selected a few mout 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 nicolaspanel / node-svm / lib / core / grid-search.js View on Github external
var promises = combs.map(function (comb) {
        var cParams = _o.merge(params, {
            c : comb[0],
            gamma: comb[1],
            epsilon: comb[2],
            nu: comb[3],
            degree: comb[4],
            r: comb[5]
        });
        var cPromises = subsets.map(function(ss){
            var clf = new BaseSVM();

            return clf
                .train(ss.train, cParams) // train with train set
                .then(function(){         // predict values for each example of the test set
                    done += 1;
                    deferred.notify({ done: done, total: total });
                    return _a.map(ss.test, function(test){ return [clf.predictSync(test[0]), test[1]]; });
github node-tastypie / tastypie / lib / resource / helpers / qs.js View on Github external
e.code = 400;
			throw e
		} else if( ( filters[fieldname] || []).indexOf( filtername ) == -1 ){
			var e   = new Error(filtername + " filter is not allowed on field " + fieldname );
			e.code  = 400;
			throw e
		}

		// should be defined on resource instance
		attr      = fieldmap[ fieldname ] ? fieldmap[fieldname].options.attribute || fieldname : fieldname
		fieldname = bits.unshift( attr ) && bits.join('.');
	
		if( allowablepaths.indexOf( fieldname ) >=0 ){
			remaining[fieldname] = remaining[fieldname] || {};
			filter = isFunction( filtertype.value ) ? filtertype.value( value ) : typecast( value ) ;
			remaining[ fieldname ] = isPrimitive( filter ) ? filter : merge( remaining[ fieldname ], filter );
		}
	}
	return remaining;
};
github bower / bower / test / helpers.js View on Github external
TempDir.prototype.prepareGit = function(revisions) {
        var that = this;

        revisions = object.merge(revisions || {}, this.defaults);

        rimraf.sync(that.path);

        mkdirp.sync(that.path);

        this.git('init');

        this.glob('./!(.git)').map(function(removePath) {
            var fullPath = path.join(that.path, removePath);

            rimraf.sync(fullPath);
        });

        object.forOwn(
            revisions,
            function(files, tag) {
github bower / bower / test / helpers.js View on Github external
TempDir.prototype.create = function(files, defaults) {
        var that = this;

        defaults = defaults || this.defaults || {};
        files = object.merge(files || {}, defaults);

        this.meta = function(tag) {
            if (tag) {
                return files[tag]['bower.json'];
            } else {
                return files['bower.json'];
            }
        };

        if (files) {
            object.forOwn(files, function(contents, filepath) {
                if (typeof contents === 'object') {
                    contents = JSON.stringify(contents, null, ' ') + '\n';
                }

                var fullPath = path.join(that.path, filepath);
github bower / bower / test / helpers.js View on Github external
commandStubs['./' + command] = function() {
        var args = [].slice.call(arguments);
        args[rawCommand.length - 1] = object.merge(
            { cwd: cwd },
            args[rawCommand.length - 1] || {}
        );
        return rawCommand.apply(null, args);
    };
github nicolaspanel / node-svm / lib / core / svm.js View on Github external
.done(function (model) {
                    deferred.notify(1);
                    model.params = _o.merge(self._config, model.params);

                    _o.mixIn(report, {
                        reduce: self._config.reduce,
                        retainedVariance : self._retainedVariance,
                        retainedDimension : self._retainedDimension,
                        initialDimension: self._initialDimension
                    });
                    deferred.resolve([model, report]);
                });
        })
github nicolaspanel / node-svm / lib / core / config.js View on Github external
function defaultConfig(config) {
    config = config || {};

    var cachedConfig = readCachedConfig(config.cwd || process.cwd());

    return checkConfig(_o.merge(cachedConfig, config));
}
github bower / bower / packages / bower-config / lib / util / rc.js View on Github external
file.forEach(function(filename) {
            if (fs.statSync(filename).isDirectory()) {
                var error;
                error = new Error(filename + ' should not be a directory');
                error.code = 'EFILEISDIR';
                throw error;
            }
            var json = fs.readFileSync(filename).toString();
            json = parse(json, filename);
            content = object.merge(content, json);
        });
github bower / bower / lib / core / resolvers / pluginResolverFactory.js View on Github external
PluginResolver.prototype.getEndpoint = function() {
        return object.merge(this._decEndpoint, {
            name: this.getName(),
            source: this.getSource(),
            target: this.getTarget()
        });
    };