Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 } ) )
})
}
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);
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;