Files
powerpoint-toolbox/node_modules/@azure/arm-subscriptions/dist-esm/src/pagingHelper.js
T
2025-03-07 19:22:02 +01:00

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