modifyFeed(id, feedToModify, callback) { const modifiedFeed = this.feeds.find(feed => feed.options._id === id); modifiedFeed.stopReader(); modifiedFeed.modify(feedToModify); this.modifyItem(id, feedToModify, err => { callback(err); }); }
const galleryRouting = router => { setupRedirection(router, "/extensions", "/extensions/gallery"); setupPage(router, "/extensions/(|gallery|queue)", [], controllers.extensions.gallery); setupPage(router, "/extensions/my", [], controllers.extensions.my, true); setupPage(router, "/extensions/builder", [], controllers.extensions.builder, true); setupPage(router, "/extensions/:extid/install", [], controllers.extensions.installer); router.routes.push(new Route(router, "/extensions/builder", [middleware.checkUnavailable], controllers.extensions.builder.post, "post", "general")); router.routes.push(new Route(router, "/extensions/:extid", [middleware.checkUnavailableAPI], controllers.extensions.download, "get", "general")); router.routes.push(new Route(router, "/extensions/:extid/:action", [middleware.checkUnavailableAPI], controllers.extensions.gallery.modify, "post", "general")); }
/* Supresses $callAtMasterProcess-marked methods from calling at supervised process (usually it's beforeInit method) */ Meta.globalTag ('callAtMasterProcess', (tag, x) => Meta.setTag (tag, true, Meta.modify (x, beforeInitMethod => function (...args) { return this.isSupervisedProcess ? undefined : beforeInitMethod.call (this, ...args) })))
it('Throw an error if a modifier is used with a non-object argument', function () { var obj = { some: 'thing' } , updateQuery = { $set: 'this exists' }; expect(function () { model.modify(obj, updateQuery); }).to.throw(/Modifier .set's argument must be an object/); });
_.extend (def, { constructor: Meta.modify (def.hasOwnProperty ('constructor') ? def.constructor : this.defaultConstructor (base), function (fn) { if (base) { fn.prototype = Object.create (base.prototype); fn.prototype.constructor = fn } return fn }) })
Meta.modify (def, function (fn) { return function (done) { if ($async.is (args[0]) || $async.is (def)) { _.cps.apply (fn, self.context, args, function (args, then) { if (then) { then.apply (this, args) } done () }) } else { try { fn.apply (self.context, args); done (); } catch (e) { assertion.onException (e); } } } })
it('deallocates a prepared statement on subsequent calls if the query boundaries change', () => { const expected = [{ _id: '1', name: 'quux' }, { _id: '2', name: 'quux' }, { _id: '3' }, { _id: '4', name: 'qux' }]; const actual = []; const op = collection.modify('_id = :id').bind('id', '1').set('name', 'quux'); return op.execute() .then(() => op.bind('id', '2').execute()) .then(() => op.bind('id', '3').unset('name').execute()) .then(() => util.getPreparedStatement(session, 1)) .then(statement => expect(statement).to.not.exist) .then(() => collection.find().execute(doc => actual.push(doc))) .then(() => expect(actual).to.deep.equal(expected)); });
function modify(id, newData, cb) { const alert = alerts.findAlertById(id, state); if(!alert) return cb('no alert found'); const createId = alerts.getCreateIdByState(state); const modifiedAlert = alerts.modifyData(alert, newData, createId); const requestX = alerts.getRequestXByState(state); reqHandler.modify(requestX, modifiedAlert, (err, resp, body) => { cb(body); }); }
it('Creates 500 nodes, Modifies a way with 500 nodes', function(done) { knex('current_ways').where('changeset_id', cid).then(function(ways) { var nodes = makeNodes(cid, 500); ways[0].changeset = cid; var way = new Way(ways[0]).nodes(nodes); cs.create('node', nodes).modify('way', way); testChangeset.upload(cs.get()) .then(function(res) { return done(); }) .catch(done); }); });
// Updates saved configuration on system. patchConfig() { this.auth.allowed('c:config', (allowedErr, isAllowed) => { if (allowedErr || !isAllowed) return; Config.modify(this.req.params, err => { this.responses.generic204(err); }); }); }
const prepareResourceName = (resourceName, actionName) => { const shouldBePlural = ['index', 'create']; const modify = shouldBePlural.includes(actionName) ? pluralize : singularize; return modify(resourceName); }
render() { const { count } = this.state; return ( <React.Fragment> <div>{count}</div> <button onClick={() => this.modify(count + 1)}>Add</button> </React.Fragment> ) }
it('Modifies 1 node', function(done) { knex('current_nodes').where('changeset_id', cid).then(function(nodes) { nodes[0].changeset = cid; cs.modify('node', new Node(nodes[0])); testChangeset.upload(cs.get()) .then(function(res) { return done(); }) .catch(done); }); });
it('Throw an error if trying to change the _id field in a copy-type modification', function () { var obj = { some: 'thing', _id: 'keepit' } , updateQuery = { replace: 'done', bloup: [ 1, 8], _id: 'donttryit' } ; expect(function () { model.modify(obj, updateQuery); }).to.throw("You cannot change a document's _id"); updateQuery._id = 'keepit'; model.modify(obj, updateQuery); // No error thrown });
it('Throw an error if a modifier is used with a non-object argument', function () { var obj = { some: 'thing' } , updateQuery = { $set: 'this exists' }; expect(function () { model.modify(obj, updateQuery); }).to.throw(/Modifier .set's argument must be an object/); });