return getPaths(config.options.directory) .then(function (paths) { return assign(config, {path: paths}); }); return getGraph(config.path.graph) .then(function (graph) { return assign(config, {graph: graph}); }); return pruneOptionalDependencies(config) .then(function (graph) { return assign(config, {graph: graph}); }); return readNpmCache(config.path.npmCache) .then(function (npmCache) { return assign(config, {npmCache: npmCache}); }); return readBundle(config.path.shrinkpack) .then(function (bundle) { return assign(config, {bundle: bundle}); }); return getDependencies(config) .then(function (deps) { return assign(config, {deps: deps}); });
function transformError (error, noStack) { return assign({ name: error.name, message: error.message, stack: noStack ? undefined : error.stack, lineNumber: error.lineNumber, fileName: error.fileName, columnNumber: error.columnNumber }, error) }
constructor (baseUrl, _options = {}) { this.baseUrl = baseUrl // default options this.options = { userAgent: `oai-pmh/${pkg.version} (https://github.com/paperhive/oai-pmh)`, retry: true, // automatically retry in case of status code 503 retryMin: 5, // wait at least 5 seconds retryMax: 600 // wait at maximum 600 seconds } // set user-provided options assign(this.options, _options) }
function updatePost(req, res) { const data = assign({ id: req.params.postId }, req.body.post); Post.update(data, { where: { id: req.params.postId } }) .then(() => { Post.findById(req.params.postId) .then((post) => { res.send({ post, }); }); }); }
// doesn't actually do anything in mock_bot __formatOutgoingMessage(outgoingMessage) { const rawMessage = assign({}, outgoingMessage); return Promise.resolve(rawMessage); }
var StreamingCache = function StreamingCache(options) { this.cache = LRU(assign({ length: DEFAULT_LENGTH }, options)); this.emitters = {}; Object.defineProperties(this, { 'length': { get: function () { return this.cache.length; } }, 'itemCount': { get: function () { return this.cache.itemCount; } } }); }
log(msg, obj) { if (this.closed === true) { throw new Error('Logging into a logger that has been closed!'); } if (![null, undefined].includes(obj)){ msg += JSON.stringify(obj); } if (typeof msg === 'string') { msg = { message: msg, }; } msg = assign(msg, this.extraFields); if (!msg.type) { msg.type = this.type; } this._addTimestamp(msg); this.messages.push(msg); if (this.messages.length >= this.bufferSize) { this._debug('Buffer is full - sending bulk'); this._popMsgsAndSend(); } }
const modelsUsed = Object.keys(assign(clone(this.api) || {}, this.plugins)) .filter(x => isObject(get(this.api, [x, 'models']) || get(this.plugins, [x, 'models']))) // Filter API with models .map(x => get(this.api, [x, 'models']) || get(this.plugins, [x, 'models'])) // Keep models
function loadInstrumentationsForTarget (name, path) { var instrumentations try { instrumentations = require(path) } catch (err) { debug.warn('loadInstrumentationsForTarget', format('instrumentation failed for `%s`. Could not load `%s`. Reason: %s', name, path, err.stack)) } if (!instrumentations) { return } if (typeof instrumentations === 'function') { return { name: name, instrumentations: [{ path: name, post: instrumentations }] } } else { return assign({ name: name }, instrumentations) } }
logData.response.time = responseTime; logData.response.status = (response && response.statusCode) || 599; logData.response.headers = assign({}, (response && response.headers) || {});
}) } else { assign(process.env, opts_.childProcessOpts.env) tape(name_, opts_, cb_)
assign(data, opt);
/** * Constructor to the OutgoingMessage class. Takes in an optional * message object that it will use as its base to add the OutgoingMessage * methods to. This constructor is not actually exposed in the public API. * In order to instantiate an OutgoingMessage object, you'll need to use the * createOutgoingMessage and createOutgoingMessageFor methods provided with * all classes that inherit from BaseBot. There are static and non-static * versions of both methods to make sure you can do so wherever as you wish * * @private * @param {object} [message] the base object to convert into an OutgoingMessage object */ constructor(message) { if (!message) { message = {}; } if (typeof message !== 'object') { throw new TypeError('OutgoingMessage constructor takes in an object as param'); } assign(this, message); return this; }
UnsignedInt: UnsignedIntResolver, JSONObject: GraphQLJSONObject, Query: await reduce(resolvers.QueryResolvers, (res, val) => assign(res, val), {}), Mutation: await reduce(resolvers.MutationResolvers, (res, val) => assign(res, val), {}), Subscription: await reduce(resolvers.SubscriptionResolvers, (res, val) => assign(res, val), {}), ...(await reduce( resolvers.GraphResolvers, return assign(res, obj) }, {}
var logData = assign({}, capturedData);