createServer(assign({}, TEST_CONFIG, { ports: testPorts, domains: [host] }), helloWorld) .once('error', t.fail) .once('listening', function () {
function mergeOptions(options, defaults) { options = options || {}; defaults = defaults || defaultOptions(); let ret = objectAssign({}, defaults, options); ret.chars = objectAssign({}, defaults.chars, options.chars); ret.style = objectAssign({}, defaults.style, options.style); return ret; }
function append (form, item, data, contentType) { const options = item.options; const len = typeof data === 'string' ? Buffer.byteLength(data) : data.length; const header = '--' + form.getBoundary() + CRLF + 'Content-Type: ' + contentType + CRLF + 'Content-Disposition: form-data' + (item.filename ? '; filename=' + encodeURIComponent(options.filename) : '') + (item.name ? '; name=' + encodeURIComponent(item.name) : '') + '; size=' + len + CRLF + CRLF; form.append(item.name || item.filename, data, objectAssign({ header: header, knownLength: len }, options)); }
assign({}, EventEmitter.prototype, { addChangeListener: function (callback) { this.on('change', callback); }, removeChangeListener: function (callback) { this.removeListener('change', callback); }, getTweet: function () { return tweet; } })
// Grab client-user-agent before making the request: this._AmazonMws.getClientUserAgent(function () { if (options.headers) { objectAssign(headers, options.headers); } makeRequest(requestParamsCopy); });
AppDispatcher.dispatch({ type: SocialConstants.SYNC_TWEETS, tweets: json.map((tweet) => { return assign(tweet, {type: 'tweet'}) }), receivedAt: Date.now() });
editTodo(index : number) : void { console.log(`edit ${index}`); let route = assign( {}, ROUTE.add, {index: index, todo: TodoStore.getTodo(index)}, ); this.props.navigator.push(route); }
/** * Update a TODO item. * @param {string} id * @param {object} updates An object literal containing only the data to be * updated. */ function update(id, updates) { _todos = _todos.set(id, assign({}, _todos.get(id), updates)); }
assign(new Dispatcher(), { handleViewAction: function (action) { this.dispatch({ source: constants.VIEW_ACTION, action: action }) } })
AppDispatcher.dispatch({ type: SocialConstants.SYNC_REDDITS, reddits: json.data.children.map((child) => { return assign(child.data, {type: 'reddit'}) }), receivedAt: Date.now() });
assign({}, EventEmitter.prototype, { addChangeListener: function(callback) { this.on('change', callback); }, removeChangeListener: function(callback) { this.removeChangeListener('change', callback); }, getTweet: function() { return tweet; } })
assign(new Dispatcher(), { handleViewAction: function(action){ this.dispatch({ source: 'VIEW_ACTION', action: action }); } })
assign(new Dispatcher(),{ handleViewAction: function(action){ var payload = { source: 'VIEW_ACTION', action: action }; this.dispatch(payload); } })
assign(new Dispatcher(), { handleViewAction : function(action){ var payload = { source: 'VIEW_ACTION', action: action }; this.dispatch(payload); } })