Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
XFPage.prototype.load = function load() {
var url = this.url;
// Add the page slug for subsequent pages (page 1 doesn't have a slug)
if (this.page > 1) {
url += 'page-' + this.page;
}
// Fetch the page
return needle.getAsync(url, this.clientOpts)
.then(this._onLoad.bind(this));
};
return current.then(function () {
debug('fetching ' + item);
return request.getAsync(item, {});
}).then(function (results) {
var data = JSON.parse(results[1]);
return current.then(function () {
debug('fetching ' + item);
return request.getAsync(item, {});
}).then(function (results) {
var data = JSON.parse(results[1]);