@dereekb/util 13.11.1 → 13.11.3
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.default.js +1 -0
- package/eslint/index.cjs.js +607 -0
- package/eslint/index.cjs.mjs +2 -0
- package/eslint/index.d.ts +1 -0
- package/eslint/index.esm.js +603 -0
- package/eslint/package.json +23 -0
- package/eslint/src/index.d.ts +1 -0
- package/eslint/src/lib/comments.d.ts +54 -0
- package/eslint/src/lib/index.d.ts +3 -0
- package/eslint/src/lib/plugin.d.ts +18 -0
- package/eslint/src/lib/prefer-no-side-effects-in-jsdoc.rule.d.ts +42 -0
- package/eslint/src/lib/require-no-side-effects.rule.d.ts +54 -0
- package/fetch/package.json +2 -2
- package/index.cjs.js +1203 -23
- package/index.esm.js +1203 -23
- package/package.json +7 -1
- package/src/lib/array/array.factory.d.ts +2 -0
- package/src/lib/array/array.filter.d.ts +50 -17
- package/src/lib/array/array.find.d.ts +1 -0
- package/src/lib/array/array.index.d.ts +7 -0
- package/src/lib/array/array.indexed.d.ts +21 -0
- package/src/lib/array/array.make.d.ts +7 -0
- package/src/lib/array/array.random.d.ts +1 -0
- package/src/lib/array/array.unique.d.ts +3 -0
- package/src/lib/array/array.value.d.ts +7 -0
- package/src/lib/auth/auth.role.claims.d.ts +7 -0
- package/src/lib/boolean.d.ts +1 -0
- package/src/lib/contact/random.d.ts +14 -0
- package/src/lib/date/date.d.ts +6 -0
- package/src/lib/date/time.d.ts +7 -0
- package/src/lib/date/week.d.ts +7 -0
- package/src/lib/error/error.d.ts +7 -0
- package/src/lib/filter/filter.d.ts +7 -0
- package/src/lib/function/function.boolean.d.ts +7 -0
- package/src/lib/function/function.forward.d.ts +14 -0
- package/src/lib/getter/getter.cache.d.ts +7 -0
- package/src/lib/getter/getter.d.ts +34 -0
- package/src/lib/getter/getter.map.d.ts +7 -0
- package/src/lib/getter/getter.util.d.ts +7 -0
- package/src/lib/grouping.d.ts +8 -0
- package/src/lib/hash.d.ts +1 -0
- package/src/lib/key.d.ts +16 -0
- package/src/lib/map/map.key.d.ts +14 -0
- package/src/lib/model/id.batch.d.ts +7 -0
- package/src/lib/model/id.factory.d.ts +7 -0
- package/src/lib/model/model.conversion.d.ts +35 -0
- package/src/lib/model/model.copy.d.ts +7 -0
- package/src/lib/model/model.d.ts +19 -0
- package/src/lib/model/model.modify.d.ts +14 -0
- package/src/lib/nodejs/stream.d.ts +7 -0
- package/src/lib/number/bound.d.ts +3 -0
- package/src/lib/number/dollar.d.ts +7 -0
- package/src/lib/number/factory.d.ts +7 -0
- package/src/lib/number/random.d.ts +1 -0
- package/src/lib/number/round.d.ts +22 -0
- package/src/lib/number/sort.d.ts +7 -0
- package/src/lib/number/transform.d.ts +7 -0
- package/src/lib/object/object.array.delta.d.ts +7 -0
- package/src/lib/object/object.equal.d.ts +7 -0
- package/src/lib/object/object.filter.pojo.d.ts +87 -0
- package/src/lib/object/object.filter.tuple.d.ts +16 -0
- package/src/lib/object/object.key.d.ts +14 -0
- package/src/lib/object/object.map.d.ts +14 -0
- package/src/lib/path/path.d.ts +9 -0
- package/src/lib/promise/promise.d.ts +21 -0
- package/src/lib/promise/promise.factory.d.ts +7 -0
- package/src/lib/promise/promise.task.d.ts +7 -0
- package/src/lib/service/handler.config.d.ts +28 -0
- package/src/lib/service/handler.d.ts +14 -0
- package/src/lib/set/set.d.ts +21 -0
- package/src/lib/set/set.decision.d.ts +7 -0
- package/src/lib/set/set.delta.d.ts +7 -0
- package/src/lib/set/set.selection.d.ts +7 -0
- package/src/lib/sort.d.ts +8 -0
- package/src/lib/string/char.d.ts +7 -0
- package/src/lib/string/dencoder.d.ts +35 -0
- package/src/lib/string/factory.d.ts +22 -1
- package/src/lib/string/replace.d.ts +78 -0
- package/src/lib/string/search.d.ts +7 -0
- package/src/lib/string/sort.d.ts +7 -0
- package/src/lib/string/string.d.ts +1 -0
- package/src/lib/string/transform.d.ts +53 -0
- package/src/lib/string/tree.d.ts +7 -0
- package/src/lib/string/url.d.ts +7 -0
- package/src/lib/tree/tree.array.d.ts +1 -0
- package/src/lib/tree/tree.explore.d.ts +3 -0
- package/src/lib/type.d.ts +3 -2
- package/src/lib/value/bound.d.ts +28 -0
- package/src/lib/value/comparator.d.ts +16 -0
- package/src/lib/value/decision.d.ts +5 -0
- package/src/lib/value/equal.d.ts +2 -0
- package/src/lib/value/indexed.d.ts +127 -0
- package/src/lib/value/map.d.ts +22 -0
- package/src/lib/value/maybe.type.d.ts +2 -2
- package/src/lib/value/modifier.d.ts +13 -0
- package/src/lib/value/point.d.ts +56 -0
- package/src/lib/value/use.d.ts +37 -0
- package/src/lib/value/vector.d.ts +7 -0
- package/test/index.cjs.js +17 -4
- package/test/index.esm.js +17 -4
- package/test/package.json +2 -2
- package/test/src/lib/shared/shared.fail.d.ts +24 -5
|
@@ -66,6 +66,14 @@ export type FilterKeyValueTuplesFunction<T extends object = object, K extends ke
|
|
|
66
66
|
* const tuples = getDefinedTuples({ a: 1, b: undefined, c: 'hello' });
|
|
67
67
|
* // tuples: [['a', 1], ['c', 'hello']]
|
|
68
68
|
* ```
|
|
69
|
+
*
|
|
70
|
+
* @dbxUtil
|
|
71
|
+
* @dbxUtilCategory object
|
|
72
|
+
* @dbxUtilKind factory
|
|
73
|
+
* @dbxUtilTags object, tuples, filter, factory, key-value
|
|
74
|
+
* @dbxUtilRelated filter-key-value-tuple-function, for-each-key-value
|
|
75
|
+
*
|
|
76
|
+
* @__NO_SIDE_EFFECTS__
|
|
69
77
|
*/
|
|
70
78
|
export declare function filterKeyValueTuplesFunction<T extends object = object, K extends keyof T = keyof T>(filter?: FilterKeyValueTuplesInput<T, K>): FilterKeyValueTuplesFunction<T, K>;
|
|
71
79
|
/**
|
|
@@ -168,5 +176,13 @@ export type FilterKeyValueTupleFunction<T extends object = object, K extends key
|
|
|
168
176
|
* isNotNull(['a', 1], 0); // true
|
|
169
177
|
* isNotNull(['b', null], 0); // false
|
|
170
178
|
* ```
|
|
179
|
+
*
|
|
180
|
+
* @dbxUtil
|
|
181
|
+
* @dbxUtilCategory object
|
|
182
|
+
* @dbxUtilKind factory
|
|
183
|
+
* @dbxUtilTags object, tuple, filter, predicate, factory, key-value
|
|
184
|
+
* @dbxUtilRelated filter-key-value-tuples-function
|
|
185
|
+
*
|
|
186
|
+
* @__NO_SIDE_EFFECTS__
|
|
171
187
|
*/
|
|
172
188
|
export declare function filterKeyValueTupleFunction<T extends object = object, K extends keyof T = keyof T>(inputFilter: FilterKeyValueTuplesInput<T, K>): FilterKeyValueTupleFunction<T, K>;
|
|
@@ -8,8 +8,15 @@ import { type EqualityComparatorFunction } from '../value/comparator';
|
|
|
8
8
|
* Returns `true` if both arrays have the same length and produce identical key sets.
|
|
9
9
|
* Handles `null`/`undefined` inputs via {@link safeEqualityComparatorFunction}.
|
|
10
10
|
*
|
|
11
|
+
* @dbxUtil
|
|
12
|
+
* @dbxUtilCategory object
|
|
13
|
+
* @dbxUtilKind factory
|
|
14
|
+
* @dbxUtilTags object, key, equality, comparator, factory, array
|
|
15
|
+
* @dbxUtilRelated object-key-equality-comparator-function, safe-equality-comparator-function
|
|
16
|
+
*
|
|
11
17
|
* @param readKey - Function to extract one or more keys from each object
|
|
12
18
|
* @returns An equality comparator for arrays of keyed objects
|
|
19
|
+
* @__NO_SIDE_EFFECTS__
|
|
13
20
|
*/
|
|
14
21
|
export declare function objectKeysEqualityComparatorFunction<T, K extends PrimativeKey = PrimativeKey>(readKey: ReadKeyFunction<T, K> | ReadMultipleKeysFunction<T, K>): EqualityComparatorFunction<Maybe<T[]>>;
|
|
15
22
|
/**
|
|
@@ -18,7 +25,14 @@ export declare function objectKeysEqualityComparatorFunction<T, K extends Primat
|
|
|
18
25
|
*
|
|
19
26
|
* Handles `null`/`undefined` inputs via {@link safeEqualityComparatorFunction}.
|
|
20
27
|
*
|
|
28
|
+
* @dbxUtil
|
|
29
|
+
* @dbxUtilCategory object
|
|
30
|
+
* @dbxUtilKind factory
|
|
31
|
+
* @dbxUtilTags object, key, equality, comparator, factory
|
|
32
|
+
* @dbxUtilRelated object-keys-equality-comparator-function, safe-equality-comparator-function
|
|
33
|
+
*
|
|
21
34
|
* @param readKey - Function to extract the key from an object
|
|
22
35
|
* @returns An equality comparator for keyed objects
|
|
36
|
+
* @__NO_SIDE_EFFECTS__
|
|
23
37
|
*/
|
|
24
38
|
export declare function objectKeyEqualityComparatorFunction<T, K extends PrimativeKey = PrimativeKey>(readKey: ReadKeyFunction<T, K>): EqualityComparatorFunction<Maybe<T>>;
|
|
@@ -32,8 +32,15 @@ export type MapObjectMapFunction<M extends ObjectMap<I>, I = unknown, O = unknow
|
|
|
32
32
|
/**
|
|
33
33
|
* Creates a reusable {@link MapObjectMapFunction} that applies {@link mapObjectMap} with the given mapping function.
|
|
34
34
|
*
|
|
35
|
+
* @dbxUtil
|
|
36
|
+
* @dbxUtilCategory object
|
|
37
|
+
* @dbxUtilKind factory
|
|
38
|
+
* @dbxUtilTags object, map, transform, factory, values
|
|
39
|
+
* @dbxUtilRelated map-object-map, map-object-keys-function
|
|
40
|
+
*
|
|
35
41
|
* @param mapFn - Function that transforms each value (receives value and key)
|
|
36
42
|
* @returns A function that maps all values in an input object map
|
|
43
|
+
* @__NO_SIDE_EFFECTS__
|
|
37
44
|
*/
|
|
38
45
|
export declare function mapObjectMapFunction<M extends ObjectMap<I>, I = unknown, O = unknown>(mapFn: MapObjectMapValueFunction<M, I, O>): MapObjectMapFunction<M, I, O>;
|
|
39
46
|
/**
|
|
@@ -68,8 +75,15 @@ export type MapObjectKeyFunction<M> = <K extends keyof M>(key: K, value: M[K]) =
|
|
|
68
75
|
/**
|
|
69
76
|
* Creates a reusable {@link MapObjectKeysFunction} that transforms the keys of an input object using the given mapping function.
|
|
70
77
|
*
|
|
78
|
+
* @dbxUtil
|
|
79
|
+
* @dbxUtilCategory object
|
|
80
|
+
* @dbxUtilKind factory
|
|
81
|
+
* @dbxUtilTags object, map, keys, transform, factory, rename
|
|
82
|
+
* @dbxUtilRelated map-object-map-function, map-object-keys-to-lowercase
|
|
83
|
+
*
|
|
71
84
|
* @param mapKeyFn - Function that computes the new key from the old key and its value
|
|
72
85
|
* @returns A function that remaps keys on any input object
|
|
86
|
+
* @__NO_SIDE_EFFECTS__
|
|
73
87
|
*/
|
|
74
88
|
export declare function mapObjectKeysFunction<M extends object>(mapKeyFn: MapObjectKeyFunction<M>): MapObjectKeysFunction<M>;
|
|
75
89
|
/**
|
package/src/lib/path/path.d.ts
CHANGED
|
@@ -227,6 +227,7 @@ export type SlashPathStartTypeFactory = SlashPathFunction;
|
|
|
227
227
|
*
|
|
228
228
|
* @param type - The start type to enforce.
|
|
229
229
|
* @returns A function that transforms paths to the specified start type.
|
|
230
|
+
* @__NO_SIDE_EFFECTS__
|
|
230
231
|
*/
|
|
231
232
|
export declare function slashPathStartTypeFactory(type: SlashPathStartType): SlashPathStartTypeFactory;
|
|
232
233
|
export declare const LEADING_SLASHES_REGEX: RegExp;
|
|
@@ -286,6 +287,7 @@ export interface SlashPathFolderFactoryConfig {
|
|
|
286
287
|
*
|
|
287
288
|
* @param config Configuration options for the factory.
|
|
288
289
|
* @returns A SlashPathFolderFactory.
|
|
290
|
+
* @__NO_SIDE_EFFECTS__
|
|
289
291
|
*/
|
|
290
292
|
export declare function slashPathFolderFactory(config?: SlashPathFolderFactoryConfig): SlashPathFolderFactory;
|
|
291
293
|
/**
|
|
@@ -400,6 +402,7 @@ export declare function replaceInvalidFilePathTypeSeparatorsInSlashPath(input: S
|
|
|
400
402
|
* @param input
|
|
401
403
|
* @param replaceWith
|
|
402
404
|
* @returns
|
|
405
|
+
* @__NO_SIDE_EFFECTS__
|
|
403
406
|
*/
|
|
404
407
|
export declare function replaceInvalidFilePathTypeSeparatorsInSlashPathFunction(replaceWith?: string): SlashPathFunction;
|
|
405
408
|
/**
|
|
@@ -441,6 +444,7 @@ export interface SlashPathValidationFactoryConfig {
|
|
|
441
444
|
*
|
|
442
445
|
* @param config - Configuration for validation behavior.
|
|
443
446
|
* @returns A function that validates and fixes a slash path.
|
|
447
|
+
* @__NO_SIDE_EFFECTS__
|
|
444
448
|
*/
|
|
445
449
|
export declare function slashPathValidationFactory(config?: SlashPathValidationFactoryConfig): SlashPathValidationFactory;
|
|
446
450
|
/**
|
|
@@ -472,6 +476,7 @@ export interface SlashPathFactoryConfig {
|
|
|
472
476
|
*
|
|
473
477
|
* @param config - Configuration for path generation.
|
|
474
478
|
* @returns A factory function that merges input paths into a single validated slash path.
|
|
479
|
+
* @__NO_SIDE_EFFECTS__
|
|
475
480
|
*/
|
|
476
481
|
export declare function slashPathFactory(config?: SlashPathFactoryConfig): SlashPathFactory;
|
|
477
482
|
/**
|
|
@@ -544,6 +549,7 @@ export type IsolateSlashPathFunction = (path: SlashPath) => SlashPath;
|
|
|
544
549
|
*
|
|
545
550
|
* @param config - Configuration with range, optional start type, and file mode.
|
|
546
551
|
* @returns A function that isolates path segments within the configured range.
|
|
552
|
+
* @__NO_SIDE_EFFECTS__
|
|
547
553
|
*/
|
|
548
554
|
export declare function isolateSlashPathFunction(config: IsolateSlashPathFunctionConfig): IsolateSlashPathFunction;
|
|
549
555
|
export interface SlashPathDetails {
|
|
@@ -655,6 +661,7 @@ export type SlashPathPathMatcherPath = ArrayOrValue<SlashPathPathMatcherPart>;
|
|
|
655
661
|
*
|
|
656
662
|
* @param path - Matcher path parts to expand into decision functions.
|
|
657
663
|
* @returns Array of decision functions for each path part.
|
|
664
|
+
* @__NO_SIDE_EFFECTS__
|
|
658
665
|
*/
|
|
659
666
|
export declare function expandSlashPathPathMatcherPartToDecisionFunctions(path: SlashPathPathMatcherPath): SlashPathPathMatcherFunction[];
|
|
660
667
|
/**
|
|
@@ -744,6 +751,7 @@ export declare function slashPathPathMatcherConfig<N extends PrimativeValue = Pr
|
|
|
744
751
|
*
|
|
745
752
|
* @param input - the matcher configuration, which may be a target path string, an array of path parts, or a full config object
|
|
746
753
|
* @returns The matcher.
|
|
754
|
+
* @__NO_SIDE_EFFECTS__
|
|
747
755
|
*/
|
|
748
756
|
export declare function slashPathPathMatcher<N extends PrimativeValue = PrimativeValue>(input: SlashPathPathMatcherConfigInput<N>): SlashPathPathMatcher<N>;
|
|
749
757
|
export interface SlashPathSubPathMatcherConfig {
|
|
@@ -808,5 +816,6 @@ export type SlashPathSubPathMatcher = (path: SlashPath) => SlashPathSubPathMatch
|
|
|
808
816
|
*
|
|
809
817
|
* @param config The configuration for the matcher.
|
|
810
818
|
* @returns The matcher.
|
|
819
|
+
* @__NO_SIDE_EFFECTS__
|
|
811
820
|
*/
|
|
812
821
|
export declare function slashPathSubPathMatcher(config: SlashPathSubPathMatcherConfig): SlashPathSubPathMatcher;
|
|
@@ -174,8 +174,15 @@ export declare function performTasksInParallel<I, K extends PrimativeKey = Perfo
|
|
|
174
174
|
* Creates a reusable function that performs tasks in parallel with optional concurrency limits
|
|
175
175
|
* and non-concurrent task key constraints.
|
|
176
176
|
*
|
|
177
|
+
* @dbxUtil
|
|
178
|
+
* @dbxUtilCategory promise
|
|
179
|
+
* @dbxUtilKind factory
|
|
180
|
+
* @dbxUtilTags promise, parallel, factory, concurrency, async, tasks
|
|
181
|
+
* @dbxUtilRelated perform-tasks-in-parallel, perform-async-tasks-function
|
|
182
|
+
*
|
|
177
183
|
* @param config - Configuration for task factory, parallelism limits, and concurrency keys.
|
|
178
184
|
* @returns A function that accepts an array of inputs and returns a Promise resolving when all tasks complete.
|
|
185
|
+
* @__NO_SIDE_EFFECTS__
|
|
179
186
|
*/
|
|
180
187
|
export declare function performTasksInParallelFunction<I, K extends PrimativeKey = PerformTasksInParallelTaskUniqueKey>(config: PerformTasksInParallelFunctionConfig<I, K>): PerformTasksInParallelFunction<I>;
|
|
181
188
|
/**
|
|
@@ -229,13 +236,27 @@ export type PerformTaskFactoryTasksInParallelFunction<I> = (taskInputFactory: Pe
|
|
|
229
236
|
* Creates a function that pulls task inputs from a factory and executes them in parallel
|
|
230
237
|
* with configurable concurrency limits and non-concurrent key constraints.
|
|
231
238
|
*
|
|
239
|
+
* @dbxUtil
|
|
240
|
+
* @dbxUtilCategory promise
|
|
241
|
+
* @dbxUtilKind factory
|
|
242
|
+
* @dbxUtilTags promise, parallel, factory, concurrency, async, pull-tasks
|
|
243
|
+
* @dbxUtilRelated perform-tasks-in-parallel-function
|
|
244
|
+
*
|
|
232
245
|
* @param config - Configuration for the task factory, parallelism, and concurrency behavior.
|
|
233
246
|
* @returns a function that accepts a task input factory and returns a Promise that resolves when all tasks complete
|
|
247
|
+
* @__NO_SIDE_EFFECTS__
|
|
234
248
|
*/
|
|
235
249
|
export declare function performTasksFromFactoryInParallelFunction<I, K extends PrimativeKey = PerformTasksInParallelTaskUniqueKey>(config: PerformTasksFromFactoryInParallelFunctionConfig<I, K>): PerformTaskFactoryTasksInParallelFunction<I>;
|
|
236
250
|
/**
|
|
237
251
|
* Creates a default non-concurrent task key factory that generates unique incrementing number strings.
|
|
238
252
|
*
|
|
253
|
+
* @dbxUtil
|
|
254
|
+
* @dbxUtilCategory promise
|
|
255
|
+
* @dbxUtilKind factory
|
|
256
|
+
* @dbxUtilTags promise, parallel, key, factory, unique, incrementing
|
|
257
|
+
* @dbxUtilRelated perform-tasks-in-parallel-function, incrementing-number-factory
|
|
258
|
+
*
|
|
239
259
|
* @returns A {@link StringFactory} that produces unique keys for identifying non-concurrent tasks.
|
|
260
|
+
* @__NO_SIDE_EFFECTS__
|
|
240
261
|
*/
|
|
241
262
|
export declare function makeDefaultNonConcurrentTaskKeyFactory(): StringFactory<any>;
|
|
@@ -43,7 +43,14 @@ export interface TryWithPromiseFactoriesFunctionConfig<I, O> extends TryWithProm
|
|
|
43
43
|
* Creates a {@link TryWithPromiseFactoriesFunction} that sequentially tries each promise factory
|
|
44
44
|
* until one returns a non-null value (or a Maybe value if `successOnMaybe` is true).
|
|
45
45
|
*
|
|
46
|
+
* @dbxUtil
|
|
47
|
+
* @dbxUtilCategory promise
|
|
48
|
+
* @dbxUtilKind factory
|
|
49
|
+
* @dbxUtilTags promise, factory, try, sequential, fallback, async
|
|
50
|
+
* @dbxUtilRelated run-named-async-tasks-function
|
|
51
|
+
*
|
|
46
52
|
* @param config - Configuration including the array of promise factories and default behavior options.
|
|
47
53
|
* @returns A function that tries each factory in order for a given input.
|
|
54
|
+
* @__NO_SIDE_EFFECTS__
|
|
48
55
|
*/
|
|
49
56
|
export declare function tryWithPromiseFactoriesFunction<I, O>(config: TryWithPromiseFactoriesFunctionConfig<I, O>): TryWithPromiseFactoriesFunction<I, O>;
|
|
@@ -52,8 +52,15 @@ export interface RunNamedAsyncTasksResult<T = void> {
|
|
|
52
52
|
/**
|
|
53
53
|
* Creates a new RunNamedAsyncTasksFunction.
|
|
54
54
|
*
|
|
55
|
+
* @dbxUtil
|
|
56
|
+
* @dbxUtilCategory promise
|
|
57
|
+
* @dbxUtilKind factory
|
|
58
|
+
* @dbxUtilTags promise, async, task, factory, named, parallel
|
|
59
|
+
* @dbxUtilRelated try-with-promise-factories-function
|
|
60
|
+
*
|
|
55
61
|
* @param config Optional configuration.
|
|
56
62
|
* @returns A new RunNamedAsyncTasksFunction.
|
|
63
|
+
* @__NO_SIDE_EFFECTS__
|
|
57
64
|
*/
|
|
58
65
|
export declare function runNamedAsyncTasksFunction<T = void>(config?: RunNamedAsyncTasksFunctionConfig<T>): RunNamedAsyncTasksFunction<T>;
|
|
59
66
|
/**
|
|
@@ -25,9 +25,16 @@ export type HandlerSetFunction<T, R = HandleResult> = (handlerFunction: Internal
|
|
|
25
25
|
/**
|
|
26
26
|
* Creates a {@link HandlerSetFunction} that registers a handler function on a pre-defined key.
|
|
27
27
|
*
|
|
28
|
+
* @dbxUtil
|
|
29
|
+
* @dbxUtilCategory service
|
|
30
|
+
* @dbxUtilKind factory
|
|
31
|
+
* @dbxUtilTags service, handler, set, factory, register
|
|
32
|
+
* @dbxUtilRelated handler-mapped-set-function, handler-factory
|
|
33
|
+
*
|
|
28
34
|
* @param accessor - The handler set accessor to register on.
|
|
29
35
|
* @param key - The key (or keys) to associate the handler with.
|
|
30
36
|
* @returns A function that accepts a handler function and registers it for the given key.
|
|
37
|
+
* @__NO_SIDE_EFFECTS__
|
|
31
38
|
*/
|
|
32
39
|
export declare function handlerSetFunction<T, K extends PrimativeKey = string, R = HandleResult>(accessor: HandlerSetAccessor<T, K, R>, key: ArrayOrValue<K>): HandlerSetFunction<T, R>;
|
|
33
40
|
/**
|
|
@@ -39,10 +46,17 @@ export type HandlerMappedSetFunction<I, R = HandleResult> = (handlerFunction: In
|
|
|
39
46
|
* Creates a {@link HandlerMappedSetFunction} that maps the handler's native input type to a different
|
|
40
47
|
* type before invoking the registered handler function.
|
|
41
48
|
*
|
|
49
|
+
* @dbxUtil
|
|
50
|
+
* @dbxUtilCategory service
|
|
51
|
+
* @dbxUtilKind factory
|
|
52
|
+
* @dbxUtilTags service, handler, set, mapped, factory, transform
|
|
53
|
+
* @dbxUtilRelated handler-set-function, handler-mapped-set-function-factory
|
|
54
|
+
*
|
|
42
55
|
* @param accessor - The handler set accessor to register on.
|
|
43
56
|
* @param key - The key (or keys) to associate the handler with.
|
|
44
57
|
* @param mapFn - Function to map from the handler's native type to the handler function's expected type.
|
|
45
58
|
* @returns A function that accepts a mapped handler function and registers it.
|
|
59
|
+
* @__NO_SIDE_EFFECTS__
|
|
46
60
|
*/
|
|
47
61
|
export declare function handlerMappedSetFunction<I, T, K extends PrimativeKey = string, R = HandleResult>(accessor: HandlerSetAccessor<T, K, R>, key: ArrayOrValue<K>, mapFn: MapFunction<T, I>): HandlerMappedSetFunction<I, R>;
|
|
48
62
|
/**
|
|
@@ -52,9 +66,16 @@ export type HandlerMappedSetFunctionFactory<I, K extends PrimativeKey = string,
|
|
|
52
66
|
/**
|
|
53
67
|
* Creates a {@link HandlerMappedSetFunctionFactory} that produces mapped set functions for any given key.
|
|
54
68
|
*
|
|
69
|
+
* @dbxUtil
|
|
70
|
+
* @dbxUtilCategory service
|
|
71
|
+
* @dbxUtilKind factory
|
|
72
|
+
* @dbxUtilTags service, handler, mapped, factory, dispatch
|
|
73
|
+
* @dbxUtilRelated handler-mapped-set-function, handler-set-function
|
|
74
|
+
*
|
|
55
75
|
* @param accessor - The handler set accessor to register on.
|
|
56
76
|
* @param mapFn - Function to map from the handler's native type to the handler function's expected type.
|
|
57
77
|
* @returns A factory that creates HandlerMappedSetFunctions for specific keys.
|
|
78
|
+
* @__NO_SIDE_EFFECTS__
|
|
58
79
|
*/
|
|
59
80
|
export declare function handlerMappedSetFunctionFactory<I, T, K extends PrimativeKey = string, R = HandleResult>(accessor: HandlerSetAccessor<T, K, R>, mapFn: MapFunction<T, I>): HandlerMappedSetFunctionFactory<I, K, R>;
|
|
60
81
|
/**
|
|
@@ -82,7 +103,14 @@ export interface HandlerConfigurerFactoryConfig<C extends HandlerBindAccessor<T,
|
|
|
82
103
|
* Creates a {@link HandlerConfigurerFactory} that produces configurers for binding handler functions
|
|
83
104
|
* to a handler instance with automatic `this` binding.
|
|
84
105
|
*
|
|
106
|
+
* @dbxUtil
|
|
107
|
+
* @dbxUtilCategory service
|
|
108
|
+
* @dbxUtilKind factory
|
|
109
|
+
* @dbxUtilTags service, handler, configurer, factory, bind
|
|
110
|
+
* @dbxUtilRelated handler-bind-accessor, handler-factory
|
|
111
|
+
*
|
|
85
112
|
* @param config - Configuration providing the accessor-to-configurer mapping.
|
|
86
113
|
* @returns A factory that creates HandlerConfigurers for specific handlers.
|
|
114
|
+
* @__NO_SIDE_EFFECTS__
|
|
87
115
|
*/
|
|
88
116
|
export declare function handlerConfigurerFactory<C extends HandlerBindAccessor<T, K, R>, T, K extends PrimativeKey = string, R = HandleResult>(config: HandlerConfigurerFactoryConfig<C, T, K, R>): HandlerConfigurerFactory<C, T, K, R>;
|
|
@@ -93,17 +93,31 @@ export interface HandlerFactoryOptions<R = HandleResult> {
|
|
|
93
93
|
* Creates a {@link HandlerFactory} that produces key-based dispatch handlers.
|
|
94
94
|
* Each handler routes incoming values to registered handler functions based on a key extracted from the value.
|
|
95
95
|
*
|
|
96
|
+
* @dbxUtil
|
|
97
|
+
* @dbxUtilCategory service
|
|
98
|
+
* @dbxUtilKind factory
|
|
99
|
+
* @dbxUtilTags service, handler, factory, dispatch, key
|
|
100
|
+
* @dbxUtilRelated make-handler, handler-set-function, handler-configurer-factory
|
|
101
|
+
*
|
|
96
102
|
* @param readKey - Function to extract the dispatch key from an input value.
|
|
97
103
|
* @param options - Optional configuration for default and negative result values.
|
|
98
104
|
* @returns A factory that creates new Handler instances.
|
|
105
|
+
* @__NO_SIDE_EFFECTS__
|
|
99
106
|
*/
|
|
100
107
|
export declare function handlerFactory<T, K extends PrimativeKey = string>(readKey: ReadKeyFunction<T, K>): HandlerFactory<T, K, HandleResult>;
|
|
101
108
|
export declare function handlerFactory<T, K extends PrimativeKey = string, R = HandleResult>(readKey: ReadKeyFunction<T, K>, options: HandlerFactoryOptions<R>): HandlerFactory<T, K, R>;
|
|
102
109
|
/**
|
|
103
110
|
* Convenience function that creates a new {@link Handler} from the given key reader using default options.
|
|
104
111
|
*
|
|
112
|
+
* @dbxUtil
|
|
113
|
+
* @dbxUtilCategory service
|
|
114
|
+
* @dbxUtilKind factory
|
|
115
|
+
* @dbxUtilTags service, handler, factory, dispatch, key, convenience
|
|
116
|
+
* @dbxUtilRelated handler-factory
|
|
117
|
+
*
|
|
105
118
|
* @param readKey - Function to extract the dispatch key from an input value.
|
|
106
119
|
* @returns A new Handler instance.
|
|
120
|
+
* @__NO_SIDE_EFFECTS__
|
|
107
121
|
*/
|
|
108
122
|
export declare function makeHandler<T, K extends PrimativeKey = string>(readKey: ReadKeyFunction<T, K>): Handler<T, K>;
|
|
109
123
|
/**
|
package/src/lib/set/set.d.ts
CHANGED
|
@@ -204,9 +204,16 @@ export declare function mapValuesToSet<I, O>(values: Iterable<I>, mapFn: MapFunc
|
|
|
204
204
|
/**
|
|
205
205
|
* Creates a {@link SetHasValueFunction} from an {@link IterableOrValue} by first converting it to a Set.
|
|
206
206
|
*
|
|
207
|
+
* @dbxUtil
|
|
208
|
+
* @dbxUtilCategory set
|
|
209
|
+
* @dbxUtilKind factory
|
|
210
|
+
* @dbxUtilTags set, has, decision, factory, membership, exclude
|
|
211
|
+
* @dbxUtilRelated set-has-value-function, set-includes-function
|
|
212
|
+
*
|
|
207
213
|
* @param iterable - The values to create a set from.
|
|
208
214
|
* @param exclude - If true, the returned function returns true for values NOT in the set.
|
|
209
215
|
* @returns A function that tests membership.
|
|
216
|
+
* @__NO_SIDE_EFFECTS__
|
|
210
217
|
*/
|
|
211
218
|
export declare function hasValueFunction<T>(iterable: IterableOrValue<T>, exclude?: boolean): SetHasValueFunction<T>;
|
|
212
219
|
/**
|
|
@@ -216,9 +223,16 @@ export type SetHasValueFunction<T> = (value: T) => boolean;
|
|
|
216
223
|
/**
|
|
217
224
|
* Creates a {@link SetHasValueFunction} for the given set. When `exclude` is true, returns the inverse (true for values not in the set).
|
|
218
225
|
*
|
|
226
|
+
* @dbxUtil
|
|
227
|
+
* @dbxUtilCategory set
|
|
228
|
+
* @dbxUtilKind factory
|
|
229
|
+
* @dbxUtilTags set, has, decision, factory, membership, exclude
|
|
230
|
+
* @dbxUtilRelated has-value-function, set-includes-function
|
|
231
|
+
*
|
|
219
232
|
* @param set - The set to check against.
|
|
220
233
|
* @param exclude - If true, returns true for values NOT in the set.
|
|
221
234
|
* @returns A function that tests membership.
|
|
235
|
+
* @__NO_SIDE_EFFECTS__
|
|
222
236
|
*/
|
|
223
237
|
export declare function setHasValueFunction<T>(set: Set<T>, exclude: boolean): SetHasValueFunction<T>;
|
|
224
238
|
/**
|
|
@@ -263,10 +277,17 @@ export type SetIncludesFunction<T> = (valuesToFind: IterableOrValue<T>) => boole
|
|
|
263
277
|
/**
|
|
264
278
|
* Creates a {@link SetIncludesFunction} that checks whether the set includes given values using the specified mode.
|
|
265
279
|
*
|
|
280
|
+
* @dbxUtil
|
|
281
|
+
* @dbxUtilCategory set
|
|
282
|
+
* @dbxUtilKind factory
|
|
283
|
+
* @dbxUtilTags set, includes, decision, factory, all, any, mode
|
|
284
|
+
* @dbxUtilRelated has-value-function, set-has-value-function
|
|
285
|
+
*
|
|
266
286
|
* @param valuesSet - The reference set.
|
|
267
287
|
* @param mode - Whether to require 'all' values or 'any' value to be present. Defaults to 'all'.
|
|
268
288
|
* @param emptyValuesToFindArrayResult - The result when the values to find are empty.
|
|
269
289
|
* @returns A function that tests inclusion against the set.
|
|
290
|
+
* @__NO_SIDE_EFFECTS__
|
|
270
291
|
*/
|
|
271
292
|
export declare function setIncludesFunction<T>(valuesSet: Set<T>, mode?: SetIncludesMode, emptyValuesToFindArrayResult?: boolean): SetIncludesFunction<T>;
|
|
272
293
|
/**
|
|
@@ -9,9 +9,16 @@ export type IsInSetDecisionFunction<T, V> = DecisionFunction<T> & {
|
|
|
9
9
|
/**
|
|
10
10
|
* Creates an {@link IsInSetDecisionFunction} that checks whether a value (or a derived value) is in the given set.
|
|
11
11
|
*
|
|
12
|
+
* @dbxUtil
|
|
13
|
+
* @dbxUtilCategory set
|
|
14
|
+
* @dbxUtilKind factory
|
|
15
|
+
* @dbxUtilTags set, decision, predicate, factory, membership
|
|
16
|
+
* @dbxUtilRelated has-value-function, set-has-value-function, is-selected-decision-function-factory
|
|
17
|
+
*
|
|
12
18
|
* @param set - The set to check membership against.
|
|
13
19
|
* @param readValue - Optional function to extract the lookup value from the input. Defaults to identity.
|
|
14
20
|
* @returns A decision function that returns true for values found in the set.
|
|
21
|
+
* @__NO_SIDE_EFFECTS__
|
|
15
22
|
*/
|
|
16
23
|
export declare function isInSetDecisionFunction<T>(set: Set<T>): IsInSetDecisionFunction<T, T>;
|
|
17
24
|
export declare function isInSetDecisionFunction<T, V>(set: Set<V>, readValue: (value: T) => V): IsInSetDecisionFunction<T, V>;
|
|
@@ -61,8 +61,15 @@ export interface SetDeltaFunctionConfig<T, K extends PrimativeKey = PrimativeKey
|
|
|
61
61
|
* Creates a {@link SetDeltaFunction} that computes the differences between two iterables,
|
|
62
62
|
* identifying which items were added, removed, or unchanged.
|
|
63
63
|
*
|
|
64
|
+
* @dbxUtil
|
|
65
|
+
* @dbxUtilCategory set
|
|
66
|
+
* @dbxUtilKind factory
|
|
67
|
+
* @dbxUtilTags set, delta, diff, factory, change, added, removed
|
|
68
|
+
* @dbxUtilRelated index-delta-group-function, set-has-value-function
|
|
69
|
+
*
|
|
64
70
|
* @param config - Configuration with the key reader and optional modification detector.
|
|
65
71
|
* @returns A function that compares two iterables and returns an array of change pairs.
|
|
72
|
+
* @__NO_SIDE_EFFECTS__
|
|
66
73
|
*/
|
|
67
74
|
export declare function setDeltaFunction<T>(config: SetDeltaFunctionConfig<T>): SetDeltaFunction<T>;
|
|
68
75
|
/**
|
|
@@ -23,7 +23,14 @@ export interface IsSelectedDecisionFunctionConfig<T, K extends PrimativeKey = Pr
|
|
|
23
23
|
* Creates an {@link IsSelectedDecisionFunctionFactory} that produces decision functions
|
|
24
24
|
* checking whether a value's key is included in a set of selected values.
|
|
25
25
|
*
|
|
26
|
+
* @dbxUtil
|
|
27
|
+
* @dbxUtilCategory set
|
|
28
|
+
* @dbxUtilKind factory
|
|
29
|
+
* @dbxUtilTags set, selection, decision, predicate, factory, key
|
|
30
|
+
* @dbxUtilRelated is-in-set-decision-function
|
|
31
|
+
*
|
|
26
32
|
* @param config - Configuration with the key reader and default behavior.
|
|
27
33
|
* @returns A factory that creates decision functions from a set of selected keys.
|
|
34
|
+
* @__NO_SIDE_EFFECTS__
|
|
28
35
|
*/
|
|
29
36
|
export declare function isSelectedDecisionFunctionFactory<T, K extends PrimativeKey = PrimativeKey>(config: IsSelectedDecisionFunctionConfig<T, K>): IsSelectedDecisionFunctionFactory<T, K>;
|
package/src/lib/sort.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ export declare function compareFnOrder<T>(ascendingCompareFn: AscendingSortCompa
|
|
|
92
92
|
* [{ name: 'Bob' }, { name: 'Alice' }].sort(byName);
|
|
93
93
|
* // [{ name: 'Alice' }, { name: 'Bob' }]
|
|
94
94
|
* ```
|
|
95
|
+
* @__NO_SIDE_EFFECTS__
|
|
95
96
|
*/
|
|
96
97
|
export declare function compareWithMappedValuesFunction<T, V>(mapValue: MapFunction<T, V>, comparesFunction: SortCompareFunction<V>): SortCompareFunction<T>;
|
|
97
98
|
/**
|
|
@@ -167,11 +168,18 @@ export type MinAndMaxFunction<T> = (values: Iterable<T>) => MinAndMaxFunctionRes
|
|
|
167
168
|
* @param compareFn - Ascending sort comparison function used to determine min/max.
|
|
168
169
|
* @returns A function that returns `{ min, max }` or `null` for empty iterables.
|
|
169
170
|
*
|
|
171
|
+
* @dbxUtil
|
|
172
|
+
* @dbxUtilCategory sort
|
|
173
|
+
* @dbxUtilKind factory
|
|
174
|
+
* @dbxUtilTags sort, min, max, factory, iterable, compare
|
|
175
|
+
* @dbxUtilRelated min-and-max-index-items-function, sort-by-number-function
|
|
176
|
+
*
|
|
170
177
|
* @example
|
|
171
178
|
* ```ts
|
|
172
179
|
* const fn = minAndMaxFunction<number>((a, b) => a - b);
|
|
173
180
|
* fn([3, 1, 4, 1, 5]); // { min: 1, max: 5 }
|
|
174
181
|
* fn([]); // null
|
|
175
182
|
* ```
|
|
183
|
+
* @__NO_SIDE_EFFECTS__
|
|
176
184
|
*/
|
|
177
185
|
export declare function minAndMaxFunction<T>(compareFn: SortCompareFunction<T>): MinAndMaxFunction<T>;
|
package/src/lib/string/char.d.ts
CHANGED
|
@@ -42,9 +42,16 @@ export type ReplaceLastCharacterIfIsFunction = (input: string) => string;
|
|
|
42
42
|
* Creates a function that replaces the last character of a string with the replacement string
|
|
43
43
|
* if that character matches any of the specified values.
|
|
44
44
|
*
|
|
45
|
+
* @dbxUtil
|
|
46
|
+
* @dbxUtilCategory string
|
|
47
|
+
* @dbxUtilKind factory
|
|
48
|
+
* @dbxUtilTags string, replace, last, character, conditional, factory
|
|
49
|
+
* @dbxUtilRelated replace-last-character-if, replace-character-at-index-if
|
|
50
|
+
*
|
|
45
51
|
* @param replacement - string to substitute for the last character
|
|
46
52
|
* @param is - character(s) that trigger the replacement
|
|
47
53
|
* @returns a function that conditionally replaces the last character
|
|
54
|
+
* @__NO_SIDE_EFFECTS__
|
|
48
55
|
*/
|
|
49
56
|
export declare function replaceLastCharacterIfIsFunction(replacement: string, is: ArrayOrValue<string>): ReplaceLastCharacterIfIsFunction;
|
|
50
57
|
/**
|
|
@@ -69,9 +69,16 @@ export declare const PRIMATIVE_KEY_DENCODER_VALUE: (_input: unknown) => null;
|
|
|
69
69
|
* Creates a new {@link PrimativeKeyDencoderFunction} that can bidirectionally encode/decode
|
|
70
70
|
* primitive key values based on the configured value pairs.
|
|
71
71
|
*
|
|
72
|
+
* @dbxUtil
|
|
73
|
+
* @dbxUtilCategory string
|
|
74
|
+
* @dbxUtilKind factory
|
|
75
|
+
* @dbxUtilTags string, encode, decode, dencoder, bidirectional, factory, primitive
|
|
76
|
+
* @dbxUtilRelated primative-key-dencoder-map, primative-key-string-dencoder
|
|
77
|
+
*
|
|
72
78
|
* @param config - configuration with value pairs and optional default fallback
|
|
73
79
|
* @returns a function that encodes or decodes single values or arrays
|
|
74
80
|
* @throws Error if a single value lookup produces a null result and no default handles it
|
|
81
|
+
* @__NO_SIDE_EFFECTS__
|
|
75
82
|
*/
|
|
76
83
|
export declare function primativeKeyDencoder<D extends PrimativeKey, E extends PrimativeKey>(config: PrimativeKeyDencoderConfig<D, E>): PrimativeKeyDencoderFunction<D, E>;
|
|
77
84
|
/**
|
|
@@ -101,9 +108,16 @@ export type PrimativeKeyStringDencoderFunction<D extends PrimativeKey, E extends
|
|
|
101
108
|
* When no splitter is defined, all encoded values must be exactly one character long so the string
|
|
102
109
|
* can be split character-by-character.
|
|
103
110
|
*
|
|
111
|
+
* @dbxUtil
|
|
112
|
+
* @dbxUtilCategory string
|
|
113
|
+
* @dbxUtilKind factory
|
|
114
|
+
* @dbxUtilTags string, encode, decode, dencoder, splitter, factory, primitive
|
|
115
|
+
* @dbxUtilRelated primative-key-dencoder, primative-key-dencoder-map
|
|
116
|
+
*
|
|
104
117
|
* @param config - configuration with dencoder and optional splitter
|
|
105
118
|
* @returns a bidirectional function for string-to-array and array-to-string conversion
|
|
106
119
|
* @throws Error if encoded values contain the splitter character, or if values exceed one character when no splitter is defined
|
|
120
|
+
* @__NO_SIDE_EFFECTS__
|
|
107
121
|
*/
|
|
108
122
|
export declare function primativeKeyStringDencoder<D extends PrimativeKey, E extends PrimativeKey>(config: PrimativeKeyStringDencoderConfig<D, E>): PrimativeKeyStringDencoderFunction<D, E>;
|
|
109
123
|
/**
|
|
@@ -211,23 +225,44 @@ export type NumberStringDencoderFunction = ((input: NumberStringDencoderString)
|
|
|
211
225
|
* Creates a {@link NumberStringDencoderFunction} from the given dencoder.
|
|
212
226
|
* The returned function auto-detects the input type: numbers are encoded, strings are decoded.
|
|
213
227
|
*
|
|
228
|
+
* @dbxUtil
|
|
229
|
+
* @dbxUtilCategory string
|
|
230
|
+
* @dbxUtilKind factory
|
|
231
|
+
* @dbxUtilTags string, number, encode, decode, dencoder, bidirectional, factory
|
|
232
|
+
* @dbxUtilRelated number-string-dencoder, number-string-dencoder-encoded-string-value-function, number-string-dencoder-decoded-number-value-function
|
|
233
|
+
*
|
|
214
234
|
* @param dencoder - the NumberStringDencoder to wrap
|
|
215
235
|
* @returns a bidirectional encode/decode function
|
|
236
|
+
* @__NO_SIDE_EFFECTS__
|
|
216
237
|
*/
|
|
217
238
|
export declare function numberStringDencoderFunction(dencoder: NumberStringDencoder): NumberStringDencoderFunction;
|
|
218
239
|
/**
|
|
219
240
|
* Creates a function that always returns the encoded string form of the input.
|
|
220
241
|
* Numbers are encoded; strings are passed through as-is.
|
|
221
242
|
*
|
|
243
|
+
* @dbxUtil
|
|
244
|
+
* @dbxUtilCategory string
|
|
245
|
+
* @dbxUtilKind factory
|
|
246
|
+
* @dbxUtilTags string, number, encode, normalize, factory
|
|
247
|
+
* @dbxUtilRelated number-string-dencoder-function, number-string-dencoder-decoded-number-value-function
|
|
248
|
+
*
|
|
222
249
|
* @param dencoder - the NumberStringDencoder to use for encoding
|
|
223
250
|
* @returns a function that normalizes input to an encoded string
|
|
251
|
+
* @__NO_SIDE_EFFECTS__
|
|
224
252
|
*/
|
|
225
253
|
export declare function numberStringDencoderEncodedStringValueFunction(dencoder: NumberStringDencoder): (input: NumberStringDencoderString | NumberStringDencoderNumber) => NumberStringDencoderString;
|
|
226
254
|
/**
|
|
227
255
|
* Creates a function that always returns the decoded number form of the input.
|
|
228
256
|
* Strings are decoded; numbers are passed through as-is.
|
|
229
257
|
*
|
|
258
|
+
* @dbxUtil
|
|
259
|
+
* @dbxUtilCategory string
|
|
260
|
+
* @dbxUtilKind factory
|
|
261
|
+
* @dbxUtilTags string, number, decode, normalize, factory
|
|
262
|
+
* @dbxUtilRelated number-string-dencoder-function, number-string-dencoder-encoded-string-value-function
|
|
263
|
+
*
|
|
230
264
|
* @param dencoder - the NumberStringDencoder to use for decoding
|
|
231
265
|
* @returns a function that normalizes input to a decoded number
|
|
266
|
+
* @__NO_SIDE_EFFECTS__
|
|
232
267
|
*/
|
|
233
268
|
export declare function numberStringDencoderDecodedNumberValueFunction(dencoder: NumberStringDencoder): (input: NumberStringDencoderString | NumberStringDencoderNumber) => NumberStringDencoderNumber;
|
|
@@ -12,9 +12,16 @@ export type ToStringFunction<T, K extends string = string> = FactoryWithRequired
|
|
|
12
12
|
/**
|
|
13
13
|
* Wraps an existing factory with a {@link ToStringFunction} to produce strings from the factory's output.
|
|
14
14
|
*
|
|
15
|
+
* @dbxUtil
|
|
16
|
+
* @dbxUtilCategory string
|
|
17
|
+
* @dbxUtilKind factory
|
|
18
|
+
* @dbxUtilTags string, factory, wrap, transform, to-string
|
|
19
|
+
* @dbxUtilRelated string-from-date-factory, string-from-time-factory
|
|
20
|
+
*
|
|
15
21
|
* @param factory - the original value factory
|
|
16
22
|
* @param toStringFunction - function to convert the factory's output to a string
|
|
17
23
|
* @returns a new factory that produces string values
|
|
24
|
+
* @__NO_SIDE_EFFECTS__
|
|
18
25
|
*/
|
|
19
26
|
export declare function stringFactoryFromFactory<T, K extends string = string>(factory: Factory<T>, toStringFunction: ToStringFunction<T, K>): StringFactory<K>;
|
|
20
27
|
/**
|
|
@@ -42,15 +49,29 @@ export interface StringFromDateConfig {
|
|
|
42
49
|
}
|
|
43
50
|
/**
|
|
44
51
|
* Creates a factory that returns a string based on the input date.
|
|
45
|
-
|
|
52
|
+
*
|
|
53
|
+
* @dbxUtil
|
|
54
|
+
* @dbxUtilCategory string
|
|
55
|
+
* @dbxUtilKind factory
|
|
56
|
+
* @dbxUtilTags string, date, factory, transform, slice
|
|
57
|
+
* @dbxUtilRelated string-from-time-factory, string-factory-from-factory, transform-string-function
|
|
58
|
+
*
|
|
46
59
|
* @param config Configuration for the factory.
|
|
47
60
|
* @returns A factory that returns a string based on the input date.
|
|
61
|
+
* @__NO_SIDE_EFFECTS__
|
|
48
62
|
*/
|
|
49
63
|
export declare function stringFromDateFactory(config: StringFromDateConfig): StringFromDateFactory;
|
|
50
64
|
/**
|
|
51
65
|
* Creates a factory that returns a string based on the Unix timestamp of the input date.
|
|
52
66
|
*
|
|
67
|
+
* @dbxUtil
|
|
68
|
+
* @dbxUtilCategory string
|
|
69
|
+
* @dbxUtilKind factory
|
|
70
|
+
* @dbxUtilTags string, date, time, timestamp, factory, suffix
|
|
71
|
+
* @dbxUtilRelated string-from-date-factory
|
|
72
|
+
*
|
|
53
73
|
* @param digitsFromEnd The number of digits to return from the end of the generated string. Defaults to 7.
|
|
54
74
|
* @returns A StringFromDateFactory.
|
|
75
|
+
* @__NO_SIDE_EFFECTS__
|
|
55
76
|
*/
|
|
56
77
|
export declare function stringFromTimeFactory(digitsFromEnd?: number): StringFromDateFactory;
|