How to use the extend.bind function in extend

To help you get started, we’ve selected a few extend 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 avinoamr / duty / duty.js View on Github external
function update( job, done ) {
    var found = {};
    var updated_on = new Date().toISOString();
    new conn.Cursor()
        .find({ id: job.id })
        .once( "error", done )
        .once( "finish", done.bind( null, null, found ) )
        .once( "data", extend.bind( null, found ) )
        .once( "end", function () {
            this.end( extend( found, job, { updated_on: updated_on } ) )
        })
}
github guyrotem / google-translate-server / scripts / utils / load-config.js View on Github external
var extend = require('extend');
var configBaseDir = './../../conf';

var publicConfig = require(configBaseDir + '/config.json');
var privateConfig = loadPrivateConfig(configBaseDir + '/config.private.json');

function loadPrivateConfig(filePath) {
	try {
		return require(filePath);
	} catch(e) {
		return {};
	}
}

module.exports = extend.bind(null, publicConfig, privateConfig);
github qlik-oss / enigma.js / src / json-patch.js View on Github external
import originalExtend from 'extend';

import createEnigmaError from './error';
import errorCodes from './error-codes';

const extend = originalExtend.bind(null, true);
const JSONPatch = {};
const { isArray } = Array;
function isObject(v) { return v != null && !Array.isArray(v) && typeof v === 'object'; }
function isUndef(v) { return typeof v === 'undefined'; }
function isFunction(v) { return typeof v === 'function'; }

/**
* Generate an exact duplicate (with no references) of a specific value.
*
* @private
* @param {Object} The value to duplicate
* @returns {Object} a unique, duplicated value
*/
function generateValue(val) {
  if (val) {
    return extend({}, { val }).val;

extend

Port of jQuery.extend for node.js and the browser

MIT
Latest version published 6 years ago

Package Health Score

74 / 100
Full package analysis