mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-19 13:08:27 +02:00
Next release of setup-bun
This commit is contained in:
parent
ed9eb0969c
commit
9c14b74b45
1082 changed files with 242557 additions and 173810 deletions
44
node_modules/@azure/core-paging/dist-esm/src/getPagedAsyncIterator.js
generated
vendored
44
node_modules/@azure/core-paging/dist-esm/src/getPagedAsyncIterator.js
generated
vendored
|
@ -29,31 +29,51 @@ export function getPagedAsyncIterator(pagedResult) {
|
|||
}
|
||||
function getItemAsyncIterator(pagedResult) {
|
||||
return __asyncGenerator(this, arguments, function* getItemAsyncIterator_1() {
|
||||
var e_1, _a;
|
||||
var e_1, _a, e_2, _b;
|
||||
const pages = getPageAsyncIterator(pagedResult);
|
||||
const firstVal = yield __await(pages.next());
|
||||
// if the result does not have an array shape, i.e. TPage = TElement, then we return it as is
|
||||
if (!Array.isArray(firstVal.value)) {
|
||||
yield yield __await(firstVal.value);
|
||||
// `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case
|
||||
yield __await(yield* __asyncDelegator(__asyncValues(pages)));
|
||||
// can extract elements from this page
|
||||
const { toElements } = pagedResult;
|
||||
if (toElements) {
|
||||
yield __await(yield* __asyncDelegator(__asyncValues(toElements(firstVal.value))));
|
||||
try {
|
||||
for (var pages_1 = __asyncValues(pages), pages_1_1; pages_1_1 = yield __await(pages_1.next()), !pages_1_1.done;) {
|
||||
const page = pages_1_1.value;
|
||||
yield __await(yield* __asyncDelegator(__asyncValues(toElements(page))));
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (pages_1_1 && !pages_1_1.done && (_a = pages_1.return)) yield __await(_a.call(pages_1));
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
else {
|
||||
yield yield __await(firstVal.value);
|
||||
// `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case
|
||||
yield __await(yield* __asyncDelegator(__asyncValues(pages)));
|
||||
}
|
||||
}
|
||||
else {
|
||||
yield __await(yield* __asyncDelegator(__asyncValues(firstVal.value)));
|
||||
try {
|
||||
for (var pages_1 = __asyncValues(pages), pages_1_1; pages_1_1 = yield __await(pages_1.next()), !pages_1_1.done;) {
|
||||
const page = pages_1_1.value;
|
||||
for (var pages_2 = __asyncValues(pages), pages_2_1; pages_2_1 = yield __await(pages_2.next()), !pages_2_1.done;) {
|
||||
const page = pages_2_1.value;
|
||||
// pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,
|
||||
// it must be the case that `TPage = TElement[]`
|
||||
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (pages_1_1 && !pages_1_1.done && (_a = pages_1.return)) yield __await(_a.call(pages_1));
|
||||
if (pages_2_1 && !pages_2_1.done && (_b = pages_2.return)) yield __await(_b.call(pages_2));
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -62,9 +82,15 @@ function getPageAsyncIterator(pagedResult, options = {}) {
|
|||
return __asyncGenerator(this, arguments, function* getPageAsyncIterator_1() {
|
||||
const { pageLink, maxPageSize } = options;
|
||||
let response = yield __await(pagedResult.getPage(pageLink !== null && pageLink !== void 0 ? pageLink : pagedResult.firstPageLink, maxPageSize));
|
||||
if (!response) {
|
||||
return yield __await(void 0);
|
||||
}
|
||||
yield yield __await(response.page);
|
||||
while (response.nextPageLink) {
|
||||
response = yield __await(pagedResult.getPage(response.nextPageLink, maxPageSize));
|
||||
if (!response) {
|
||||
return yield __await(void 0);
|
||||
}
|
||||
yield yield __await(response.page);
|
||||
}
|
||||
});
|
||||
|
|
2
node_modules/@azure/core-paging/dist-esm/src/getPagedAsyncIterator.js.map
generated
vendored
2
node_modules/@azure/core-paging/dist-esm/src/getPagedAsyncIterator.js.map
generated
vendored
File diff suppressed because one or more lines are too long
2
node_modules/@azure/core-paging/dist-esm/src/models.js.map
generated
vendored
2
node_modules/@azure/core-paging/dist-esm/src/models.js.map
generated
vendored
|
@ -1 +1 @@
|
|||
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * An interface that tracks the settings for paged iteration\n */\nexport interface PageSettings {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n /**\n * The size of the page during paged iteration\n */\n maxPageSize?: number;\n}\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<T, PageT = T[], PageSettingsT = PageSettings> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<T>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<T, PageT, PageSettingsT>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: PageSettingsT) => AsyncIterableIterator<PageT>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\nexport interface PagedResult<TPage, TPageSettings = PageSettings, TLink = string> {\n /**\n * Link to the first page of results.\n */\n firstPageLink: TLink;\n /**\n * A method that returns a page of results.\n */\n getPage: (\n pageLink: TLink,\n maxPageSize?: number\n ) => Promise<{ page: TPage; nextPageLink?: TLink }>;\n /**\n * a function to implement the `byPage` method on the paged async iterator. The default is\n * one that sets the `maxPageSizeParam` from `settings.maxPageSize`.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n}\n"]}
|
||||
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * An interface that tracks the settings for paged iteration\n */\nexport interface PageSettings {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n /**\n * The size of the page during paged iteration\n */\n maxPageSize?: number;\n}\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\nexport interface PagedResult<TPage, TPageSettings = PageSettings, TLink = string> {\n /**\n * Link to the first page of results.\n */\n firstPageLink: TLink;\n /**\n * A method that returns a page of results.\n */\n getPage: (\n pageLink: TLink,\n maxPageSize?: number\n ) => Promise<{ page: TPage; nextPageLink?: TLink } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator. The default is\n * one that sets the `maxPageSizeParam` from `settings.maxPageSize`.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => unknown[];\n}\n\n/**\n * Paged collection of T items\n */\nexport type Paged<T> = {\n /**\n * The T items on this page\n */\n value: T[];\n /**\n * The link to the next page of items\n */\n nextLink?: string;\n};\n"]}
|
Loading…
Add table
Add a link
Reference in a new issue