MCPcopy Index your code
hub / github.com/strongloop/loopback / prepareAndDoRectify

Function prepareAndDoRectify

common/models/change.js:205–221  ·  view source on GitHub ↗
(rev)

Source from the content-addressed store, hash-verified

203 return cb.promise;
204
205 function prepareAndDoRectify(rev) {
206 // avoid setting rev and prev to the same value
207 if (currentRev === rev) {
208 change.debug('rev and prev are equal (not updating anything)');
209 return cb(null, change);
210 }
211
212 // FIXME(@bajtos) Allow callers to pass in the checkpoint value
213 // (or even better - a memoized async function to get the cp value)
214 // That will enable `rectifyAll` to cache the checkpoint value
215 change.constructor.getCheckpointModel().current(
216 function(err, checkpoint) {
217 if (err) return cb(err);
218 doRectify(checkpoint, rev);
219 },
220 );
221 }
222
223 function doRectify(checkpoint, rev) {
224 if (rev) {

Callers 1

change.jsFile · 0.85

Calls 1

doRectifyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…