traverson
Version:
Hypermedia API/HATEOAS client for Node.js and the browser
24 lines (21 loc) • 730 B
JavaScript
;
var minilog = require('minilog')
, log = minilog('traverson')
, convertEmbeddedDocToResponse =
require('./convert_embedded_doc_to_response')
, isContinuation = require('../is_continuation');
/*
* follow() call without links after continue(). Actually, there is nothing
* to do here since we should have fetched everything last time.
*/
module.exports = function continuationToResponse(t) {
if (isContinuation(t)) {
log.debug('continuing from last traversal process (actions)');
t.continuation = null;
// Hm, a transform using another transform. This feels a bit fishy.
convertEmbeddedDocToResponse(t);
t.callback(null, t.step.response);
return false;
}
return true;
};