@dereekb/util 13.11.13 → 13.11.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eslint/index.cjs.js +10008 -394
- package/eslint/index.esm.js +9982 -392
- package/eslint/package.json +4 -4
- package/eslint/src/lib/comments.d.ts +14 -3
- package/eslint/src/lib/dbx-tag-families.d.ts +280 -0
- package/eslint/src/lib/index.d.ts +26 -3
- package/eslint/src/lib/jsdoc-parser.d.ts +116 -0
- package/eslint/src/lib/no-inline-string-empty-object-intersection.rule.d.ts +44 -0
- package/eslint/src/lib/no-inline-type-import.rule.d.ts +38 -0
- package/eslint/src/lib/no-sister-re-export.rule.d.ts +69 -0
- package/eslint/src/lib/plugin.d.ts +52 -1
- package/eslint/src/lib/prefer-canonical-jsdoc.rule.d.ts +68 -0
- package/eslint/src/lib/prefer-config-object.rule.d.ts +61 -0
- package/eslint/src/lib/prefer-maybe-type.rule.d.ts +72 -0
- package/eslint/src/lib/prefer-no-side-effects-in-jsdoc.rule.d.ts +1 -1
- package/eslint/src/lib/prefer-suggested-string.rule.d.ts +51 -0
- package/eslint/src/lib/require-constant-naming.rule.d.ts +63 -0
- package/eslint/src/lib/require-dbx-action-companion-tags.rule.d.ts +46 -0
- package/eslint/src/lib/require-dbx-auth-companion-tags.rule.d.ts +45 -0
- package/eslint/src/lib/require-dbx-docs-ui-example-companion-tags.rule.d.ts +42 -0
- package/eslint/src/lib/require-dbx-filter-companion-tags.rule.d.ts +43 -0
- package/eslint/src/lib/require-dbx-form-field-companion-tags.rule.d.ts +46 -0
- package/eslint/src/lib/require-dbx-model-companion-tags.rule.d.ts +46 -0
- package/eslint/src/lib/require-dbx-model-firebase-index-companion-tags.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-model-snapshot-field-companion-tags.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-pipe-companion-tags.rule.d.ts +43 -0
- package/eslint/src/lib/require-dbx-rule-companion-tags.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-util-companion-tags.rule.d.ts +74 -0
- package/eslint/src/lib/require-dbx-web-companion-tags.rule.d.ts +43 -0
- package/eslint/src/lib/require-default-prefix-naming.rule.d.ts +60 -0
- package/eslint/src/lib/require-deprecated-alias-placement.rule.d.ts +75 -0
- package/eslint/src/lib/require-exported-jsdoc-example.rule.d.ts +61 -0
- package/eslint/src/lib/require-no-side-effects.rule.d.ts +1 -1
- package/eslint/src/lib/require-readonly-config-params.rule.d.ts +57 -0
- package/eslint/src/lib/require-single-return.rule.d.ts +42 -0
- package/fetch/index.cjs.js +95 -80
- package/fetch/index.esm.js +95 -80
- package/fetch/package.json +2 -2
- package/fetch/src/lib/error.d.ts +2 -2
- package/fetch/src/lib/fetch.d.ts +15 -15
- package/fetch/src/lib/fetch.file.d.ts +5 -5
- package/fetch/src/lib/fetch.limit.d.ts +2 -2
- package/fetch/src/lib/fetch.page.d.ts +1 -1
- package/fetch/src/lib/fetch.page.iterate.d.ts +4 -4
- package/fetch/src/lib/fetch.type.d.ts +3 -2
- package/fetch/src/lib/fetch.url.d.ts +13 -13
- package/fetch/src/lib/json.d.ts +12 -12
- package/fetch/src/lib/timeout.d.ts +2 -2
- package/fetch/src/lib/url.d.ts +11 -11
- package/index.cjs.js +2592 -2329
- package/index.esm.js +2590 -2327
- package/package.json +1 -1
- package/src/lib/array/array.boolean.d.ts +20 -20
- package/src/lib/array/array.d.ts +73 -72
- package/src/lib/array/array.factory.d.ts +8 -5
- package/src/lib/array/array.filter.d.ts +23 -20
- package/src/lib/array/array.find.d.ts +9 -8
- package/src/lib/array/array.index.d.ts +15 -14
- package/src/lib/array/array.indexed.d.ts +22 -19
- package/src/lib/array/array.make.d.ts +3 -2
- package/src/lib/array/array.map.d.ts +5 -5
- package/src/lib/array/array.number.d.ts +27 -27
- package/src/lib/array/array.random.d.ts +11 -10
- package/src/lib/array/array.set.d.ts +14 -14
- package/src/lib/array/array.string.d.ts +31 -31
- package/src/lib/array/array.unique.d.ts +22 -20
- package/src/lib/array/array.value.d.ts +3 -2
- package/src/lib/assertion/assert.error.d.ts +8 -8
- package/src/lib/assertion/assertion.d.ts +5 -5
- package/src/lib/assertion/assertion.generic.d.ts +3 -3
- package/src/lib/assertion/assertion.number.d.ts +6 -6
- package/src/lib/auth/auth.role.claims.d.ts +12 -11
- package/src/lib/auth/auth.role.d.ts +3 -3
- package/src/lib/auth/pkce.d.ts +2 -2
- package/src/lib/boolean.d.ts +11 -11
- package/src/lib/cache/cache.memoize.d.ts +6 -6
- package/src/lib/contact/domain.d.ts +9 -9
- package/src/lib/contact/email.d.ts +11 -11
- package/src/lib/contact/phone.d.ts +12 -12
- package/src/lib/contact/random.d.ts +11 -9
- package/src/lib/date/date.d.ts +60 -59
- package/src/lib/date/date.time.d.ts +2 -2
- package/src/lib/date/date.unix.d.ts +8 -8
- package/src/lib/date/duration.d.ts +17 -17
- package/src/lib/date/expires.d.ts +29 -27
- package/src/lib/date/hour.d.ts +23 -23
- package/src/lib/date/minute.d.ts +6 -6
- package/src/lib/date/time.d.ts +10 -9
- package/src/lib/date/week.d.ts +32 -31
- package/src/lib/encryption/encryption.object.d.ts +3 -3
- package/src/lib/error/error.d.ts +13 -12
- package/src/lib/error/error.server.d.ts +4 -4
- package/src/lib/file/pdf.d.ts +4 -4
- package/src/lib/filter/filter.d.ts +3 -2
- package/src/lib/function/function.boolean.d.ts +4 -3
- package/src/lib/function/function.forward.d.ts +6 -4
- package/src/lib/getter/getter.d.ts +24 -19
- package/src/lib/getter/getter.map.d.ts +6 -5
- package/src/lib/getter/getter.util.d.ts +3 -2
- package/src/lib/grouping.d.ts +25 -24
- package/src/lib/hash.d.ts +11 -10
- package/src/lib/iterable/iterable.d.ts +39 -39
- package/src/lib/iterable/iterable.map.d.ts +3 -3
- package/src/lib/key.d.ts +16 -16
- package/src/lib/map/map.d.ts +12 -12
- package/src/lib/map/map.intersection.d.ts +3 -3
- package/src/lib/map/map.key.d.ts +16 -14
- package/src/lib/misc/host.d.ts +2 -2
- package/src/lib/model/id.batch.d.ts +4 -3
- package/src/lib/model/id.factory.d.ts +4 -3
- package/src/lib/model/model.conversion.d.ts +19 -14
- package/src/lib/model/model.conversion.field.d.ts +2 -2
- package/src/lib/model/model.copy.d.ts +5 -4
- package/src/lib/model/model.d.ts +48 -46
- package/src/lib/model/model.modify.d.ts +10 -8
- package/src/lib/nodejs/stream.d.ts +6 -5
- package/src/lib/number/bitwise.dencoder.d.ts +12 -12
- package/src/lib/number/bound.d.ts +16 -13
- package/src/lib/number/dollar.d.ts +6 -5
- package/src/lib/number/encoded.d.ts +7 -7
- package/src/lib/number/factory.d.ts +4 -3
- package/src/lib/number/number.d.ts +37 -37
- package/src/lib/number/random.d.ts +11 -10
- package/src/lib/number/round.d.ts +34 -30
- package/src/lib/number/sort.d.ts +3 -2
- package/src/lib/number/transform.d.ts +5 -4
- package/src/lib/object/object.array.d.ts +6 -6
- package/src/lib/object/object.array.delta.d.ts +3 -2
- package/src/lib/object/object.d.ts +12 -12
- package/src/lib/object/object.empty.d.ts +3 -3
- package/src/lib/object/object.equal.d.ts +11 -10
- package/src/lib/object/object.filter.pojo.d.ts +74 -74
- package/src/lib/object/object.filter.tuple.d.ts +26 -26
- package/src/lib/object/object.flatten.d.ts +4 -4
- package/src/lib/object/object.key.d.ts +6 -4
- package/src/lib/object/object.map.d.ts +15 -13
- package/src/lib/page/page.d.ts +5 -5
- package/src/lib/page/page.filter.d.ts +8 -8
- package/src/lib/path/path.d.ts +98 -88
- package/src/lib/promise/callback.d.ts +2 -2
- package/src/lib/promise/is.d.ts +6 -6
- package/src/lib/promise/poll.d.ts +9 -9
- package/src/lib/promise/promise.d.ts +33 -30
- package/src/lib/promise/promise.factory.d.ts +4 -3
- package/src/lib/promise/promise.loop.d.ts +11 -11
- package/src/lib/promise/promise.task.d.ts +6 -5
- package/src/lib/promise/promise.type.d.ts +3 -3
- package/src/lib/promise/use.d.ts +3 -3
- package/src/lib/relation/relation.d.ts +15 -15
- package/src/lib/service/handler.config.d.ts +20 -16
- package/src/lib/service/handler.d.ts +3 -2
- package/src/lib/service/typed.service.d.ts +2 -2
- package/src/lib/set/set.d.ts +62 -59
- package/src/lib/set/set.delta.d.ts +5 -4
- package/src/lib/set/set.hashset.d.ts +5 -5
- package/src/lib/set/set.selection.d.ts +5 -4
- package/src/lib/sort.d.ts +11 -11
- package/src/lib/storage/storage.d.ts +2 -1
- package/src/lib/storage/storage.error.d.ts +4 -4
- package/src/lib/storage/storage.memory.d.ts +7 -7
- package/src/lib/storage/storage.object.d.ts +5 -5
- package/src/lib/string/case.d.ts +6 -6
- package/src/lib/string/char.d.ts +30 -29
- package/src/lib/string/dencoder.d.ts +25 -20
- package/src/lib/string/factory.d.ts +11 -8
- package/src/lib/string/html.d.ts +19 -19
- package/src/lib/string/mimetype.d.ts +9 -8
- package/src/lib/string/prefix.d.ts +8 -8
- package/src/lib/string/replace.d.ts +45 -39
- package/src/lib/string/search.d.ts +5 -4
- package/src/lib/string/sort.d.ts +13 -4
- package/src/lib/string/string.d.ts +44 -43
- package/src/lib/string/transform.d.ts +32 -23
- package/src/lib/string/tree.d.ts +5 -4
- package/src/lib/string/url.d.ts +5 -4
- package/src/lib/tree/tree.array.d.ts +5 -4
- package/src/lib/tree/tree.expand.d.ts +6 -6
- package/src/lib/tree/tree.explore.d.ts +13 -10
- package/src/lib/tree/tree.flatten.d.ts +10 -10
- package/src/lib/type.d.ts +42 -12
- package/src/lib/value/address.d.ts +7 -7
- package/src/lib/value/bound.d.ts +70 -66
- package/src/lib/value/build.d.ts +6 -6
- package/src/lib/value/comparator.d.ts +19 -17
- package/src/lib/value/cron.d.ts +2 -2
- package/src/lib/value/decision.d.ts +6 -5
- package/src/lib/value/equal.d.ts +11 -9
- package/src/lib/value/indexed.d.ts +101 -85
- package/src/lib/value/label.d.ts +2 -2
- package/src/lib/value/map.d.ts +20 -16
- package/src/lib/value/maybe.d.ts +36 -36
- package/src/lib/value/modifier.d.ts +24 -23
- package/src/lib/value/point.d.ts +85 -77
- package/src/lib/value/url.d.ts +2 -2
- package/src/lib/value/use.d.ts +36 -33
- package/src/lib/value/vector.d.ts +15 -14
- package/test/index.cjs.js +41 -36
- package/test/index.esm.js +41 -36
- package/test/package.json +2 -2
- package/test/src/lib/jest/jest.fail.d.ts +2 -2
- package/test/src/lib/shared/shared.d.ts +20 -20
- package/test/src/lib/shared/shared.fail.d.ts +21 -16
- package/test/src/lib/shared/shared.function.d.ts +4 -4
- package/test/src/lib/shared/shared.wrap.d.ts +10 -10
package/fetch/index.cjs.js
CHANGED
|
@@ -117,8 +117,8 @@ var FetchResponseError = /*#__PURE__*/ function(BaseError) {
|
|
|
117
117
|
/**
|
|
118
118
|
* Asserts that the fetch response has an ok status code, throwing a FetchResponseError if it does not.
|
|
119
119
|
*
|
|
120
|
-
* @param responsePromise -
|
|
121
|
-
* @returns
|
|
120
|
+
* @param responsePromise - Pending fetch result whose status must be validated.
|
|
121
|
+
* @returns Same response when the status is ok; otherwise the rejected error.
|
|
122
122
|
*/ function requireOkResponse(responsePromise) {
|
|
123
123
|
return responsePromise.then(function(response) {
|
|
124
124
|
if (!response.ok) {
|
|
@@ -253,8 +253,8 @@ var FetchTimeoutError = /*#__PURE__*/ function(BaseError) {
|
|
|
253
253
|
* is present on the RequestInit or Request and no abort signal is already provided,
|
|
254
254
|
* an AbortController is created to abort the request after the specified duration.
|
|
255
255
|
*
|
|
256
|
-
* @param inputFetch -
|
|
257
|
-
* @returns
|
|
256
|
+
* @param inputFetch - The fetch function to wrap with timeout behavior.
|
|
257
|
+
* @returns A wrapped fetch function that enforces timeouts via AbortController.
|
|
258
258
|
*/ function fetchTimeout(inputFetch) {
|
|
259
259
|
return function(input, init) {
|
|
260
260
|
var _ref;
|
|
@@ -268,7 +268,7 @@ var FetchTimeoutError = /*#__PURE__*/ function(BaseError) {
|
|
|
268
268
|
signal: abortController.signal // pass the abort signal
|
|
269
269
|
});
|
|
270
270
|
}
|
|
271
|
-
var responsePromise = inputFetch(input, init);
|
|
271
|
+
var responsePromise = inputFetch(input, init !== null && init !== void 0 ? init : undefined);
|
|
272
272
|
if (timeout) {
|
|
273
273
|
var timeoutId = setTimeout(function() {
|
|
274
274
|
controller === null || controller === void 0 ? void 0 : controller.abort();
|
|
@@ -540,7 +540,7 @@ function _ts_generator$4(thisArg, body) {
|
|
|
540
540
|
};
|
|
541
541
|
}
|
|
542
542
|
/**
|
|
543
|
-
* Default FetchHabdler
|
|
543
|
+
* Default FetchHabdler.
|
|
544
544
|
*
|
|
545
545
|
* @param request
|
|
546
546
|
* @param makeFetch
|
|
@@ -597,14 +597,14 @@ function _ts_generator$4(thisArg, body) {
|
|
|
597
597
|
* @param init
|
|
598
598
|
* @returns
|
|
599
599
|
*/ var DEFAULT_FETCH_REQUEST_FACTORY = function DEFAULT_FETCH_REQUEST_FACTORY(input, init) {
|
|
600
|
-
return new Request(input, init);
|
|
600
|
+
return new Request(input, init !== null && init !== void 0 ? init : undefined);
|
|
601
601
|
};
|
|
602
602
|
/**
|
|
603
603
|
* Creates a FetchRequestFactory that builds Request objects by applying base URL resolution,
|
|
604
604
|
* base request init merging, timeout configuration, and custom request init transformations.
|
|
605
605
|
*
|
|
606
|
-
* @param config -
|
|
607
|
-
* @returns
|
|
606
|
+
* @param config - Configuration for URL resolution, base request defaults, timeout, and request init transformations.
|
|
607
|
+
* @returns A FetchRequestFactory that produces fully configured Request objects.
|
|
608
608
|
*/ function fetchRequestFactory(config) {
|
|
609
609
|
var _config_makeRequest = config.makeRequest, makeRequest = _config_makeRequest === void 0 ? DEFAULT_FETCH_REQUEST_FACTORY : _config_makeRequest, inputBaseUrl = config.baseUrl, inputBaseRequest = config.baseRequest, timeout = config.timeout, requestInitFactory = config.requestInitFactory, _config_useBaseUrlForConfiguredFetchRequests = config.useBaseUrlForConfiguredFetchRequests, useBaseUrlForConfiguredFetchRequests = _config_useBaseUrlForConfiguredFetchRequests === void 0 ? false : _config_useBaseUrlForConfiguredFetchRequests, _config_forceBaseUrlForWebsiteUrlWithPrefix = config.forceBaseUrlForWebsiteUrlWithPrefix, forceBaseUrlForWebsiteUrlWithPrefix = _config_forceBaseUrlForWebsiteUrlWithPrefix === void 0 ? useBaseUrlForConfiguredFetchRequests : _config_forceBaseUrlForWebsiteUrlWithPrefix;
|
|
610
610
|
var baseUrl = inputBaseUrl ? new URL(util.removeTrailingSlashes(inputBaseUrl)) : undefined;
|
|
@@ -808,7 +808,7 @@ function _ts_generator$4(thisArg, body) {
|
|
|
808
808
|
fixedRequest = _state.sent();
|
|
809
809
|
return [
|
|
810
810
|
4,
|
|
811
|
-
buildRequestInit(fixedRequest, init)
|
|
811
|
+
buildRequestInit(fixedRequest, init !== null && init !== void 0 ? init : undefined)
|
|
812
812
|
];
|
|
813
813
|
case 2:
|
|
814
814
|
init = _state.sent();
|
|
@@ -843,9 +843,9 @@ function _ts_generator$4(thisArg, body) {
|
|
|
843
843
|
* Merges two RequestInit objects, combining their headers and spreading remaining properties
|
|
844
844
|
* so that values from the second init override the base.
|
|
845
845
|
*
|
|
846
|
-
* @param base -
|
|
847
|
-
* @param requestInit -
|
|
848
|
-
* @returns
|
|
846
|
+
* @param base - The base RequestInit to merge onto.
|
|
847
|
+
* @param requestInit - Optional RequestInit whose values override the base.
|
|
848
|
+
* @returns The merged RequestInit.
|
|
849
849
|
*/ function mergeRequestInits(base, requestInit) {
|
|
850
850
|
var result;
|
|
851
851
|
if (requestInit) {
|
|
@@ -865,8 +865,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
865
865
|
* Merges an array of HeadersInit values into a single array of key-value tuples.
|
|
866
866
|
* Later headers override earlier ones on a per-key basis while preserving multi-value support.
|
|
867
867
|
*
|
|
868
|
-
* @param inputHeadersArray -
|
|
869
|
-
* @returns
|
|
868
|
+
* @param inputHeadersArray - Header sources to combine; later entries override earlier ones per header name.
|
|
869
|
+
* @returns Combined [key, value] tuples representing the merged headers in iteration order.
|
|
870
870
|
*/ function mergeRequestHeaders(inputHeadersArray) {
|
|
871
871
|
var headersMap = util.multiValueMapBuilder();
|
|
872
872
|
util.filterMaybeArrayValues(inputHeadersArray).forEach(function(headers) {
|
|
@@ -889,8 +889,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
889
889
|
* Converts a HeadersInit value (tuple array, Headers object, or plain object) into
|
|
890
890
|
* a normalized array of [key, value] tuples.
|
|
891
891
|
*
|
|
892
|
-
* @param headers -
|
|
893
|
-
* @returns
|
|
892
|
+
* @param headers - Header input in any supported shape to normalize.
|
|
893
|
+
* @returns Tuple list usable as input to multi-value header merging.
|
|
894
894
|
*/ function headersToHeadersTuple(headers) {
|
|
895
895
|
var tuples = [];
|
|
896
896
|
if (Array.isArray(headers)) {
|
|
@@ -914,8 +914,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
914
914
|
* Type guard that checks whether the given input is a fetch Request object
|
|
915
915
|
* by testing for the presence of a url property.
|
|
916
916
|
*
|
|
917
|
-
* @param input -
|
|
918
|
-
* @returns
|
|
917
|
+
* @param input - The value to test.
|
|
918
|
+
* @returns True if the input is a Request.
|
|
919
919
|
*/ function isFetchRequest(input) {
|
|
920
920
|
return Boolean(input.url);
|
|
921
921
|
}
|
|
@@ -1051,8 +1051,8 @@ function _ts_generator$3(thisArg, body) {
|
|
|
1051
1051
|
/**
|
|
1052
1052
|
* Creates a File object from the given input.
|
|
1053
1053
|
*
|
|
1054
|
-
* @param input -
|
|
1055
|
-
* @returns
|
|
1054
|
+
* @param input - Configuration containing the file content, name, optional MIME type, and last modified timestamp.
|
|
1055
|
+
* @returns A File object constructed from the provided input.
|
|
1056
1056
|
*/ function makeFileForFetch(input) {
|
|
1057
1057
|
var options = {};
|
|
1058
1058
|
if (input.mimeType) {
|
|
@@ -1132,10 +1132,10 @@ function fetchFileFromUrl(input, safe) {
|
|
|
1132
1132
|
};
|
|
1133
1133
|
}
|
|
1134
1134
|
/**
|
|
1135
|
-
* @
|
|
1135
|
+
* @param input - Upload request inputs (target URL, fetch implementation, HTTP method, and file body) used to issue the request.
|
|
1136
|
+
* @returns Resolved upload response from the underlying fetch call.
|
|
1136
1137
|
*
|
|
1137
|
-
* @
|
|
1138
|
-
* @returns a promise resolving to the fetch Response
|
|
1138
|
+
* @deprecated Use makeFileForFetch() with FormData and context.fetch() instead.
|
|
1139
1139
|
*/ // eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1140
1140
|
function fetchUploadFile(input) {
|
|
1141
1141
|
var _input_method;
|
|
@@ -1282,8 +1282,8 @@ function _ts_generator$2(thisArg, body) {
|
|
|
1282
1282
|
* Creates a FetchHandler that enforces rate limiting via the provided PromiseRateLimiter and supports
|
|
1283
1283
|
* automatic retry when the server signals throttling.
|
|
1284
1284
|
*
|
|
1285
|
-
* @param config -
|
|
1286
|
-
* @returns
|
|
1285
|
+
* @param config - Configuration containing the rate limiter, retry settings, and response handler.
|
|
1286
|
+
* @returns A RateLimitedFetchHandler that rate-limits outgoing requests and retries on throttle responses.
|
|
1287
1287
|
*/ function rateLimitedFetchHandler(config) {
|
|
1288
1288
|
var updateWithResponse = config.updateWithResponse, inputMaxRetries = config.maxRetries;
|
|
1289
1289
|
var maxRetries = inputMaxRetries !== null && inputMaxRetries !== void 0 ? inputMaxRetries : 1;
|
|
@@ -1621,7 +1621,7 @@ var FetchPageLimitReachedError = /*#__PURE__*/ function(FetchRequestFactoryError
|
|
|
1621
1621
|
}(FetchRequestFactoryError);
|
|
1622
1622
|
/**
|
|
1623
1623
|
* Default max page for a FetchPageFactory.
|
|
1624
|
-
*/ var
|
|
1624
|
+
*/ var DEFAULT_FETCH_PAGE_FACTORY_MAX_PAGE = 100;
|
|
1625
1625
|
/**
|
|
1626
1626
|
* Creates a new FetchPageFactory from the input.
|
|
1627
1627
|
*
|
|
@@ -1632,7 +1632,7 @@ var FetchPageLimitReachedError = /*#__PURE__*/ function(FetchRequestFactoryError
|
|
|
1632
1632
|
return function(initalInput, options) {
|
|
1633
1633
|
var _ref = options !== null && options !== void 0 ? options : {}, tmp = _ref.maxPage, inputMaxPage = tmp === void 0 ? defaultMaxPage : tmp, inputMaxItemsPerPage = _ref.maxItemsPerPage;
|
|
1634
1634
|
var maxItemsPerPage = inputMaxItemsPerPage !== null && inputMaxItemsPerPage !== void 0 ? inputMaxItemsPerPage : defaultMaxItemsPerPage;
|
|
1635
|
-
var maxPage = inputMaxPage === null ? Number.MAX_SAFE_INTEGER : inputMaxPage !== null && inputMaxPage !== void 0 ? inputMaxPage :
|
|
1635
|
+
var maxPage = inputMaxPage === null ? Number.MAX_SAFE_INTEGER : inputMaxPage !== null && inputMaxPage !== void 0 ? inputMaxPage : DEFAULT_FETCH_PAGE_FACTORY_MAX_PAGE;
|
|
1636
1636
|
function fetchNextWithInput(input) {
|
|
1637
1637
|
var previous = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : undefined;
|
|
1638
1638
|
return function() {
|
|
@@ -1961,8 +1961,8 @@ function _ts_generator(thisArg, body) {
|
|
|
1961
1961
|
* Each item's callback receives a global index that reflects its position across all pages,
|
|
1962
1962
|
* not just within the current page.
|
|
1963
1963
|
*
|
|
1964
|
-
* @param config - Configuration specifying the fetch page source, item extraction, and per-item callback
|
|
1965
|
-
* @returns Combined result from {@link iterateFetchPagesByItems} including page/item counts and per-item task results
|
|
1964
|
+
* @param config - Configuration specifying the fetch page source, item extraction, and per-item callback.
|
|
1965
|
+
* @returns Combined result from {@link iterateFetchPagesByItems} including page/item counts and per-item task results.
|
|
1966
1966
|
*
|
|
1967
1967
|
* @example
|
|
1968
1968
|
* ```typescript
|
|
@@ -2021,7 +2021,7 @@ function _ts_generator(thisArg, body) {
|
|
|
2021
2021
|
*
|
|
2022
2022
|
* For per-item processing instead of batch processing, use {@link iterateFetchPagesByEachItem}.
|
|
2023
2023
|
*
|
|
2024
|
-
* @param config - Configuration specifying fetch source, item extraction, filtering, limits, and batch callback
|
|
2024
|
+
* @param config - Configuration specifying fetch source, item extraction, filtering, limits, and batch callback.
|
|
2025
2025
|
* @returns Result with page count and item counters (loaded and visited)
|
|
2026
2026
|
*
|
|
2027
2027
|
* @example
|
|
@@ -2107,35 +2107,47 @@ function iterateFetchPages(config) {
|
|
|
2107
2107
|
var _ref, _ref1, iteratePage, inputFetchPage, input, fetchPageFactory, usePageResult, maxParallelPages, waitBetweenPages, maxPage, maxItemsPerPage, endEarly, hasReachedEnd, fetchPage, currentNextPage, performTaskFn, result;
|
|
2108
2108
|
function taskInputFactory() {
|
|
2109
2109
|
return _async_to_generator(function() {
|
|
2110
|
+
var result;
|
|
2110
2111
|
return _ts_generator(this, function(_state) {
|
|
2111
2112
|
switch(_state.label){
|
|
2112
2113
|
case 0:
|
|
2113
|
-
if (hasReachedEnd)
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2114
|
+
if (!hasReachedEnd) return [
|
|
2115
|
+
3,
|
|
2116
|
+
1
|
|
2117
|
+
];
|
|
2118
|
+
result = null; // issue no more tasks
|
|
2119
|
+
return [
|
|
2120
|
+
3,
|
|
2121
|
+
4
|
|
2122
|
+
];
|
|
2123
|
+
case 1:
|
|
2124
|
+
if (!(currentNextPage != null && (currentNextPage.isAtMaxPage || !currentNextPage.hasNext))) return [
|
|
2125
|
+
3,
|
|
2126
|
+
2
|
|
2127
|
+
];
|
|
2128
|
+
hasReachedEnd = true;
|
|
2129
|
+
result = null;
|
|
2130
|
+
return [
|
|
2131
|
+
3,
|
|
2132
|
+
4
|
|
2133
|
+
];
|
|
2134
|
+
case 2:
|
|
2126
2135
|
return [
|
|
2127
2136
|
4,
|
|
2128
2137
|
fetchPage.fetchNext()
|
|
2129
2138
|
];
|
|
2130
|
-
case
|
|
2139
|
+
case 3:
|
|
2131
2140
|
currentNextPage = _state.sent();
|
|
2132
2141
|
fetchPage = currentNextPage;
|
|
2142
|
+
result = {
|
|
2143
|
+
i: currentNextPage.page,
|
|
2144
|
+
fetchPageResult: currentNextPage
|
|
2145
|
+
};
|
|
2146
|
+
_state.label = 4;
|
|
2147
|
+
case 4:
|
|
2133
2148
|
return [
|
|
2134
2149
|
2,
|
|
2135
|
-
|
|
2136
|
-
i: currentNextPage.page,
|
|
2137
|
-
fetchPageResult: currentNextPage
|
|
2138
|
-
}
|
|
2150
|
+
result
|
|
2139
2151
|
];
|
|
2140
2152
|
}
|
|
2141
2153
|
});
|
|
@@ -2257,9 +2269,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
2257
2269
|
/**
|
|
2258
2270
|
* Creates URLSearchParams from the input objects. The input objects are merged together.
|
|
2259
2271
|
*
|
|
2260
|
-
* @param input -
|
|
2261
|
-
* @param options -
|
|
2262
|
-
* @returns
|
|
2272
|
+
* @param input - One or more objects (or nullish values) whose key-value pairs become search parameters.
|
|
2273
|
+
* @param options - Optional configuration for filtering, omitting keys, and space encoding.
|
|
2274
|
+
* @returns A URLSearchParams instance built from the merged and filtered input.
|
|
2263
2275
|
*/ function makeUrlSearchParams(input, options) {
|
|
2264
2276
|
var _ref = options !== null && options !== void 0 ? options : {}, omitKeys = _ref.omitKeys, filterValues = _ref.filterEmptyValues;
|
|
2265
2277
|
var mergedInput = Array.isArray(input) ? util.mergeObjects(input) : input;
|
|
@@ -2280,9 +2292,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
2280
2292
|
* RFC 3986 percent-encoded output (`%20` for spaces) instead of the
|
|
2281
2293
|
* `application/x-www-form-urlencoded` default (`+` for spaces).
|
|
2282
2294
|
*
|
|
2283
|
-
* @param input -
|
|
2284
|
-
* @param options -
|
|
2285
|
-
* @returns
|
|
2295
|
+
* @param input - Objects to encode as query parameters.
|
|
2296
|
+
* @param options - Encoding options.
|
|
2297
|
+
* @returns The encoded query string (without a leading `?`)
|
|
2286
2298
|
*/ function makeUrlSearchParamsString(input, options) {
|
|
2287
2299
|
var params = makeUrlSearchParams(input, options);
|
|
2288
2300
|
var str = params.toString();
|
|
@@ -2296,6 +2308,11 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
2296
2308
|
* {@link MakeUrlSearchParamsOptions} such as `omitKeys`, `filterEmptyValues`, and
|
|
2297
2309
|
* `useUrlSearchSpaceHandling`.
|
|
2298
2310
|
*
|
|
2311
|
+
* @param url - The URL string to update.
|
|
2312
|
+
* @param params - New search parameters to merge into the URL.
|
|
2313
|
+
* @param options - Optional configuration for filtering, omitting keys, and space encoding.
|
|
2314
|
+
* @returns The URL string with updated query parameters.
|
|
2315
|
+
*
|
|
2299
2316
|
* @example
|
|
2300
2317
|
* ```typescript
|
|
2301
2318
|
* // Add params to a URL with no query string
|
|
@@ -2310,11 +2327,6 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
2310
2327
|
* updateUrlSearchParams('https://example.com', { scope: 'openid profile' }, { useUrlSearchSpaceHandling: true });
|
|
2311
2328
|
* // => 'https://example.com?scope=openid%20profile'
|
|
2312
2329
|
* ```
|
|
2313
|
-
*
|
|
2314
|
-
* @param url - the URL string to update
|
|
2315
|
-
* @param params - new search parameters to merge into the URL
|
|
2316
|
-
* @param options - optional configuration for filtering, omitting keys, and space encoding
|
|
2317
|
-
* @returns the URL string with updated query parameters
|
|
2318
2330
|
*/ function updateUrlSearchParams(url, params, options) {
|
|
2319
2331
|
var _url_split = _sliced_to_array$1(url.split('?', 2), 2), basePath = _url_split[0], existingQuery = _url_split[1];
|
|
2320
2332
|
var existingParams = existingQuery ? new URLSearchParams(existingQuery) : new URLSearchParams();
|
|
@@ -2355,8 +2367,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
2355
2367
|
/**
|
|
2356
2368
|
* Merges an array of MakeUrlSearchParamsOptions into a single MakeUrlSearchParamsOptions value.
|
|
2357
2369
|
*
|
|
2358
|
-
* @param options -
|
|
2359
|
-
* @returns
|
|
2370
|
+
* @param options - One or more options objects whose omitKeys sets are combined.
|
|
2371
|
+
* @returns A single MakeUrlSearchParamsOptions with the union of all omitKeys.
|
|
2360
2372
|
*/ function mergeMakeUrlSearchParamsOptions(options) {
|
|
2361
2373
|
var omitKeys = new Set();
|
|
2362
2374
|
util.useIterableOrValue(options, function(x) {
|
|
@@ -2433,8 +2445,8 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
2433
2445
|
* Resolves a FetchURLInput to a URL string. Handles plain strings, URL objects, and
|
|
2434
2446
|
* FetchURLConfiguration objects by appending query parameters when provided.
|
|
2435
2447
|
*
|
|
2436
|
-
* @param input - a string
|
|
2437
|
-
* @returns
|
|
2448
|
+
* @param input - URL source to normalize; may already be a string or carry query parameters to append.
|
|
2449
|
+
* @returns Fully resolved request URL ready to pass to `fetch`.
|
|
2438
2450
|
*/ function fetchURL(input) {
|
|
2439
2451
|
var url;
|
|
2440
2452
|
if (typeof input === 'string') {
|
|
@@ -2459,21 +2471,21 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
2459
2471
|
/**
|
|
2460
2472
|
* Type guard that checks whether the given value is a URL instance.
|
|
2461
2473
|
*
|
|
2462
|
-
* @param input -
|
|
2463
|
-
* @returns
|
|
2474
|
+
* @param input - The value to test.
|
|
2475
|
+
* @returns True if the input is a URL instance.
|
|
2464
2476
|
*/ function isURL(input) {
|
|
2465
2477
|
return (typeof input === "undefined" ? "undefined" : _type_of$1(input)) === 'object' && _instanceof(input, URL);
|
|
2466
2478
|
}
|
|
2467
2479
|
/**
|
|
2468
2480
|
* Type guard that checks whether the given value is a URLSearchParams instance.
|
|
2469
2481
|
*
|
|
2470
|
-
* @param input -
|
|
2471
|
-
* @returns
|
|
2482
|
+
* @param input - The value to test.
|
|
2483
|
+
* @returns True if the input is a URLSearchParams instance.
|
|
2472
2484
|
*/ function isURLSearchParams(input) {
|
|
2473
2485
|
return (typeof input === "undefined" ? "undefined" : _type_of$1(input)) === 'object' && _instanceof(input, URLSearchParams);
|
|
2474
2486
|
}
|
|
2475
2487
|
/**
|
|
2476
|
-
* Converts the input
|
|
2488
|
+
* Converts the input.
|
|
2477
2489
|
*
|
|
2478
2490
|
* @param input
|
|
2479
2491
|
* @returns
|
|
@@ -2501,8 +2513,8 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
2501
2513
|
* Converts a FetchURLQueryParamsInput value (URLSearchParams, string, iterable of tuples, or
|
|
2502
2514
|
* params object) into a URLSearchParams instance.
|
|
2503
2515
|
*
|
|
2504
|
-
* @param input -
|
|
2505
|
-
* @returns
|
|
2516
|
+
* @param input - The query parameters input to convert.
|
|
2517
|
+
* @returns A URLSearchParams instance representing the input.
|
|
2506
2518
|
*/ function queryParamsToSearchParams(input) {
|
|
2507
2519
|
var result;
|
|
2508
2520
|
if (isURLSearchParams(input)) {
|
|
@@ -2522,8 +2534,8 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
2522
2534
|
* Converts a FetchURLSearchParamsObject (a plain key-value record) into a URLSearchParams instance,
|
|
2523
2535
|
* expanding array values into multiple entries for the same key and filtering out null/undefined values.
|
|
2524
2536
|
*
|
|
2525
|
-
* @param input -
|
|
2526
|
-
* @returns
|
|
2537
|
+
* @param input - The params object to convert.
|
|
2538
|
+
* @returns A URLSearchParams instance representing the input object.
|
|
2527
2539
|
*/ function fetchURLSearchParamsObjectToURLSearchParams(input) {
|
|
2528
2540
|
var paramTuples = [];
|
|
2529
2541
|
util.forEachKeyValue(input, {
|
|
@@ -2725,9 +2737,9 @@ var returnNullHandleFetchJsonParseErrorFunction = function returnNullHandleFetch
|
|
|
2725
2737
|
/**
|
|
2726
2738
|
* Creates a FetchJsonFunction from the input ConfiguredFetch.
|
|
2727
2739
|
*
|
|
2728
|
-
* @param fetch -
|
|
2729
|
-
* @param inputConfig -
|
|
2730
|
-
* @returns
|
|
2740
|
+
* @param fetch - The configured fetch function to use for making HTTP requests.
|
|
2741
|
+
* @param inputConfig - Optional configuration or error handler for JSON parsing; when a function is provided it is used as the parse error handler.
|
|
2742
|
+
* @returns A FetchJsonFunction that performs requests and parses JSON responses.
|
|
2731
2743
|
*/ function fetchJsonFunction(fetch, inputConfig) {
|
|
2732
2744
|
var _config_handleFetchJsonParseErrorFunction;
|
|
2733
2745
|
var config;
|
|
@@ -2763,8 +2775,8 @@ var returnNullHandleFetchJsonParseErrorFunction = function returnNullHandleFetch
|
|
|
2763
2775
|
* Creates a {@link FetchJsonRequestInitFunction} that converts method/body inputs into a fully formed {@link RequestInit},
|
|
2764
2776
|
* applying the configured default method and optional input mapping.
|
|
2765
2777
|
*
|
|
2766
|
-
* @param config -
|
|
2767
|
-
* @returns
|
|
2778
|
+
* @param config - Default-method and input-mapping overrides applied by the generated function.
|
|
2779
|
+
* @returns Reusable builder that resolves a `RequestInit` for each request.
|
|
2768
2780
|
*/ function fetchJsonRequestInitFunction() {
|
|
2769
2781
|
var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2770
2782
|
var _config_defaultMethod = config.defaultMethod, defaultMethod = _config_defaultMethod === void 0 ? 'GET' : _config_defaultMethod, _config_mapFetchJsonInput = config.mapFetchJsonInput, mapFetchJsonInput = _config_mapFetchJsonInput === void 0 ? util.mapIdentityFunction() : _config_mapFetchJsonInput;
|
|
@@ -2777,7 +2789,10 @@ var returnNullHandleFetchJsonParseErrorFunction = function returnNullHandleFetch
|
|
|
2777
2789
|
body: body
|
|
2778
2790
|
};
|
|
2779
2791
|
} else {
|
|
2780
|
-
config = methodOrInput
|
|
2792
|
+
config = methodOrInput !== null && methodOrInput !== void 0 ? methodOrInput : {
|
|
2793
|
+
method: defaultMethod,
|
|
2794
|
+
body: body
|
|
2795
|
+
};
|
|
2781
2796
|
}
|
|
2782
2797
|
config = mapFetchJsonInput(config);
|
|
2783
2798
|
var requestInit = _object_spread_props(_object_spread({}, config), {
|
|
@@ -2799,8 +2814,8 @@ var fetchJsonRequestInit = fetchJsonRequestInitFunction();
|
|
|
2799
2814
|
});
|
|
2800
2815
|
|
|
2801
2816
|
exports.DEFAULT_FETCH_HANDLER = DEFAULT_FETCH_HANDLER;
|
|
2817
|
+
exports.DEFAULT_FETCH_PAGE_FACTORY_MAX_PAGE = DEFAULT_FETCH_PAGE_FACTORY_MAX_PAGE;
|
|
2802
2818
|
exports.DEFAULT_FETCH_REQUEST_FACTORY = DEFAULT_FETCH_REQUEST_FACTORY;
|
|
2803
|
-
exports.FETCH_PAGE_FACTORY_DEFAULT_MAX_PAGE = FETCH_PAGE_FACTORY_DEFAULT_MAX_PAGE;
|
|
2804
2819
|
exports.FetchPageLimitReachedError = FetchPageLimitReachedError;
|
|
2805
2820
|
exports.FetchPageNoNextPageError = FetchPageNoNextPageError;
|
|
2806
2821
|
exports.FetchRequestFactoryError = FetchRequestFactoryError;
|