32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
/*
|
|
* Copyright (c) Microsoft Corporation.
|
|
* Licensed under the MIT License.
|
|
*
|
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
*/
|
|
const pageMap = new WeakMap();
|
|
/**
|
|
* Given a result page from a pageable operation, returns a
|
|
* continuation token that can be used to begin paging from
|
|
* that point later.
|
|
* @param page A result object from calling .byPage() on a paged operation.
|
|
* @returns The continuation token that can be passed into byPage().
|
|
*/
|
|
export function getContinuationToken(page) {
|
|
var _a;
|
|
if (typeof page !== "object" || page === null) {
|
|
return undefined;
|
|
}
|
|
return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
|
|
}
|
|
export function setContinuationToken(page, continuationToken) {
|
|
var _a;
|
|
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
return;
|
|
}
|
|
const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
|
|
pageInfo.continuationToken = continuationToken;
|
|
pageMap.set(page, pageInfo);
|
|
}
|
|
//# sourceMappingURL=pagingHelper.js.map
|