Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private finishOptions(options: ResponseOptions, { headers, url }: RequestInfo) {
options.statusText = getStatusText(options.status);
options.headers = headers;
options.url = url;
return options;
}
}
let top;
skip = reqInfo.query.get("$skip");
top = reqInfo.query.get("$top");
if (skip && skip.length && skip.length === 1) {
skip = parseInt(skip[0], 10);
}
if (top && top.length && top.length === 1) {
top = parseInt(top[0], 10);
}
const data = { value: records.slice(skip, skip + top), count: records.length };
const options: ResponseOptions = {
body: data,
status: STATUS.OK
};
options.statusText = getStatusText(options.status);
options.headers = reqInfo.headers;
options.url = reqInfo.url;
return options;
});
}