traverson
Version:
Hypermedia API/HATEOAS client for Node.js and the browser
21 lines (18 loc) • 571 B
JavaScript
;
var minilog = require('minilog')
, log = minilog('traverson')
, isContinuation = require('../is_continuation');
/*
* This transform covers the case of a follow() call *without any links* after
* a continue(). Actually, there is nothing to do here since we should have
* fetched everything last time.
*/
module.exports = function continuationToDoc(t) {
if (isContinuation(t)) {
log.debug('continuing from last traversal process (actions)');
t.continuation = null;
t.callback(null, t.step.doc);
return false;
}
return true;
};