@dereekb/util 13.11.14 → 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
|
@@ -8,14 +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
|
+
* @param readKey - Function to extract one or more keys from each object.
|
|
12
|
+
* @returns An equality comparator for arrays of keyed objects.
|
|
13
|
+
*
|
|
11
14
|
* @dbxUtil
|
|
12
15
|
* @dbxUtilCategory object
|
|
13
16
|
* @dbxUtilKind factory
|
|
14
17
|
* @dbxUtilTags object, key, equality, comparator, factory, array
|
|
15
18
|
* @dbxUtilRelated object-key-equality-comparator-function, safe-equality-comparator-function
|
|
16
19
|
*
|
|
17
|
-
* @param readKey - Function to extract one or more keys from each object
|
|
18
|
-
* @returns An equality comparator for arrays of keyed objects
|
|
19
20
|
* @__NO_SIDE_EFFECTS__
|
|
20
21
|
*/
|
|
21
22
|
export declare function objectKeysEqualityComparatorFunction<T, K extends PrimativeKey = PrimativeKey>(readKey: ReadKeyFunction<T, K> | ReadMultipleKeysFunction<T, K>): EqualityComparatorFunction<Maybe<T[]>>;
|
|
@@ -25,14 +26,15 @@ export declare function objectKeysEqualityComparatorFunction<T, K extends Primat
|
|
|
25
26
|
*
|
|
26
27
|
* Handles `null`/`undefined` inputs via {@link safeEqualityComparatorFunction}.
|
|
27
28
|
*
|
|
29
|
+
* @param readKey - Function to extract the key from an object.
|
|
30
|
+
* @returns An equality comparator for keyed objects.
|
|
31
|
+
*
|
|
28
32
|
* @dbxUtil
|
|
29
33
|
* @dbxUtilCategory object
|
|
30
34
|
* @dbxUtilKind factory
|
|
31
35
|
* @dbxUtilTags object, key, equality, comparator, factory
|
|
32
36
|
* @dbxUtilRelated object-keys-equality-comparator-function, safe-equality-comparator-function
|
|
33
37
|
*
|
|
34
|
-
* @param readKey - Function to extract the key from an object
|
|
35
|
-
* @returns An equality comparator for keyed objects
|
|
36
38
|
* @__NO_SIDE_EFFECTS__
|
|
37
39
|
*/
|
|
38
40
|
export declare function objectKeyEqualityComparatorFunction<T, K extends PrimativeKey = PrimativeKey>(readKey: ReadKeyFunction<T, K>): EqualityComparatorFunction<Maybe<T>>;
|
|
@@ -21,8 +21,8 @@ export type MappedObjectMap<M extends object, O> = {
|
|
|
21
21
|
/**
|
|
22
22
|
* Converts an {@link ObjectMap} into a `Map` using `Object.entries`.
|
|
23
23
|
*
|
|
24
|
-
* @param object - The object map to convert
|
|
25
|
-
* @returns A `Map` with the same key-value pairs
|
|
24
|
+
* @param object - The object map to convert.
|
|
25
|
+
* @returns A `Map` with the same key-value pairs.
|
|
26
26
|
*/
|
|
27
27
|
export declare function objectToMap<T>(object: ObjectMap<T>): Map<string, T>;
|
|
28
28
|
/**
|
|
@@ -32,14 +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
|
+
* @param mapFn - Function that transforms each value (receives value and key)
|
|
36
|
+
* @returns Maps all values in an input object map.
|
|
37
|
+
*
|
|
35
38
|
* @dbxUtil
|
|
36
39
|
* @dbxUtilCategory object
|
|
37
40
|
* @dbxUtilKind factory
|
|
38
41
|
* @dbxUtilTags object, map, transform, factory, values
|
|
39
42
|
* @dbxUtilRelated map-object-map, map-object-keys-function
|
|
40
43
|
*
|
|
41
|
-
* @param mapFn - Function that transforms each value (receives value and key)
|
|
42
|
-
* @returns A function that maps all values in an input object map
|
|
43
44
|
* @__NO_SIDE_EFFECTS__
|
|
44
45
|
*/
|
|
45
46
|
export declare function mapObjectMapFunction<M extends ObjectMap<I>, I = unknown, O = unknown>(mapFn: MapObjectMapValueFunction<M, I, O>): MapObjectMapFunction<M, I, O>;
|
|
@@ -50,18 +51,18 @@ export type MapObjectMapValueFunction<M extends ObjectMap<I>, I = unknown, O = u
|
|
|
50
51
|
/**
|
|
51
52
|
* Maps all values of an {@link ObjectMap} from one type to another, returning a new object with the same keys.
|
|
52
53
|
*
|
|
53
|
-
* @param object - The source object map
|
|
54
|
-
* @param mapFn - Function that transforms each value
|
|
55
|
-
* @returns A new object with mapped values
|
|
54
|
+
* @param object - The source object map.
|
|
55
|
+
* @param mapFn - Function that transforms each value.
|
|
56
|
+
* @returns A new object with mapped values.
|
|
56
57
|
*/
|
|
57
58
|
export declare function mapObjectMap<M extends ObjectMap<I>, I = unknown, O = unknown>(object: M, mapFn: MapObjectMapValueFunction<M, I, O>): MappedObjectMap<M, O>;
|
|
58
59
|
/**
|
|
59
60
|
* Maps the values of a source {@link ObjectMap} and assigns the results onto the target object, returning the target.
|
|
60
61
|
*
|
|
61
|
-
* @param object - The source object map
|
|
62
|
-
* @param target - The target object to assign mapped values onto
|
|
63
|
-
* @param mapFn - Function that transforms each value
|
|
64
|
-
* @returns The target object with mapped values assigned
|
|
62
|
+
* @param object - The source object map.
|
|
63
|
+
* @param target - The target object to assign mapped values onto.
|
|
64
|
+
* @param mapFn - Function that transforms each value.
|
|
65
|
+
* @returns The target object with mapped values assigned.
|
|
65
66
|
*/
|
|
66
67
|
export declare function mapObjectToTargetObject<M extends ObjectMap<I>, I = unknown, O = unknown>(object: M, target: MappedObjectMap<M, O>, mapFn: MapObjectMapValueFunction<M, I, O>): MappedObjectMap<M, O>;
|
|
67
68
|
/**
|
|
@@ -75,14 +76,15 @@ export type MapObjectKeyFunction<M> = <K extends keyof M>(key: K, value: M[K]) =
|
|
|
75
76
|
/**
|
|
76
77
|
* Creates a reusable {@link MapObjectKeysFunction} that transforms the keys of an input object using the given mapping function.
|
|
77
78
|
*
|
|
79
|
+
* @param mapKeyFn - Function that computes the new key from the old key and its value.
|
|
80
|
+
* @returns Remaps keys on any input object.
|
|
81
|
+
*
|
|
78
82
|
* @dbxUtil
|
|
79
83
|
* @dbxUtilCategory object
|
|
80
84
|
* @dbxUtilKind factory
|
|
81
85
|
* @dbxUtilTags object, map, keys, transform, factory, rename
|
|
82
86
|
* @dbxUtilRelated map-object-map-function, map-object-keys-to-lowercase
|
|
83
87
|
*
|
|
84
|
-
* @param mapKeyFn - Function that computes the new key from the old key and its value
|
|
85
|
-
* @returns A function that remaps keys on any input object
|
|
86
88
|
* @__NO_SIDE_EFFECTS__
|
|
87
89
|
*/
|
|
88
90
|
export declare function mapObjectKeysFunction<M extends object>(mapKeyFn: MapObjectKeyFunction<M>): MapObjectKeysFunction<M>;
|
package/src/lib/page/page.d.ts
CHANGED
|
@@ -32,21 +32,21 @@ export interface Page {
|
|
|
32
32
|
/**
|
|
33
33
|
* Extracts the page number from a {@link Page} object, returning {@link UNLOADED_PAGE} if the input is nullish.
|
|
34
34
|
*
|
|
35
|
-
* @param page - Page object to read from
|
|
36
|
-
* @returns The page number, or {@link UNLOADED_PAGE} (-1) if not provided
|
|
35
|
+
* @param page - Page object to read from.
|
|
36
|
+
* @returns The page number, or {@link UNLOADED_PAGE} (-1) if not provided.
|
|
37
37
|
*/
|
|
38
38
|
export declare function getPageNumber(page: Maybe<Partial<Page>>): number;
|
|
39
39
|
/**
|
|
40
40
|
* Returns the next sequential page number after the given page.
|
|
41
41
|
*
|
|
42
|
-
* @param page - Current page object
|
|
43
|
-
* @returns The current page number plus one
|
|
42
|
+
* @param page - Current page object.
|
|
43
|
+
* @returns The current page number plus one.
|
|
44
44
|
*/
|
|
45
45
|
export declare function getNextPageNumber(page: Maybe<Partial<Page>>): number;
|
|
46
46
|
/**
|
|
47
47
|
* Checks whether the given page represents the final page of results.
|
|
48
48
|
*
|
|
49
|
-
* @param page - Page object to check
|
|
49
|
+
* @param page - Page object to check.
|
|
50
50
|
* @returns `true` if the page number equals {@link FINAL_PAGE}
|
|
51
51
|
*/
|
|
52
52
|
export declare function isFinalPage(page: Maybe<Partial<Page>>): boolean;
|
|
@@ -28,9 +28,9 @@ export interface FilteredPageIterateFn<T> {
|
|
|
28
28
|
/**
|
|
29
29
|
* Creates a {@link FilteredPage} combining a page number with an optional filter copied from the request.
|
|
30
30
|
*
|
|
31
|
-
* @param page - The page number
|
|
32
|
-
* @param request - Optional filter to copy into the result
|
|
33
|
-
* @returns A new filtered page object
|
|
31
|
+
* @param page - The page number.
|
|
32
|
+
* @param request - Optional filter to copy into the result.
|
|
33
|
+
* @returns A new filtered page object.
|
|
34
34
|
*/
|
|
35
35
|
export declare function filteredPage<F = unknown>(page: PageNumber, request?: Filter<F>): FilteredPage<F>;
|
|
36
36
|
/**
|
|
@@ -39,10 +39,10 @@ export declare function filteredPage<F = unknown>(page: PageNumber, request?: Fi
|
|
|
39
39
|
* Starts from the given page and increments the page number after each load. Stops when
|
|
40
40
|
* `loadFn` returns an empty array. Either `iterFn.use` or `iterFn.usePage` must be provided.
|
|
41
41
|
*
|
|
42
|
-
* @param inputPage - Starting page with optional filter
|
|
43
|
-
* @param loadFn - Async function that loads a page of results
|
|
44
|
-
* @param iterFn - Callbacks for processing each item or page
|
|
45
|
-
* @returns The total number of items processed across all pages
|
|
46
|
-
* @throws Error
|
|
42
|
+
* @param inputPage - Starting page with optional filter.
|
|
43
|
+
* @param loadFn - Async function that loads a page of results.
|
|
44
|
+
* @param iterFn - Callbacks for processing each item or page.
|
|
45
|
+
* @returns The total number of items processed across all pages.
|
|
46
|
+
* @throws {Error} If neither `use` nor `usePage` is specified in `iterFn`
|
|
47
47
|
*/
|
|
48
48
|
export declare function iterateFilteredPages<T, F>(inputPage: FilteredPage<F>, loadFn: (page: FilteredPage<F>) => Promise<T[]>, iterFn: FilteredPageIterateFn<T>): Promise<number>;
|
package/src/lib/path/path.d.ts
CHANGED
|
@@ -124,85 +124,85 @@ export type SlashPathType = 'folder' | 'file' | 'typedfile' | 'invalid';
|
|
|
124
124
|
/**
|
|
125
125
|
* Determines the type of a slash path string.
|
|
126
126
|
*
|
|
127
|
+
* @param input - The slash path to classify.
|
|
128
|
+
* @returns The path type classification.
|
|
129
|
+
*
|
|
127
130
|
* @dbxUtil
|
|
128
131
|
* @dbxUtilCategory path
|
|
129
132
|
* @dbxUtilTags path, slash, type, classify, file, folder, typed, detect
|
|
130
133
|
* @dbxUtilRelated is-slash-path-file, is-slash-path-folder, is-slash-path-typed-file, is-valid-slash-path
|
|
131
|
-
*
|
|
132
|
-
* @param input - The slash path to classify.
|
|
133
|
-
* @returns The path type classification.
|
|
134
134
|
*/
|
|
135
135
|
export declare function slashPathType(input: SlashPath): SlashPathType;
|
|
136
136
|
/**
|
|
137
137
|
* Type guard that checks if the input is a file path (typed or untyped).
|
|
138
138
|
*
|
|
139
|
+
* @param input - The string to check.
|
|
140
|
+
* @returns Whether the input is a file path.
|
|
141
|
+
*
|
|
139
142
|
* @dbxUtil
|
|
140
143
|
* @dbxUtilCategory path
|
|
141
144
|
* @dbxUtilTags path, slash, file, type-guard, predicate, check, is
|
|
142
145
|
* @dbxUtilRelated is-slash-path-typed-file, is-slash-path-folder, slash-path-type
|
|
143
|
-
*
|
|
144
|
-
* @param input - The string to check.
|
|
145
|
-
* @returns Whether the input is a file path.
|
|
146
146
|
*/
|
|
147
147
|
export declare function isSlashPathFile(input: string): input is SlashPathFile;
|
|
148
148
|
/**
|
|
149
149
|
* Type guard that checks if the input is a typed file path (contains a file extension).
|
|
150
150
|
*
|
|
151
|
+
* @param input - The string to check.
|
|
152
|
+
* @returns Whether the input is a typed file path.
|
|
153
|
+
*
|
|
151
154
|
* @dbxUtil
|
|
152
155
|
* @dbxUtilCategory path
|
|
153
156
|
* @dbxUtilTags path, slash, file, extension, type-guard, predicate, typed
|
|
154
157
|
* @dbxUtilRelated is-slash-path-file, is-slash-path-folder, slash-path-type
|
|
155
|
-
*
|
|
156
|
-
* @param input - The string to check.
|
|
157
|
-
* @returns Whether the input is a typed file path.
|
|
158
158
|
*/
|
|
159
159
|
export declare function isSlashPathTypedFile(input: string): input is SlashPathTypedFile;
|
|
160
160
|
/**
|
|
161
161
|
* Type guard that checks if the input is a folder path (ends with a slash).
|
|
162
162
|
*
|
|
163
|
+
* @param input - The string to check.
|
|
164
|
+
* @returns Whether the input is a folder path.
|
|
165
|
+
*
|
|
163
166
|
* @dbxUtil
|
|
164
167
|
* @dbxUtilCategory path
|
|
165
168
|
* @dbxUtilTags path, slash, folder, directory, type-guard, predicate, trailing
|
|
166
169
|
* @dbxUtilRelated is-slash-path-file, is-valid-slash-path, slash-path-type
|
|
167
|
-
*
|
|
168
|
-
* @param input - The string to check.
|
|
169
|
-
* @returns Whether the input is a folder path.
|
|
170
170
|
*/
|
|
171
171
|
export declare function isSlashPathFolder(input: string): input is SlashPathFolder;
|
|
172
172
|
/**
|
|
173
173
|
* Type guard that checks if the input is a valid slash path (not 'invalid' type).
|
|
174
174
|
*
|
|
175
|
+
* @param input - The string to check.
|
|
176
|
+
* @returns Whether the input is a valid slash path.
|
|
177
|
+
*
|
|
175
178
|
* @dbxUtil
|
|
176
179
|
* @dbxUtilCategory path
|
|
177
180
|
* @dbxUtilTags path, slash, valid, type-guard, predicate, check, validate
|
|
178
181
|
* @dbxUtilRelated slash-path-type, slash-path-validation-factory, slash-path-invalid-error
|
|
179
|
-
*
|
|
180
|
-
* @param input - The string to check.
|
|
181
|
-
* @returns Whether the input is a valid slash path.
|
|
182
182
|
*/
|
|
183
183
|
export declare function isValidSlashPath(input: string): input is SlashPath;
|
|
184
184
|
/**
|
|
185
185
|
* Returns the last part of the slash path.
|
|
186
186
|
*
|
|
187
|
+
* @param slashPath - The path to extract the name from.
|
|
188
|
+
* @returns The last part of the path (file name or folder name).
|
|
189
|
+
*
|
|
187
190
|
* @dbxUtil
|
|
188
191
|
* @dbxUtilCategory path
|
|
189
192
|
* @dbxUtilTags path, slash, name, last, basename, leaf, file, folder
|
|
190
193
|
* @dbxUtilRelated slash-path-parts, slash-path-details, isolate-slash-path
|
|
191
|
-
*
|
|
192
|
-
* @param slashPath - The path to extract the name from.
|
|
193
|
-
* @returns The last part of the path (file name or folder name).
|
|
194
194
|
*/
|
|
195
195
|
export declare function slashPathName(slashPath: SlashPath): SlashPathPart;
|
|
196
196
|
/**
|
|
197
197
|
* Returns each section of a SlashPath.
|
|
198
198
|
*
|
|
199
|
+
* @param slashPath - The path to split.
|
|
200
|
+
* @returns Array of non-empty path segments.
|
|
201
|
+
*
|
|
199
202
|
* @dbxUtil
|
|
200
203
|
* @dbxUtilCategory path
|
|
201
204
|
* @dbxUtilTags path, slash, split, parts, segments, sections, components
|
|
202
205
|
* @dbxUtilRelated slash-path-name, slash-path-details, isolate-slash-path
|
|
203
|
-
*
|
|
204
|
-
* @param slashPath - The path to split.
|
|
205
|
-
* @returns Array of non-empty path segments.
|
|
206
206
|
*/
|
|
207
207
|
export declare function slashPathParts(slashPath: SlashPath): SlashPathPart[];
|
|
208
208
|
/**
|
|
@@ -219,14 +219,15 @@ export type SlashPathStartTypeFactory = SlashPathFunction;
|
|
|
219
219
|
/**
|
|
220
220
|
* Creates a function that enforces the specified start type on a slash path.
|
|
221
221
|
*
|
|
222
|
+
* @param type - The start type to enforce.
|
|
223
|
+
* @returns Transforms paths to the specified start type.
|
|
224
|
+
*
|
|
222
225
|
* @dbxUtil
|
|
223
226
|
* @dbxUtilCategory path
|
|
224
227
|
* @dbxUtilKind factory
|
|
225
228
|
* @dbxUtilTags path, slash, factory, start-type, relative, absolute, normalize
|
|
226
229
|
* @dbxUtilRelated to-relative-slash-path-start-type, to-absolute-slash-path-start-type, slash-path-factory
|
|
227
230
|
*
|
|
228
|
-
* @param type - The start type to enforce.
|
|
229
|
-
* @returns A function that transforms paths to the specified start type.
|
|
230
231
|
* @__NO_SIDE_EFFECTS__
|
|
231
232
|
*/
|
|
232
233
|
export declare function slashPathStartTypeFactory(type: SlashPathStartType): SlashPathStartTypeFactory;
|
|
@@ -239,13 +240,13 @@ export declare const ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX: RegExp;
|
|
|
239
240
|
/**
|
|
240
241
|
* Converts a slash path to a relative path by removing all leading slashes.
|
|
241
242
|
*
|
|
243
|
+
* @param input - The slash path to convert.
|
|
244
|
+
* @returns A relative path without leading slashes.
|
|
245
|
+
*
|
|
242
246
|
* @dbxUtil
|
|
243
247
|
* @dbxUtilCategory path
|
|
244
248
|
* @dbxUtilTags path, slash, relative, leading, strip, normalize, convert
|
|
245
249
|
* @dbxUtilRelated to-absolute-slash-path-start-type, slash-path-start-type-factory
|
|
246
|
-
*
|
|
247
|
-
* @param input - The slash path to convert.
|
|
248
|
-
* @returns A relative path without leading slashes.
|
|
249
250
|
*/
|
|
250
251
|
export declare function toRelativeSlashPathStartType(input: SlashPath): SlashPath;
|
|
251
252
|
/**
|
|
@@ -279,14 +280,15 @@ export interface SlashPathFolderFactoryConfig {
|
|
|
279
280
|
/**
|
|
280
281
|
* Creates a SlashPathFolderFactory.
|
|
281
282
|
*
|
|
283
|
+
* @param config - Configuration options for the factory.
|
|
284
|
+
* @returns A SlashPathFolderFactory.
|
|
285
|
+
*
|
|
282
286
|
* @dbxUtil
|
|
283
287
|
* @dbxUtilCategory path
|
|
284
288
|
* @dbxUtilKind factory
|
|
285
289
|
* @dbxUtilTags path, slash, folder, factory, validate, normalize, trailing-slash
|
|
286
290
|
* @dbxUtilRelated slash-path-folder, slash-path-validation-factory, add-trailing-slash
|
|
287
291
|
*
|
|
288
|
-
* @param config Configuration options for the factory.
|
|
289
|
-
* @returns A SlashPathFolderFactory.
|
|
290
292
|
* @__NO_SIDE_EFFECTS__
|
|
291
293
|
*/
|
|
292
294
|
export declare function slashPathFolderFactory(config?: SlashPathFolderFactoryConfig): SlashPathFolderFactory;
|
|
@@ -295,113 +297,114 @@ export declare function slashPathFolderFactory(config?: SlashPathFolderFactoryCo
|
|
|
295
297
|
*
|
|
296
298
|
* If the input is a file, the folder of the file is returned instead.
|
|
297
299
|
*
|
|
300
|
+
* @param input - The string path to convert to a folder path.
|
|
301
|
+
* @param config - Optional configuration controlling path type inference and invalid-path handling.
|
|
302
|
+
* @returns A valid slash path folder string with a trailing slash, or an empty string for relative root.
|
|
303
|
+
*
|
|
298
304
|
* @dbxUtil
|
|
299
305
|
* @dbxUtilCategory path
|
|
300
306
|
* @dbxUtilTags path, slash, folder, convert, normalize, validate, directory
|
|
301
307
|
* @dbxUtilRelated slash-path-folder-factory, slash-path-details, add-trailing-slash
|
|
302
|
-
*
|
|
303
|
-
* @param input - the string path to convert to a folder path
|
|
304
|
-
* @param config - optional configuration controlling path type inference and invalid-path handling
|
|
305
|
-
* @returns a valid slash path folder string with a trailing slash, or an empty string for relative root
|
|
306
308
|
*/
|
|
307
309
|
export declare function slashPathFolder(input: string, config?: SlashPathFolderFactoryConfig): InferredSlashPathFolder;
|
|
308
310
|
/**
|
|
309
311
|
* Converts a slash path to an absolute path by ensuring exactly one leading slash.
|
|
310
312
|
*
|
|
313
|
+
* @param input - The slash path to convert.
|
|
314
|
+
* @returns An absolute path starting with a single slash.
|
|
315
|
+
*
|
|
311
316
|
* @dbxUtil
|
|
312
317
|
* @dbxUtilCategory path
|
|
313
318
|
* @dbxUtilTags path, slash, absolute, leading, prefix, normalize, convert
|
|
314
319
|
* @dbxUtilRelated to-relative-slash-path-start-type, slash-path-start-type-factory, fix-multi-slashes-in-slash-path
|
|
315
|
-
*
|
|
316
|
-
* @param input - The slash path to convert.
|
|
317
|
-
* @returns An absolute path starting with a single slash.
|
|
318
320
|
*/
|
|
319
321
|
export declare function toAbsoluteSlashPathStartType(input: SlashPath): SlashPath;
|
|
320
322
|
/**
|
|
321
323
|
* Replaces consecutive double slashes with single slashes.
|
|
322
324
|
*
|
|
325
|
+
* @param input - The slash path to fix.
|
|
326
|
+
* @returns The path with double slashes collapsed.
|
|
327
|
+
*
|
|
323
328
|
* @dbxUtil
|
|
324
329
|
* @dbxUtilCategory path
|
|
325
330
|
* @dbxUtilTags path, slash, fix, collapse, double, normalize, dedupe
|
|
326
331
|
* @dbxUtilRelated merge-slash-paths, replace-multiple-file-paths-in-slash-path
|
|
327
|
-
*
|
|
328
|
-
* @param input - The slash path to fix.
|
|
329
|
-
* @returns The path with double slashes collapsed.
|
|
330
332
|
*/
|
|
331
333
|
export declare function fixMultiSlashesInSlashPath(input: SlashPath): SlashPath;
|
|
332
334
|
/**
|
|
333
335
|
* Replaces consecutive double slashes with single slashes. Alias for {@link fixMultiSlashesInSlashPath}.
|
|
334
336
|
*
|
|
337
|
+
* @param input - The slash path to fix.
|
|
338
|
+
* @returns The path with double slashes collapsed.
|
|
339
|
+
*
|
|
335
340
|
* @dbxUtil
|
|
336
341
|
* @dbxUtilCategory path
|
|
337
342
|
* @dbxUtilTags path, slash, alias, collapse, double, normalize
|
|
338
343
|
* @dbxUtilRelated fix-multi-slashes-in-slash-path, merge-slash-paths
|
|
339
|
-
*
|
|
340
|
-
* @param input - The slash path to fix.
|
|
341
|
-
* @returns The path with double slashes collapsed.
|
|
342
344
|
*/
|
|
343
345
|
export declare function replaceMultipleFilePathsInSlashPath(input: SlashPath): SlashPath;
|
|
344
346
|
/**
|
|
345
347
|
* Removes all trailing slashes from a slash path.
|
|
346
348
|
*
|
|
349
|
+
* @param input - The slash path to trim.
|
|
350
|
+
* @returns The path without trailing slashes.
|
|
351
|
+
*
|
|
347
352
|
* @dbxUtil
|
|
348
353
|
* @dbxUtilCategory path
|
|
349
354
|
* @dbxUtilTags path, slash, trim, trailing, strip, remove, normalize
|
|
350
355
|
* @dbxUtilRelated add-trailing-slash, remove-trailing-file-type-separators
|
|
351
|
-
*
|
|
352
|
-
* @param input - The slash path to trim.
|
|
353
|
-
* @returns The path without trailing slashes.
|
|
354
356
|
*/
|
|
355
357
|
export declare function removeTrailingSlashes(input: SlashPath): SlashPath;
|
|
356
358
|
/**
|
|
357
359
|
* Removes all trailing dots from a slash path.
|
|
358
360
|
*
|
|
361
|
+
* @param input - The slash path to trim.
|
|
362
|
+
* @returns The path without trailing dots.
|
|
363
|
+
*
|
|
359
364
|
* @dbxUtil
|
|
360
365
|
* @dbxUtilCategory path
|
|
361
366
|
* @dbxUtilTags path, slash, trim, trailing, dot, file-type, strip, normalize
|
|
362
367
|
* @dbxUtilRelated remove-trailing-slashes, replace-invalid-file-path-type-separators-in-slash-path
|
|
363
|
-
*
|
|
364
|
-
* @param input - The slash path to trim.
|
|
365
|
-
* @returns The path without trailing dots.
|
|
366
368
|
*/
|
|
367
369
|
export declare function removeTrailingFileTypeSeparators(input: SlashPath): SlashPath;
|
|
368
370
|
/**
|
|
369
371
|
* Adds a trailing slash to the input if it does not already have one.
|
|
370
372
|
*
|
|
373
|
+
* @param input - A slash path.
|
|
374
|
+
* @returns A slash path folder.
|
|
375
|
+
*
|
|
371
376
|
* @dbxUtil
|
|
372
377
|
* @dbxUtilCategory path
|
|
373
378
|
* @dbxUtilTags path, slash, trailing, append, folder, ensure, normalize
|
|
374
379
|
* @dbxUtilRelated remove-trailing-slashes, slash-path-folder, slash-path-folder-factory
|
|
375
|
-
*
|
|
376
|
-
* @param input A slash path.
|
|
377
|
-
* @returns A slash path folder.
|
|
378
380
|
*/
|
|
379
381
|
export declare function addTrailingSlash(input: SlashPath): SlashPathFolder;
|
|
380
382
|
/**
|
|
381
383
|
* Replaces all extra and invalidate FilePathTypeSeparator values from the SlashPath, returning a valid SlashPath.
|
|
382
384
|
*
|
|
385
|
+
* @param input
|
|
386
|
+
* @param replaceWith
|
|
387
|
+
* @returns
|
|
388
|
+
*
|
|
383
389
|
* @dbxUtil
|
|
384
390
|
* @dbxUtilCategory path
|
|
385
391
|
* @dbxUtilTags path, slash, dot, file-type, replace, sanitize, fix, validate
|
|
386
392
|
* @dbxUtilRelated replace-invalid-file-path-type-separators-in-slash-path-function, slash-path-validation-factory
|
|
387
|
-
*
|
|
388
|
-
* @param input
|
|
389
|
-
* @param replaceWith
|
|
390
|
-
* @returns
|
|
391
393
|
*/
|
|
392
394
|
export declare function replaceInvalidFilePathTypeSeparatorsInSlashPath(input: SlashPath, replaceWith?: string): SlashPath;
|
|
393
395
|
/**
|
|
394
396
|
* Creates a function that replaces all extra and invalidate FilePathTypeSeparator values from the SlashPath, returning a valid SlashPath.
|
|
395
397
|
*
|
|
398
|
+
* @param replaceWith
|
|
399
|
+
* @param input
|
|
400
|
+
* @returns
|
|
401
|
+
*
|
|
396
402
|
* @dbxUtil
|
|
397
403
|
* @dbxUtilCategory path
|
|
398
404
|
* @dbxUtilKind factory
|
|
399
405
|
* @dbxUtilTags path, slash, dot, file-type, factory, replace, sanitize, validate
|
|
400
406
|
* @dbxUtilRelated replace-invalid-file-path-type-separators-in-slash-path, slash-path-validation-factory
|
|
401
407
|
*
|
|
402
|
-
* @param input
|
|
403
|
-
* @param replaceWith
|
|
404
|
-
* @returns
|
|
405
408
|
* @__NO_SIDE_EFFECTS__
|
|
406
409
|
*/
|
|
407
410
|
export declare function replaceInvalidFilePathTypeSeparatorsInSlashPathFunction(replaceWith?: string): SlashPathFunction;
|
|
@@ -436,14 +439,15 @@ export interface SlashPathValidationFactoryConfig {
|
|
|
436
439
|
/**
|
|
437
440
|
* Creates a validation/fixup function for slash paths that replaces illegal characters and extra dots.
|
|
438
441
|
*
|
|
442
|
+
* @param config - Configuration for validation behavior.
|
|
443
|
+
* @returns Validates and fixes a slash path.
|
|
444
|
+
*
|
|
439
445
|
* @dbxUtil
|
|
440
446
|
* @dbxUtilCategory path
|
|
441
447
|
* @dbxUtilKind factory
|
|
442
448
|
* @dbxUtilTags path, slash, validate, factory, sanitize, illegal, replace, fix
|
|
443
449
|
* @dbxUtilRelated is-valid-slash-path, replace-invalid-file-path-type-separators-in-slash-path-function, slash-path-factory, slash-path-invalid-error
|
|
444
450
|
*
|
|
445
|
-
* @param config - Configuration for validation behavior.
|
|
446
|
-
* @returns A function that validates and fixes a slash path.
|
|
447
451
|
* @__NO_SIDE_EFFECTS__
|
|
448
452
|
*/
|
|
449
453
|
export declare function slashPathValidationFactory(config?: SlashPathValidationFactoryConfig): SlashPathValidationFactory;
|
|
@@ -468,51 +472,52 @@ export interface SlashPathFactoryConfig {
|
|
|
468
472
|
/**
|
|
469
473
|
* Creates a factory function that merges path segments together with optional base path, start type enforcement, and validation.
|
|
470
474
|
*
|
|
475
|
+
* @param config - Configuration for path generation.
|
|
476
|
+
* @returns A factory function that merges input paths into a single validated slash path.
|
|
477
|
+
*
|
|
471
478
|
* @dbxUtil
|
|
472
479
|
* @dbxUtilCategory path
|
|
473
480
|
* @dbxUtilKind factory
|
|
474
481
|
* @dbxUtilTags path, slash, factory, merge, base, start-type, validate, normalize
|
|
475
482
|
* @dbxUtilRelated merge-slash-paths, slash-path-validation-factory, slash-path-start-type-factory
|
|
476
483
|
*
|
|
477
|
-
* @param config - Configuration for path generation.
|
|
478
|
-
* @returns A factory function that merges input paths into a single validated slash path.
|
|
479
484
|
* @__NO_SIDE_EFFECTS__
|
|
480
485
|
*/
|
|
481
486
|
export declare function slashPathFactory(config?: SlashPathFactoryConfig): SlashPathFactory;
|
|
482
487
|
/**
|
|
483
488
|
* Merges an array of path segments into a single slash path, filtering nullish values and collapsing double slashes.
|
|
484
489
|
*
|
|
490
|
+
* @param paths - Array of path segments to merge.
|
|
491
|
+
* @returns The merged slash path.
|
|
492
|
+
*
|
|
485
493
|
* @dbxUtil
|
|
486
494
|
* @dbxUtilCategory path
|
|
487
495
|
* @dbxUtilTags path, slash, merge, join, concat, segments, normalize, dedupe
|
|
488
496
|
* @dbxUtilRelated slash-path-factory, fix-multi-slashes-in-slash-path, slash-path-parts
|
|
489
|
-
*
|
|
490
|
-
* @param paths - Array of path segments to merge.
|
|
491
|
-
* @returns The merged slash path.
|
|
492
497
|
*/
|
|
493
498
|
export declare function mergeSlashPaths(paths: Maybe<SlashPath>[]): SlashPath;
|
|
494
499
|
/**
|
|
495
500
|
* Creates an Error indicating that a slash path is invalid.
|
|
496
501
|
*
|
|
502
|
+
* @returns A new Error with a descriptive message.
|
|
503
|
+
*
|
|
497
504
|
* @dbxUtil
|
|
498
505
|
* @dbxUtilCategory path
|
|
499
506
|
* @dbxUtilTags path, slash, error, invalid, throw, validate
|
|
500
507
|
* @dbxUtilRelated is-valid-slash-path, slash-path-validation-factory
|
|
501
|
-
*
|
|
502
|
-
* @returns A new Error with a descriptive message.
|
|
503
508
|
*/
|
|
504
509
|
export declare function slashPathInvalidError(): Error;
|
|
505
510
|
/**
|
|
506
511
|
* Splits the path and returns the items at the given ranges.
|
|
507
512
|
*
|
|
513
|
+
* @param path - The path to isolate parts from.
|
|
514
|
+
* @param range - Index range defining which path segments to extract.
|
|
515
|
+
* @returns A new slash path containing only the segments within the range.
|
|
516
|
+
*
|
|
508
517
|
* @dbxUtil
|
|
509
518
|
* @dbxUtilCategory path
|
|
510
519
|
* @dbxUtilTags path, slash, isolate, slice, range, segments, extract, sub-path
|
|
511
520
|
* @dbxUtilRelated isolate-slash-path-function, slash-path-parts, slash-path-details
|
|
512
|
-
*
|
|
513
|
-
* @param path - The path to isolate parts from.
|
|
514
|
-
* @param range - Index range defining which path segments to extract.
|
|
515
|
-
* @returns A new slash path containing only the segments within the range.
|
|
516
521
|
*/
|
|
517
522
|
export declare function isolateSlashPath(path: SlashPath, range: IndexRangeInput): SlashPath;
|
|
518
523
|
/**
|
|
@@ -541,14 +546,15 @@ export type IsolateSlashPathFunction = (path: SlashPath) => SlashPath;
|
|
|
541
546
|
/**
|
|
542
547
|
* Creates an IsolateSlashPathFunction.
|
|
543
548
|
*
|
|
549
|
+
* @param config - Configuration with range, optional start type, and file mode.
|
|
550
|
+
* @returns Isolates path segments within the configured range.
|
|
551
|
+
*
|
|
544
552
|
* @dbxUtil
|
|
545
553
|
* @dbxUtilCategory path
|
|
546
554
|
* @dbxUtilKind factory
|
|
547
555
|
* @dbxUtilTags path, slash, isolate, factory, slice, range, segments, sub-path
|
|
548
556
|
* @dbxUtilRelated isolate-slash-path, slash-path-parts, slash-path-details
|
|
549
557
|
*
|
|
550
|
-
* @param config - Configuration with range, optional start type, and file mode.
|
|
551
|
-
* @returns A function that isolates path segments within the configured range.
|
|
552
558
|
* @__NO_SIDE_EFFECTS__
|
|
553
559
|
*/
|
|
554
560
|
export declare function isolateSlashPathFunction(config: IsolateSlashPathFunctionConfig): IsolateSlashPathFunction;
|
|
@@ -619,13 +625,13 @@ export interface SlashPathDetails {
|
|
|
619
625
|
/**
|
|
620
626
|
* Returns the details of a path.
|
|
621
627
|
*
|
|
628
|
+
* @param path - The path to get details for.
|
|
629
|
+
* @returns The details of the path.
|
|
630
|
+
*
|
|
622
631
|
* @dbxUtil
|
|
623
632
|
* @dbxUtilCategory path
|
|
624
633
|
* @dbxUtilTags path, slash, details, parse, decompose, file, folder, extension, parts
|
|
625
634
|
* @dbxUtilRelated slash-path-type, slash-path-parts, slash-path-folder, slash-path-name
|
|
626
|
-
*
|
|
627
|
-
* @param path The path to get details for.
|
|
628
|
-
* @returns The details of the path.
|
|
629
635
|
*/
|
|
630
636
|
export declare function slashPathDetails(path: SlashPath): SlashPathDetails;
|
|
631
637
|
/**
|
|
@@ -654,13 +660,14 @@ export type SlashPathPathMatcherPath = ArrayOrValue<SlashPathPathMatcherPart>;
|
|
|
654
660
|
/**
|
|
655
661
|
* Expands the input matcher path into decision functions.
|
|
656
662
|
*
|
|
663
|
+
* @param path - Matcher path parts to expand into decision functions.
|
|
664
|
+
* @returns Array of decision functions for each path part.
|
|
665
|
+
*
|
|
657
666
|
* @dbxUtil
|
|
658
667
|
* @dbxUtilCategory path
|
|
659
668
|
* @dbxUtilTags path, slash, matcher, expand, decision, predicate, wildcard, build
|
|
660
669
|
* @dbxUtilRelated slash-path-path-matcher, slash-path-sub-path-matcher, slash-path-path-matcher-config
|
|
661
670
|
*
|
|
662
|
-
* @param path - Matcher path parts to expand into decision functions.
|
|
663
|
-
* @returns Array of decision functions for each path part.
|
|
664
671
|
* @__NO_SIDE_EFFECTS__
|
|
665
672
|
*/
|
|
666
673
|
export declare function expandSlashPathPathMatcherPartToDecisionFunctions(path: SlashPathPathMatcherPath): SlashPathPathMatcherFunction[];
|
|
@@ -709,7 +716,7 @@ export interface SlashPathPathMatcherResult<N extends PrimativeValue = typeof DE
|
|
|
709
716
|
*
|
|
710
717
|
* The array element is null on parts that do not match.
|
|
711
718
|
*/
|
|
712
|
-
readonly matchingParts:
|
|
719
|
+
readonly matchingParts: Maybe<SlashPathPart>[];
|
|
713
720
|
/**
|
|
714
721
|
* The value to use when filling non-matching parts.
|
|
715
722
|
*/
|
|
@@ -721,7 +728,7 @@ export interface SlashPathPathMatcherResult<N extends PrimativeValue = typeof DE
|
|
|
721
728
|
*
|
|
722
729
|
* If the input path is shorter than the target path, the remaining parts will be filled with the nonMatchingFillValue.
|
|
723
730
|
*/
|
|
724
|
-
readonly nonMatchingParts:
|
|
731
|
+
readonly nonMatchingParts: Maybe<SlashPathPart | N>[];
|
|
725
732
|
/**
|
|
726
733
|
* The total number of parts that did not match.
|
|
727
734
|
*/
|
|
@@ -731,26 +738,28 @@ export type SlashPathPathMatcherConfigInput<N extends PrimativeValue = Primative
|
|
|
731
738
|
/**
|
|
732
739
|
* Creates a SlashPathPathMatcherConfig from the input.
|
|
733
740
|
*
|
|
741
|
+
* @param input - The configuration input.
|
|
742
|
+
* @returns The configuration.
|
|
743
|
+
* @throws {Error} When `input` is not an array, string, or config object.
|
|
744
|
+
*
|
|
734
745
|
* @dbxUtil
|
|
735
746
|
* @dbxUtilCategory path
|
|
736
747
|
* @dbxUtilTags path, slash, matcher, config, normalize, coerce
|
|
737
748
|
* @dbxUtilRelated slash-path-path-matcher, slash-path-sub-path-matcher
|
|
738
|
-
*
|
|
739
|
-
* @param input The configuration input.
|
|
740
|
-
* @returns The configuration.
|
|
741
749
|
*/
|
|
742
750
|
export declare function slashPathPathMatcherConfig<N extends PrimativeValue = PrimativeValue>(input: SlashPathPathMatcherConfigInput<N>): SlashPathPathMatcherConfig<N>;
|
|
743
751
|
/**
|
|
744
752
|
* Creates a SlashPathPathMatcher.
|
|
745
753
|
*
|
|
754
|
+
* @param input - The matcher configuration, which may be a target path string, an array of path parts, or a full config object.
|
|
755
|
+
* @returns The matcher.
|
|
756
|
+
*
|
|
746
757
|
* @dbxUtil
|
|
747
758
|
* @dbxUtilCategory path
|
|
748
759
|
* @dbxUtilKind factory
|
|
749
760
|
* @dbxUtilTags path, slash, matcher, factory, predicate, wildcard, target, compare
|
|
750
761
|
* @dbxUtilRelated slash-path-sub-path-matcher, expand-slash-path-path-matcher-part-to-decision-functions, slash-path-path-matcher-config
|
|
751
762
|
*
|
|
752
|
-
* @param input - the matcher configuration, which may be a target path string, an array of path parts, or a full config object
|
|
753
|
-
* @returns The matcher.
|
|
754
763
|
* @__NO_SIDE_EFFECTS__
|
|
755
764
|
*/
|
|
756
765
|
export declare function slashPathPathMatcher<N extends PrimativeValue = PrimativeValue>(input: SlashPathPathMatcherConfigInput<N>): SlashPathPathMatcher<N>;
|
|
@@ -779,13 +788,13 @@ export interface SlashPathSubPathMatcherBaseResult {
|
|
|
779
788
|
*
|
|
780
789
|
* The array element is null on parts that match.
|
|
781
790
|
*/
|
|
782
|
-
readonly nonMatchingParts:
|
|
791
|
+
readonly nonMatchingParts: Maybe<SlashPathPart>[];
|
|
783
792
|
/**
|
|
784
793
|
* All remaining parts of the path, relative to the base path.
|
|
785
794
|
*
|
|
786
795
|
* Only non-null if matchesBasePath is true.
|
|
787
796
|
*/
|
|
788
|
-
readonly subPathParts: SlashPathPart[]
|
|
797
|
+
readonly subPathParts: Maybe<SlashPathPart[]>;
|
|
789
798
|
}
|
|
790
799
|
export interface SlashPathSubPathMatcherMatchResult extends SlashPathSubPathMatcherBaseResult {
|
|
791
800
|
readonly matchesBasePath: true;
|
|
@@ -808,14 +817,15 @@ export type SlashPathSubPathMatcher = (path: SlashPath) => SlashPathSubPathMatch
|
|
|
808
817
|
/**
|
|
809
818
|
* Creates a SlashPathSubPathMatcher.
|
|
810
819
|
*
|
|
820
|
+
* @param config - The configuration for the matcher.
|
|
821
|
+
* @returns The matcher.
|
|
822
|
+
*
|
|
811
823
|
* @dbxUtil
|
|
812
824
|
* @dbxUtilCategory path
|
|
813
825
|
* @dbxUtilKind factory
|
|
814
826
|
* @dbxUtilTags path, slash, matcher, sub-path, factory, base-path, prefix, predicate
|
|
815
827
|
* @dbxUtilRelated slash-path-path-matcher, expand-slash-path-path-matcher-part-to-decision-functions
|
|
816
828
|
*
|
|
817
|
-
* @param config The configuration for the matcher.
|
|
818
|
-
* @returns The matcher.
|
|
819
829
|
* @__NO_SIDE_EFFECTS__
|
|
820
830
|
*/
|
|
821
831
|
export declare function slashPathSubPathMatcher(config: SlashPathSubPathMatcherConfig): SlashPathSubPathMatcher;
|