@dereekb/util 11.0.7 → 11.0.9
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/fetch/index.cjs.js +45 -2
- package/fetch/index.esm.js +57 -3
- package/fetch/package.json +1 -1
- package/fetch/src/lib/fetch.page.d.ts +15 -12
- package/fetch/src/lib/fetch.page.iterate.d.ts +33 -5
- package/fetch/src/lib/fetch.url.d.ts +22 -0
- package/fetch/src/lib/index.d.ts +1 -0
- package/index.esm.js +4 -0
- package/package.json +1 -1
- package/src/lib/object/object.d.ts +5 -1
- package/src/lib/page/page.d.ts +3 -3
- package/test/CHANGELOG.md +8 -0
- package/test/package.json +1 -1
package/fetch/index.cjs.js
CHANGED
|
@@ -5302,7 +5302,7 @@ function fetchPageFactory(config) {
|
|
|
5302
5302
|
}
|
|
5303
5303
|
|
|
5304
5304
|
/**
|
|
5305
|
-
* Iterates through the pages of a created FetchPage instance.
|
|
5305
|
+
* Iterates through the pages of a created FetchPage instance by each item individually.
|
|
5306
5306
|
*
|
|
5307
5307
|
* @param config
|
|
5308
5308
|
* @returns
|
|
@@ -5397,6 +5397,12 @@ const iterateFetchPages = _async(function (config) {
|
|
|
5397
5397
|
return result;
|
|
5398
5398
|
});
|
|
5399
5399
|
});
|
|
5400
|
+
/**
|
|
5401
|
+
* Iterates through the pages of a created FetchPage instance.
|
|
5402
|
+
*
|
|
5403
|
+
* @param config
|
|
5404
|
+
* @returns
|
|
5405
|
+
*/
|
|
5400
5406
|
const iterateFetchPagesByItems = _async(function (config) {
|
|
5401
5407
|
const {
|
|
5402
5408
|
readItemsFromPageResult,
|
|
@@ -5415,7 +5421,7 @@ const iterateFetchPagesByItems = _async(function (config) {
|
|
|
5415
5421
|
iteratePage: _async(function (fetchPageResult) {
|
|
5416
5422
|
const items = readItemsFromPageResult(fetchPageResult);
|
|
5417
5423
|
return _await(filterPageItems(items, fetchPageResult), function (filteredItems) {
|
|
5418
|
-
return _await(iteratePageItems(filteredItems, fetchPageResult), function (results) {
|
|
5424
|
+
return _await(iteratePageItems(filteredItems, fetchPageResult, totalItemsVisited), function (results) {
|
|
5419
5425
|
totalItemsLoaded += items.length;
|
|
5420
5426
|
totalItemsVisited += filteredItems.length;
|
|
5421
5427
|
hasReachedFinalItem = totalItemsLoaded >= loadItemLimit || totalItemsVisited >= iterateItemsLimit;
|
|
@@ -5427,6 +5433,41 @@ const iterateFetchPagesByItems = _async(function (config) {
|
|
|
5427
5433
|
});
|
|
5428
5434
|
return iterateFetchPages(fetchPagesConfig);
|
|
5429
5435
|
});
|
|
5436
|
+
const iterateFetchPagesByEachItem = _async(function (config) {
|
|
5437
|
+
const {
|
|
5438
|
+
iterateEachPageItem,
|
|
5439
|
+
iteratePerformTasksConfig
|
|
5440
|
+
} = config;
|
|
5441
|
+
return iterateFetchPagesByItems(Object.assign({}, config, {
|
|
5442
|
+
iteratePageItems: _async(function (items, fetchPageResult, startIndex) {
|
|
5443
|
+
const itemIndexPairs = items.map((x, i) => [x, i + startIndex]);
|
|
5444
|
+
return util.performAsyncTasks(itemIndexPairs, ([item, i]) => {
|
|
5445
|
+
return iterateEachPageItem(item, i, fetchPageResult);
|
|
5446
|
+
}, Object.assign({
|
|
5447
|
+
sequential: true
|
|
5448
|
+
}, iteratePerformTasksConfig));
|
|
5449
|
+
})
|
|
5450
|
+
}));
|
|
5451
|
+
});
|
|
5452
|
+
|
|
5453
|
+
/**
|
|
5454
|
+
* Creates URLSearchParams from the input objects. The input objects are merged together.
|
|
5455
|
+
*
|
|
5456
|
+
* @param input
|
|
5457
|
+
* @param omitKeys
|
|
5458
|
+
* @returns
|
|
5459
|
+
*/
|
|
5460
|
+
function makeUrlSearchParams(input, options) {
|
|
5461
|
+
const {
|
|
5462
|
+
omitKeys
|
|
5463
|
+
} = options != null ? options : {};
|
|
5464
|
+
const mergedInput = Array.isArray(input) ? util.mergeObjects(input) : input;
|
|
5465
|
+
const searchParams = new URLSearchParams(mergedInput);
|
|
5466
|
+
if (omitKeys != null) {
|
|
5467
|
+
util.useIterableOrValue(omitKeys, key => searchParams.delete(key), false);
|
|
5468
|
+
}
|
|
5469
|
+
return searchParams;
|
|
5470
|
+
}
|
|
5430
5471
|
|
|
5431
5472
|
var anObject$1 = anObject$e;
|
|
5432
5473
|
|
|
@@ -5683,7 +5724,9 @@ exports.isFetchRequest = isFetchRequest;
|
|
|
5683
5724
|
exports.isURL = isURL;
|
|
5684
5725
|
exports.isURLSearchParams = isURLSearchParams;
|
|
5685
5726
|
exports.iterateFetchPages = iterateFetchPages;
|
|
5727
|
+
exports.iterateFetchPagesByEachItem = iterateFetchPagesByEachItem;
|
|
5686
5728
|
exports.iterateFetchPagesByItems = iterateFetchPagesByItems;
|
|
5729
|
+
exports.makeUrlSearchParams = makeUrlSearchParams;
|
|
5687
5730
|
exports.mergeRequestHeaders = mergeRequestHeaders;
|
|
5688
5731
|
exports.mergeRequestInits = mergeRequestInits;
|
|
5689
5732
|
exports.nodeFetchService = nodeFetchService;
|
package/fetch/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { removeTrailingSlashes, asGetter, multiValueMapBuilder, filterMaybeValues, objectToTuples, fixMultiSlashesInSlashPath, isPromiseLike, cachedGetter, FIRST_PAGE, mapIdentityFunction, performTasksFromFactoryInParallelFunction, isEmptyIterable, fixExtraQueryParameters, forEachInIterable,
|
|
1
|
+
import { removeTrailingSlashes, asGetter, multiValueMapBuilder, filterMaybeValues, objectToTuples, fixMultiSlashesInSlashPath, isPromiseLike, cachedGetter, FIRST_PAGE, performAsyncTasks, mapIdentityFunction, performTasksFromFactoryInParallelFunction, mergeObjects, useIterableOrValue, isEmptyIterable, fixExtraQueryParameters, forEachInIterable, isIterable, forEachKeyValue } from '@dereekb/util';
|
|
2
2
|
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
|
|
@@ -5219,6 +5219,37 @@ function fetchPageFactory(config) {
|
|
|
5219
5219
|
* @deprecated Use FetchPageResult instead.
|
|
5220
5220
|
*/
|
|
5221
5221
|
|
|
5222
|
+
// MARK: IterateFetchPagesByEachItem
|
|
5223
|
+
/**
|
|
5224
|
+
* Function called for each item that was fetched, along with the index and fetch results.
|
|
5225
|
+
*
|
|
5226
|
+
* The index is the overall index this item is from the returned items.
|
|
5227
|
+
*/
|
|
5228
|
+
|
|
5229
|
+
/**
|
|
5230
|
+
* Iterates through the pages of a created FetchPage instance by each item individually.
|
|
5231
|
+
*
|
|
5232
|
+
* @param config
|
|
5233
|
+
* @returns
|
|
5234
|
+
*/
|
|
5235
|
+
async function iterateFetchPagesByEachItem(config) {
|
|
5236
|
+
const {
|
|
5237
|
+
iterateEachPageItem,
|
|
5238
|
+
iteratePerformTasksConfig
|
|
5239
|
+
} = config;
|
|
5240
|
+
return iterateFetchPagesByItems(Object.assign({}, config, {
|
|
5241
|
+
iteratePageItems: async (items, fetchPageResult, startIndex) => {
|
|
5242
|
+
const itemIndexPairs = items.map((x, i) => [x, i + startIndex]);
|
|
5243
|
+
const performTasksResults = await performAsyncTasks(itemIndexPairs, ([item, i]) => {
|
|
5244
|
+
return iterateEachPageItem(item, i, fetchPageResult);
|
|
5245
|
+
}, Object.assign({
|
|
5246
|
+
sequential: true
|
|
5247
|
+
}, iteratePerformTasksConfig));
|
|
5248
|
+
return performTasksResults;
|
|
5249
|
+
}
|
|
5250
|
+
}));
|
|
5251
|
+
}
|
|
5252
|
+
|
|
5222
5253
|
// MARK: IterateFetchPagesByItems
|
|
5223
5254
|
/**
|
|
5224
5255
|
* Filter function used to filter out items.
|
|
@@ -5251,7 +5282,7 @@ async function iterateFetchPagesByItems(config) {
|
|
|
5251
5282
|
iteratePage: async fetchPageResult => {
|
|
5252
5283
|
const items = readItemsFromPageResult(fetchPageResult);
|
|
5253
5284
|
const filteredItems = await filterPageItems(items, fetchPageResult);
|
|
5254
|
-
const results = await iteratePageItems(filteredItems, fetchPageResult);
|
|
5285
|
+
const results = await iteratePageItems(filteredItems, fetchPageResult, totalItemsVisited);
|
|
5255
5286
|
totalItemsLoaded += items.length;
|
|
5256
5287
|
totalItemsVisited += filteredItems.length;
|
|
5257
5288
|
hasReachedFinalItem = totalItemsLoaded >= loadItemLimit || totalItemsVisited >= iterateItemsLimit;
|
|
@@ -5335,6 +5366,29 @@ async function iterateFetchPages(config) {
|
|
|
5335
5366
|
return result;
|
|
5336
5367
|
}
|
|
5337
5368
|
|
|
5369
|
+
/**
|
|
5370
|
+
* Options for makeUrlSearchParams()
|
|
5371
|
+
*/
|
|
5372
|
+
|
|
5373
|
+
/**
|
|
5374
|
+
* Creates URLSearchParams from the input objects. The input objects are merged together.
|
|
5375
|
+
*
|
|
5376
|
+
* @param input
|
|
5377
|
+
* @param omitKeys
|
|
5378
|
+
* @returns
|
|
5379
|
+
*/
|
|
5380
|
+
function makeUrlSearchParams(input, options) {
|
|
5381
|
+
const {
|
|
5382
|
+
omitKeys
|
|
5383
|
+
} = options != null ? options : {};
|
|
5384
|
+
const mergedInput = Array.isArray(input) ? mergeObjects(input) : input;
|
|
5385
|
+
const searchParams = new URLSearchParams(mergedInput);
|
|
5386
|
+
if (omitKeys != null) {
|
|
5387
|
+
useIterableOrValue(omitKeys, key => searchParams.delete(key), false);
|
|
5388
|
+
}
|
|
5389
|
+
return searchParams;
|
|
5390
|
+
}
|
|
5391
|
+
|
|
5338
5392
|
var anObject$1 = anObject$e;
|
|
5339
5393
|
|
|
5340
5394
|
// `RegExp.prototype.flags` getter implementation
|
|
@@ -5572,4 +5626,4 @@ const nodeFetchService = fetchService({
|
|
|
5572
5626
|
makeRequest: (x, y) => new Request(x, y)
|
|
5573
5627
|
});
|
|
5574
5628
|
|
|
5575
|
-
export { FETCH_PAGE_FACTORY_DEFAULT_MAX_PAGE, FetchPageLimitReachedError, FetchPageNoNextPageError, FetchRequestFactoryError, FetchResponseError, FetchTimeoutError, JsonResponseParseError, configureFetch, fetchJsonBodyString, fetchJsonFunction, fetchJsonRequestInit, fetchJsonRequestInitFunction, fetchOk, fetchPageFactory, fetchRequestFactory, fetchService, fetchTimeout, fetchURL, fetchURLQueryKeyValueStringTuples, fetchURLSearchParamsObjectToURLSearchParams, headersToHeadersTuple, isFetchRequest, isURL, isURLSearchParams, iterateFetchPages, iterateFetchPagesByItems, mergeRequestHeaders, mergeRequestInits, nodeFetchService, queryParamsToSearchParams, requireOkResponse, returnNullHandleFetchJsonParseErrorFunction, throwJsonResponseParseErrorFunction };
|
|
5629
|
+
export { FETCH_PAGE_FACTORY_DEFAULT_MAX_PAGE, FetchPageLimitReachedError, FetchPageNoNextPageError, FetchRequestFactoryError, FetchResponseError, FetchTimeoutError, JsonResponseParseError, configureFetch, fetchJsonBodyString, fetchJsonFunction, fetchJsonRequestInit, fetchJsonRequestInitFunction, fetchOk, fetchPageFactory, fetchRequestFactory, fetchService, fetchTimeout, fetchURL, fetchURLQueryKeyValueStringTuples, fetchURLSearchParamsObjectToURLSearchParams, headersToHeadersTuple, isFetchRequest, isURL, isURLSearchParams, iterateFetchPages, iterateFetchPagesByEachItem, iterateFetchPagesByItems, makeUrlSearchParams, mergeRequestHeaders, mergeRequestInits, nodeFetchService, queryParamsToSearchParams, requireOkResponse, returnNullHandleFetchJsonParseErrorFunction, throwJsonResponseParseErrorFunction };
|
package/fetch/package.json
CHANGED
|
@@ -79,7 +79,20 @@ export interface FetchPageFactoryInputOptions {
|
|
|
79
79
|
*/
|
|
80
80
|
readonly maxItemsPerPage?: Maybe<number>;
|
|
81
81
|
}
|
|
82
|
-
export
|
|
82
|
+
export type ReadFetchPageResultInfo = Omit<FetchPageResultInfo, 'page'>;
|
|
83
|
+
export interface FetchPageFactoryConfigDefaults {
|
|
84
|
+
/**
|
|
85
|
+
* The default max page to load up to.
|
|
86
|
+
*
|
|
87
|
+
* Defaults to 100. Pass null to disable the max page amount.
|
|
88
|
+
*/
|
|
89
|
+
readonly defaultMaxPage?: Maybe<number>;
|
|
90
|
+
/**
|
|
91
|
+
* The default maximum number of items to load per page.
|
|
92
|
+
*/
|
|
93
|
+
readonly defaultMaxItemsPerPage?: Maybe<number>;
|
|
94
|
+
}
|
|
95
|
+
export interface FetchPageFactoryConfig<I, O> extends FetchPageFactoryConfigDefaults {
|
|
83
96
|
/**
|
|
84
97
|
* The configured Fetch function that takes in the input and returns a results.
|
|
85
98
|
*/
|
|
@@ -92,7 +105,7 @@ export interface FetchPageFactoryConfig<I, O> {
|
|
|
92
105
|
* @param result
|
|
93
106
|
* @returns
|
|
94
107
|
*/
|
|
95
|
-
readonly readFetchPageResultInfo: (result: O) => PromiseOrValue<
|
|
108
|
+
readonly readFetchPageResultInfo: (result: O) => PromiseOrValue<ReadFetchPageResultInfo>;
|
|
96
109
|
/**
|
|
97
110
|
* Creates new input for the next page that is merged with the previous input.
|
|
98
111
|
*
|
|
@@ -102,16 +115,6 @@ export interface FetchPageFactoryConfig<I, O> {
|
|
|
102
115
|
* @returns
|
|
103
116
|
*/
|
|
104
117
|
readonly buildInputForNextPage: (pageResult: Partial<FetchPageResult<O>>, input: I, options: FetchPageFactoryInputOptions) => PromiseOrValue<Maybe<Partial<I>>>;
|
|
105
|
-
/**
|
|
106
|
-
* The default max page to load up to.
|
|
107
|
-
*
|
|
108
|
-
* Defaults to 100. Pass null to disable the max page amount.
|
|
109
|
-
*/
|
|
110
|
-
readonly defaultMaxPage?: Maybe<number>;
|
|
111
|
-
/**
|
|
112
|
-
* The default maximum number of items to load per page.
|
|
113
|
-
*/
|
|
114
|
-
readonly defaultMaxItemsPerPage?: Maybe<number>;
|
|
115
118
|
}
|
|
116
119
|
export type FetchPageFactoryOptions<I, O> = FetchPageFactoryInputOptions;
|
|
117
120
|
/**
|
|
@@ -1,13 +1,41 @@
|
|
|
1
|
-
import { type DecisionFunction, type IndexNumber, type IndexRef, type Maybe, type Milliseconds, type PromiseOrValue } from '@dereekb/util';
|
|
1
|
+
import { type DecisionFunction, type IndexNumber, type IndexRef, type Maybe, type Milliseconds, type PromiseOrValue, type PerformAsyncTasksConfig, type PerformAsyncTasksResult } from '@dereekb/util';
|
|
2
2
|
import { type FetchPage, type FetchPageFactory, type FetchPageFactoryInputOptions, type FetchPageResult, type FetchPageResultWithInput } from './fetch.page';
|
|
3
|
+
/**
|
|
4
|
+
* Function called for each item that was fetched, along with the index and fetch results.
|
|
5
|
+
*
|
|
6
|
+
* The index is the overall index this item is from the returned items.
|
|
7
|
+
*/
|
|
8
|
+
export type IterateFetchPagesByEachItemFunction<I, O, T, R> = (item: T, i: IndexNumber, fetchPageResult: FetchPageResultWithInput<I, O>) => Promise<R>;
|
|
9
|
+
export type IterateFetchPagesByEachItemPair<T> = readonly [T, IndexNumber];
|
|
10
|
+
export interface IterateFetchPagesByEachItemConfig<I, O, T, R> extends Omit<IterateFetchPagesByItemsConfig<I, O, T, IterateFetchPagesByEachItemResult<T, R>>, 'iteratePageItems'> {
|
|
11
|
+
/**
|
|
12
|
+
* The iterate function per each page result.
|
|
13
|
+
*/
|
|
14
|
+
readonly iterateEachPageItem: IterateFetchPagesByEachItemFunction<I, O, T, R>;
|
|
15
|
+
/**
|
|
16
|
+
* Optional additional configuration to pass to the
|
|
17
|
+
*
|
|
18
|
+
* By default, sequential is true.
|
|
19
|
+
*/
|
|
20
|
+
readonly iteratePerformTasksConfig?: Partial<PerformAsyncTasksConfig<IterateFetchPagesByEachItemPair<T>>>;
|
|
21
|
+
}
|
|
22
|
+
export type IterateFetchPagesByEachItemResult<T, R> = PerformAsyncTasksResult<IterateFetchPagesByEachItemPair<T>, R>;
|
|
23
|
+
/**
|
|
24
|
+
* Iterates through the pages of a created FetchPage instance by each item individually.
|
|
25
|
+
*
|
|
26
|
+
* @param config
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export declare function iterateFetchPagesByEachItem<I, O, T, R>(config: IterateFetchPagesByEachItemConfig<I, O, T, R>): Promise<IterateFetchPagesResult>;
|
|
3
30
|
/**
|
|
4
31
|
* Filter function used to filter out items.
|
|
5
32
|
*
|
|
6
33
|
* @param snapshot
|
|
7
34
|
* @returns
|
|
8
35
|
*/
|
|
9
|
-
export type IterateFetchPagesByItemsFilterFunction<I, O, T> = (items: T[], pageResult:
|
|
10
|
-
export
|
|
36
|
+
export type IterateFetchPagesByItemsFilterFunction<I, O, T> = (items: T[], pageResult: FetchPageResultWithInput<I, O>) => PromiseOrValue<T[]>;
|
|
37
|
+
export type IterateFetchPagesByItemsFunction<I, O, T, R> = (items: T[], fetchPageResult: FetchPageResultWithInput<I, O>, totalItemsVisited: number) => Promise<R>;
|
|
38
|
+
export interface IterateFetchPagesByItemsConfig<I, O, T, R> extends Omit<IterateFetchPagesConfig<I, O, R>, 'iteratePage'> {
|
|
11
39
|
/**
|
|
12
40
|
* Read individual items from page result.
|
|
13
41
|
*
|
|
@@ -42,7 +70,7 @@ export interface IterateFetchPagesByItemsConfig<I, O, T, R> extends Omit<Iterate
|
|
|
42
70
|
/**
|
|
43
71
|
* The iterate function per each page result.
|
|
44
72
|
*/
|
|
45
|
-
iteratePageItems
|
|
73
|
+
readonly iteratePageItems: IterateFetchPagesByItemsFunction<I, O, T, R>;
|
|
46
74
|
}
|
|
47
75
|
/**
|
|
48
76
|
* Iterates through the pages of a created FetchPage instance.
|
|
@@ -84,7 +112,7 @@ export interface BaseIterateFetchPagesConfig<I, O, R> extends FetchPageFactoryIn
|
|
|
84
112
|
/**
|
|
85
113
|
* The iterate function per each page result.
|
|
86
114
|
*/
|
|
87
|
-
iteratePage(result:
|
|
115
|
+
iteratePage(result: FetchPageResultWithInput<I, O>): Promise<R>;
|
|
88
116
|
/**
|
|
89
117
|
* (Optional) Called at the end of each page.
|
|
90
118
|
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Maybe, type ArrayOrValue, type IterableOrValue, type ObjectKey, type FilterKeyValueTuplesInput } from '@dereekb/util';
|
|
2
|
+
/**
|
|
3
|
+
* Options for makeUrlSearchParams()
|
|
4
|
+
*/
|
|
5
|
+
export interface MakeUrlSearchParamsOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Optional iterable of keys to remove from the search params.
|
|
8
|
+
*/
|
|
9
|
+
readonly omitKeys?: Maybe<IterableOrValue<ObjectKey>>;
|
|
10
|
+
/**
|
|
11
|
+
* Optional filter for merging the objects together.
|
|
12
|
+
*/
|
|
13
|
+
readonly mergeFilter?: FilterKeyValueTuplesInput;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates URLSearchParams from the input objects. The input objects are merged together.
|
|
17
|
+
*
|
|
18
|
+
* @param input
|
|
19
|
+
* @param omitKeys
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function makeUrlSearchParams(input: Maybe<ArrayOrValue<Maybe<object | Record<string, string | number>>>>, options?: Maybe<MakeUrlSearchParamsOptions>): URLSearchParams;
|
package/fetch/src/lib/index.d.ts
CHANGED
package/index.esm.js
CHANGED
|
@@ -2788,6 +2788,10 @@ function arrayDecision(values, decision, mode) {
|
|
|
2788
2788
|
return arrayDecisionFunction(decision, mode)(values);
|
|
2789
2789
|
}
|
|
2790
2790
|
|
|
2791
|
+
/**
|
|
2792
|
+
* Key of an object.
|
|
2793
|
+
*/
|
|
2794
|
+
|
|
2791
2795
|
function objectHasNoKeys(obj) {
|
|
2792
2796
|
return Object.keys(obj).length === 0;
|
|
2793
2797
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type FieldOfType } from '../key';
|
|
2
2
|
import { type SetIncludesMode } from '../set/set.mode';
|
|
3
3
|
import { type KeyAsString } from '../type';
|
|
4
|
+
/**
|
|
5
|
+
* Key of an object.
|
|
6
|
+
*/
|
|
7
|
+
export type ObjectKey = string;
|
|
4
8
|
export type EmptyObject = Record<string, never>;
|
|
5
9
|
export declare function objectHasNoKeys(obj: object): obj is EmptyObject;
|
|
6
10
|
export declare function objectHasKey<T>(obj: T, key: KeyAsString<keyof T>): boolean;
|
|
@@ -13,7 +17,7 @@ export declare function objectHasKey<T, K extends keyof T>(obj: T, key: K): bool
|
|
|
13
17
|
* @param keys
|
|
14
18
|
*/
|
|
15
19
|
export declare function objectHasKeys<T>(obj: T, keys: KeyAsString<keyof T>[], mode?: SetIncludesMode): boolean;
|
|
16
|
-
export declare function objectHasKeys(obj: unknown, keys:
|
|
20
|
+
export declare function objectHasKeys(obj: unknown, keys: ObjectKey[], mode?: SetIncludesMode): boolean;
|
|
17
21
|
export declare function objectHasKeys<T, K extends keyof T>(obj: T, keys: K[], mode?: SetIncludesMode): boolean;
|
|
18
22
|
export declare function applyToMultipleFields<T extends object, X = unknown>(value: X, fields: FieldOfType<T>[]): Partial<{
|
|
19
23
|
[K in keyof T]: X;
|
package/src/lib/page/page.d.ts
CHANGED
|
@@ -21,6 +21,6 @@ export interface Page {
|
|
|
21
21
|
*/
|
|
22
22
|
page: PageNumber;
|
|
23
23
|
}
|
|
24
|
-
export declare function getPageNumber(page: Maybe<Page
|
|
25
|
-
export declare function getNextPageNumber(page: Maybe<Page
|
|
26
|
-
export declare function isFinalPage(page: Maybe<Page
|
|
24
|
+
export declare function getPageNumber(page: Maybe<Partial<Page>>): number;
|
|
25
|
+
export declare function getNextPageNumber(page: Maybe<Partial<Page>>): number;
|
|
26
|
+
export declare function isFinalPage(page: Maybe<Partial<Page>>): boolean;
|
package/test/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [11.0.9](https://github.com/dereekb/dbx-components/compare/v11.0.8-dev...v11.0.9) (2024-11-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [11.0.8](https://github.com/dereekb/dbx-components/compare/v11.0.7-dev...v11.0.8) (2024-11-23)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
5
13
|
## [11.0.7](https://github.com/dereekb/dbx-components/compare/v11.0.6-dev...v11.0.7) (2024-11-22)
|
|
6
14
|
|
|
7
15
|
|