@dereekb/util 12.5.4 → 12.5.5
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/package.json +1 -1
- package/fetch/src/lib/fetch.file.d.ts +2 -2
- package/index.cjs.js +124 -18
- package/index.esm.js +124 -19
- package/package.json +1 -1
- package/src/lib/array/array.string.d.ts +6 -1
- package/src/lib/auth/auth.role.claims.d.ts +1 -1
- package/src/lib/boolean.d.ts +1 -1
- package/src/lib/date/minute.d.ts +1 -1
- package/src/lib/path/path.d.ts +3 -3
- package/src/lib/promise/promise.task.d.ts +3 -3
- package/src/lib/service/handler.config.d.ts +1 -1
- package/src/lib/string/factory.d.ts +3 -3
- package/src/lib/string/mimetype.d.ts +1 -1
- package/src/lib/string/string.d.ts +2 -2
- package/src/lib/tree/tree.expand.d.ts +2 -1
- package/src/lib/tree/tree.explore.d.ts +79 -0
- package/src/lib/tree/tree.flatten.d.ts +50 -6
- package/test/CHANGELOG.md +4 -0
- package/test/package.json +1 -1
package/fetch/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ContentTypeMimeType, Maybe, MimeTypeWithoutParameters } from '@dereekb/util';
|
|
1
|
+
import { type ContentTypeMimeType, type Maybe, type MimeTypeWithoutParameters } from '@dereekb/util';
|
|
2
2
|
import { safeParse as parseContentType } from 'fast-content-type-parse';
|
|
3
|
-
import { FetchMethod } from './fetch.type';
|
|
3
|
+
import { type FetchMethod } from './fetch.type';
|
|
4
4
|
/**
|
|
5
5
|
* Input for fetchUploadFile().
|
|
6
6
|
*/
|
package/index.cjs.js
CHANGED
|
@@ -6368,14 +6368,18 @@ function containsAllStringsAnyCase(values, valuesToFind, mustContainAtleastOneIt
|
|
|
6368
6368
|
return valuesToFindArray.length ? containsAllValues(toCaseInsensitiveStringArray(values), valuesToFindArray, !mustContainAtleastOneItem) : true;
|
|
6369
6369
|
}
|
|
6370
6370
|
function filterUniqueTransform(config) {
|
|
6371
|
+
const {
|
|
6372
|
+
exclude: excludeInput
|
|
6373
|
+
} = config;
|
|
6374
|
+
const exclude = excludeInput ? asArray(excludeInput) : undefined;
|
|
6371
6375
|
const transform = transformStrings(config);
|
|
6372
6376
|
const caseInsensitiveCompare = config.caseInsensitive && !config.toLowercase && !config.toUppercase;
|
|
6373
6377
|
if (caseInsensitiveCompare) {
|
|
6374
6378
|
// transform after finding unique values
|
|
6375
|
-
return input => transform(filterUniqueCaseInsensitiveStrings(input, x => x));
|
|
6379
|
+
return input => transform(filterUniqueCaseInsensitiveStrings(input, x => x, exclude));
|
|
6376
6380
|
} else {
|
|
6377
6381
|
// transform before, and then use a set to find unique values
|
|
6378
|
-
return input =>
|
|
6382
|
+
return input => unique(transform(input), exclude);
|
|
6379
6383
|
}
|
|
6380
6384
|
}
|
|
6381
6385
|
|
|
@@ -13756,7 +13760,7 @@ function expandTreeFunction(config) {
|
|
|
13756
13760
|
// Use Omit<N, 'children'> here as makeNodeFromConfig returns the node without children initially.
|
|
13757
13761
|
// The children are attached in the next step.
|
|
13758
13762
|
const node = makeNodeFromConfig(treeNodeWithoutChildren); // Cast is necessary because children are added after
|
|
13759
|
-
const childrenValues = config.getChildren(value);
|
|
13763
|
+
const childrenValues = config.getChildren(value, depth);
|
|
13760
13764
|
node.children = childrenValues ? childrenValues.map(x => expandFn(x, node)) : undefined;
|
|
13761
13765
|
return node;
|
|
13762
13766
|
};
|
|
@@ -13776,11 +13780,105 @@ function expandTrees(values, expandFn) {
|
|
|
13776
13780
|
return values.map(expandFn);
|
|
13777
13781
|
}
|
|
13778
13782
|
|
|
13783
|
+
/**
|
|
13784
|
+
* Decides how to visit a node during tree exploration.
|
|
13785
|
+
*/
|
|
13786
|
+
const ExploreTreeVisitNodeDecision = {
|
|
13787
|
+
/**
|
|
13788
|
+
* Visits all nodes and children
|
|
13789
|
+
*/
|
|
13790
|
+
VISIT_ALL: 0,
|
|
13791
|
+
/**
|
|
13792
|
+
* Visits the node only
|
|
13793
|
+
*/
|
|
13794
|
+
VISIT_NODE_ONLY: 1,
|
|
13795
|
+
/**
|
|
13796
|
+
* Visits the node and its children
|
|
13797
|
+
*/
|
|
13798
|
+
VISIT_CHILDREN_ONLY: 2,
|
|
13799
|
+
/**
|
|
13800
|
+
* No value will be visited
|
|
13801
|
+
*/
|
|
13802
|
+
SKIP_ALL: 3
|
|
13803
|
+
};
|
|
13804
|
+
/**
|
|
13805
|
+
* Convenience function for exploring the input trees
|
|
13806
|
+
|
|
13807
|
+
* @param trees
|
|
13808
|
+
* @param visitNodeFn
|
|
13809
|
+
* @returns
|
|
13810
|
+
*/
|
|
13811
|
+
function exploreTreeFunction(config) {
|
|
13812
|
+
const defaultMapNodeFn = config?.mapNodeFunction ?? MAP_IDENTITY;
|
|
13813
|
+
const defaultShouldVisitNodeFn = config?.shouldVisitNodeFunction ?? (() => ExploreTreeVisitNodeDecision.VISIT_ALL);
|
|
13814
|
+
const defaultTraverseFactory = config?.traverseFunctionFactory ?? depthFirstExploreTreeTraversalFactoryFunction();
|
|
13815
|
+
return (trees, visit, override) => {
|
|
13816
|
+
const treesArray = asArray(trees);
|
|
13817
|
+
const mapNodeFn = override?.mapNodeFunction ?? defaultMapNodeFn;
|
|
13818
|
+
const shouldVisitNodeFn = override?.shouldVisitNodeFunction ?? defaultShouldVisitNodeFn;
|
|
13819
|
+
const traverseFactory = override?.traverseFunctionFactory ?? defaultTraverseFactory;
|
|
13820
|
+
/**
|
|
13821
|
+
* The root recursive flatten function.
|
|
13822
|
+
*
|
|
13823
|
+
* @param tree
|
|
13824
|
+
* @returns
|
|
13825
|
+
*/
|
|
13826
|
+
const exploreFn = tree => {
|
|
13827
|
+
const mappedValue = mapNodeFn(tree);
|
|
13828
|
+
const visitResult = shouldVisitNodeFn(tree, mappedValue);
|
|
13829
|
+
exploreNextFn(tree, mappedValue, visitResult);
|
|
13830
|
+
};
|
|
13831
|
+
const exploreNextFn = traverseFactory(visit, exploreFn);
|
|
13832
|
+
return treesArray.forEach(x => exploreFn(x));
|
|
13833
|
+
};
|
|
13834
|
+
}
|
|
13835
|
+
/**
|
|
13836
|
+
* A depth-first traversal factory function.
|
|
13837
|
+
*
|
|
13838
|
+
* @returns A ExploreTreeTraversalFactoryFunction<N, V>.
|
|
13839
|
+
*/
|
|
13840
|
+
function depthFirstExploreTreeTraversalFactoryFunction() {
|
|
13841
|
+
return (visit, continueTraversal) => {
|
|
13842
|
+
return (node, nodeMappedValue, visitDecision) => {
|
|
13843
|
+
// if addNode returns false, skip this node and its children
|
|
13844
|
+
if (visitDecision !== ExploreTreeVisitNodeDecision.SKIP_ALL) {
|
|
13845
|
+
if (visitDecision !== ExploreTreeVisitNodeDecision.VISIT_CHILDREN_ONLY) {
|
|
13846
|
+
visit(nodeMappedValue, node);
|
|
13847
|
+
}
|
|
13848
|
+
if (node.children && visitDecision !== ExploreTreeVisitNodeDecision.VISIT_NODE_ONLY) {
|
|
13849
|
+
node.children.forEach(x => continueTraversal(x));
|
|
13850
|
+
}
|
|
13851
|
+
}
|
|
13852
|
+
};
|
|
13853
|
+
};
|
|
13854
|
+
}
|
|
13855
|
+
|
|
13856
|
+
/**
|
|
13857
|
+
* Decides how to add a node to the flattened array during flattening.
|
|
13858
|
+
*/
|
|
13859
|
+
const FlattenTreeAddNodeDecision = {
|
|
13860
|
+
/**
|
|
13861
|
+
* Add all nodes and children
|
|
13862
|
+
*/
|
|
13863
|
+
ADD_ALL: ExploreTreeVisitNodeDecision.VISIT_ALL,
|
|
13864
|
+
/**
|
|
13865
|
+
* Add the node only
|
|
13866
|
+
*/
|
|
13867
|
+
ADD_NODE_ONLY: ExploreTreeVisitNodeDecision.VISIT_NODE_ONLY,
|
|
13868
|
+
/**
|
|
13869
|
+
* Add the node and its children
|
|
13870
|
+
*/
|
|
13871
|
+
ADD_CHILDREN_ONLY: ExploreTreeVisitNodeDecision.VISIT_CHILDREN_ONLY,
|
|
13872
|
+
/**
|
|
13873
|
+
* No value will be added
|
|
13874
|
+
*/
|
|
13875
|
+
SKIP_ALL: ExploreTreeVisitNodeDecision.SKIP_ALL
|
|
13876
|
+
};
|
|
13779
13877
|
/**
|
|
13780
13878
|
* Traverses the tree and flattens it into all tree nodes.
|
|
13781
13879
|
*/
|
|
13782
|
-
function flattenTree(tree) {
|
|
13783
|
-
return flattenTreeToArray(tree, []);
|
|
13880
|
+
function flattenTree(tree, addNodeFn) {
|
|
13881
|
+
return flattenTreeToArray(tree, [], addNodeFn);
|
|
13784
13882
|
}
|
|
13785
13883
|
/**
|
|
13786
13884
|
* Traverses the tree and pushes the nodes into the input array.
|
|
@@ -13789,8 +13887,8 @@ function flattenTree(tree) {
|
|
|
13789
13887
|
* @param array
|
|
13790
13888
|
* @returns
|
|
13791
13889
|
*/
|
|
13792
|
-
function flattenTreeToArray(tree, array) {
|
|
13793
|
-
return flattenTreeToArrayFunction()(tree, array);
|
|
13890
|
+
function flattenTreeToArray(tree, array, addNodeFn) {
|
|
13891
|
+
return flattenTreeToArrayFunction()(tree, array, addNodeFn);
|
|
13794
13892
|
}
|
|
13795
13893
|
/**
|
|
13796
13894
|
* Implementation for flattenTreeToArrayFunction.
|
|
@@ -13802,29 +13900,36 @@ function flattenTreeToArray(tree, array) {
|
|
|
13802
13900
|
* @template N The type of the tree node, must extend TreeNode.
|
|
13803
13901
|
* @template V The type of the values to be collected in the output array.
|
|
13804
13902
|
* @param mapNodeFn An optional function to transform each node N to a value V. If omitted, nodes are cast to V (effectively N if V is N).
|
|
13903
|
+
* @param defaultAddNodeFn An optional function to determine if a node should be visited. If omitted, all nodes are visited. Ignored if the input config is an object with a shouldAddNodeFunction.
|
|
13805
13904
|
* @returns A FlattenTreeFunction<N, V> that performs the tree flattening.
|
|
13806
13905
|
*/
|
|
13807
|
-
function flattenTreeToArrayFunction(
|
|
13808
|
-
const
|
|
13809
|
-
|
|
13810
|
-
|
|
13811
|
-
|
|
13812
|
-
|
|
13813
|
-
|
|
13906
|
+
function flattenTreeToArrayFunction(mapNodeFnOrConfig, defaultAddNodeFn) {
|
|
13907
|
+
const config = typeof mapNodeFnOrConfig === 'function' ? {
|
|
13908
|
+
mapNodeFunction: mapNodeFnOrConfig
|
|
13909
|
+
} : mapNodeFnOrConfig ?? {};
|
|
13910
|
+
const exploreFn = exploreTreeFunction({
|
|
13911
|
+
...config,
|
|
13912
|
+
shouldVisitNodeFunction: config.shouldAddNodeFunction ?? defaultAddNodeFn
|
|
13913
|
+
});
|
|
13914
|
+
return (trees, array = [], inputAddNodeFn) => {
|
|
13915
|
+
exploreFn(trees, value => array.push(value), inputAddNodeFn ? {
|
|
13916
|
+
shouldVisitNodeFunction: inputAddNodeFn
|
|
13917
|
+
} : undefined);
|
|
13814
13918
|
return array;
|
|
13815
13919
|
};
|
|
13816
|
-
return flattenFn;
|
|
13817
13920
|
}
|
|
13818
13921
|
/**
|
|
13819
|
-
* Convenience function for flattening multiple trees with a flatten function.
|
|
13922
|
+
* Convenience function for flattening multiple trees with a single configured flatten function.
|
|
13923
|
+
*
|
|
13924
|
+
* @deprecated FlattenTreeFunction now supports an array of trees.
|
|
13820
13925
|
*
|
|
13821
13926
|
* @param trees
|
|
13822
13927
|
* @param flattenFn
|
|
13823
13928
|
* @returns
|
|
13824
13929
|
*/
|
|
13825
|
-
function flattenTrees(trees, flattenFn) {
|
|
13930
|
+
function flattenTrees(trees, flattenFn, addNodeFn) {
|
|
13826
13931
|
const array = [];
|
|
13827
|
-
|
|
13932
|
+
flattenFn(trees, array, addNodeFn);
|
|
13828
13933
|
return array;
|
|
13829
13934
|
}
|
|
13830
13935
|
|
|
@@ -14158,6 +14263,7 @@ exports.E164PHONE_NUMBER_WITH_OPTIONAL_EXTENSION_REGEX = E164PHONE_NUMBER_WITH_O
|
|
|
14158
14263
|
exports.FINAL_PAGE = FINAL_PAGE;
|
|
14159
14264
|
exports.FIRST_PAGE = FIRST_PAGE;
|
|
14160
14265
|
exports.FRACTIONAL_HOURS_PRECISION_FUNCTION = FRACTIONAL_HOURS_PRECISION_FUNCTION;
|
|
14266
|
+
exports.FlattenTreeAddNodeDecision = FlattenTreeAddNodeDecision;
|
|
14161
14267
|
exports.FullStorageObject = FullStorageObject;
|
|
14162
14268
|
exports.GIF_MIME_TYPE = GIF_MIME_TYPE;
|
|
14163
14269
|
exports.HAS_PORT_NUMBER_REGEX = HAS_PORT_NUMBER_REGEX;
|
package/index.esm.js
CHANGED
|
@@ -6366,14 +6366,18 @@ function containsAllStringsAnyCase(values, valuesToFind, mustContainAtleastOneIt
|
|
|
6366
6366
|
return valuesToFindArray.length ? containsAllValues(toCaseInsensitiveStringArray(values), valuesToFindArray, !mustContainAtleastOneItem) : true;
|
|
6367
6367
|
}
|
|
6368
6368
|
function filterUniqueTransform(config) {
|
|
6369
|
+
const {
|
|
6370
|
+
exclude: excludeInput
|
|
6371
|
+
} = config;
|
|
6372
|
+
const exclude = excludeInput ? asArray(excludeInput) : undefined;
|
|
6369
6373
|
const transform = transformStrings(config);
|
|
6370
6374
|
const caseInsensitiveCompare = config.caseInsensitive && !config.toLowercase && !config.toUppercase;
|
|
6371
6375
|
if (caseInsensitiveCompare) {
|
|
6372
6376
|
// transform after finding unique values
|
|
6373
|
-
return input => transform(filterUniqueCaseInsensitiveStrings(input, x => x));
|
|
6377
|
+
return input => transform(filterUniqueCaseInsensitiveStrings(input, x => x, exclude));
|
|
6374
6378
|
} else {
|
|
6375
6379
|
// transform before, and then use a set to find unique values
|
|
6376
|
-
return input =>
|
|
6380
|
+
return input => unique(transform(input), exclude);
|
|
6377
6381
|
}
|
|
6378
6382
|
}
|
|
6379
6383
|
|
|
@@ -13754,7 +13758,7 @@ function expandTreeFunction(config) {
|
|
|
13754
13758
|
// Use Omit<N, 'children'> here as makeNodeFromConfig returns the node without children initially.
|
|
13755
13759
|
// The children are attached in the next step.
|
|
13756
13760
|
const node = makeNodeFromConfig(treeNodeWithoutChildren); // Cast is necessary because children are added after
|
|
13757
|
-
const childrenValues = config.getChildren(value);
|
|
13761
|
+
const childrenValues = config.getChildren(value, depth);
|
|
13758
13762
|
node.children = childrenValues ? childrenValues.map(x => expandFn(x, node)) : undefined;
|
|
13759
13763
|
return node;
|
|
13760
13764
|
};
|
|
@@ -13774,11 +13778,105 @@ function expandTrees(values, expandFn) {
|
|
|
13774
13778
|
return values.map(expandFn);
|
|
13775
13779
|
}
|
|
13776
13780
|
|
|
13781
|
+
/**
|
|
13782
|
+
* Decides how to visit a node during tree exploration.
|
|
13783
|
+
*/
|
|
13784
|
+
const ExploreTreeVisitNodeDecision = {
|
|
13785
|
+
/**
|
|
13786
|
+
* Visits all nodes and children
|
|
13787
|
+
*/
|
|
13788
|
+
VISIT_ALL: 0,
|
|
13789
|
+
/**
|
|
13790
|
+
* Visits the node only
|
|
13791
|
+
*/
|
|
13792
|
+
VISIT_NODE_ONLY: 1,
|
|
13793
|
+
/**
|
|
13794
|
+
* Visits the node and its children
|
|
13795
|
+
*/
|
|
13796
|
+
VISIT_CHILDREN_ONLY: 2,
|
|
13797
|
+
/**
|
|
13798
|
+
* No value will be visited
|
|
13799
|
+
*/
|
|
13800
|
+
SKIP_ALL: 3
|
|
13801
|
+
};
|
|
13802
|
+
/**
|
|
13803
|
+
* Convenience function for exploring the input trees
|
|
13804
|
+
|
|
13805
|
+
* @param trees
|
|
13806
|
+
* @param visitNodeFn
|
|
13807
|
+
* @returns
|
|
13808
|
+
*/
|
|
13809
|
+
function exploreTreeFunction(config) {
|
|
13810
|
+
const defaultMapNodeFn = config?.mapNodeFunction ?? MAP_IDENTITY;
|
|
13811
|
+
const defaultShouldVisitNodeFn = config?.shouldVisitNodeFunction ?? (() => ExploreTreeVisitNodeDecision.VISIT_ALL);
|
|
13812
|
+
const defaultTraverseFactory = config?.traverseFunctionFactory ?? depthFirstExploreTreeTraversalFactoryFunction();
|
|
13813
|
+
return (trees, visit, override) => {
|
|
13814
|
+
const treesArray = asArray(trees);
|
|
13815
|
+
const mapNodeFn = override?.mapNodeFunction ?? defaultMapNodeFn;
|
|
13816
|
+
const shouldVisitNodeFn = override?.shouldVisitNodeFunction ?? defaultShouldVisitNodeFn;
|
|
13817
|
+
const traverseFactory = override?.traverseFunctionFactory ?? defaultTraverseFactory;
|
|
13818
|
+
/**
|
|
13819
|
+
* The root recursive flatten function.
|
|
13820
|
+
*
|
|
13821
|
+
* @param tree
|
|
13822
|
+
* @returns
|
|
13823
|
+
*/
|
|
13824
|
+
const exploreFn = tree => {
|
|
13825
|
+
const mappedValue = mapNodeFn(tree);
|
|
13826
|
+
const visitResult = shouldVisitNodeFn(tree, mappedValue);
|
|
13827
|
+
exploreNextFn(tree, mappedValue, visitResult);
|
|
13828
|
+
};
|
|
13829
|
+
const exploreNextFn = traverseFactory(visit, exploreFn);
|
|
13830
|
+
return treesArray.forEach(x => exploreFn(x));
|
|
13831
|
+
};
|
|
13832
|
+
}
|
|
13833
|
+
/**
|
|
13834
|
+
* A depth-first traversal factory function.
|
|
13835
|
+
*
|
|
13836
|
+
* @returns A ExploreTreeTraversalFactoryFunction<N, V>.
|
|
13837
|
+
*/
|
|
13838
|
+
function depthFirstExploreTreeTraversalFactoryFunction() {
|
|
13839
|
+
return (visit, continueTraversal) => {
|
|
13840
|
+
return (node, nodeMappedValue, visitDecision) => {
|
|
13841
|
+
// if addNode returns false, skip this node and its children
|
|
13842
|
+
if (visitDecision !== ExploreTreeVisitNodeDecision.SKIP_ALL) {
|
|
13843
|
+
if (visitDecision !== ExploreTreeVisitNodeDecision.VISIT_CHILDREN_ONLY) {
|
|
13844
|
+
visit(nodeMappedValue, node);
|
|
13845
|
+
}
|
|
13846
|
+
if (node.children && visitDecision !== ExploreTreeVisitNodeDecision.VISIT_NODE_ONLY) {
|
|
13847
|
+
node.children.forEach(x => continueTraversal(x));
|
|
13848
|
+
}
|
|
13849
|
+
}
|
|
13850
|
+
};
|
|
13851
|
+
};
|
|
13852
|
+
}
|
|
13853
|
+
|
|
13854
|
+
/**
|
|
13855
|
+
* Decides how to add a node to the flattened array during flattening.
|
|
13856
|
+
*/
|
|
13857
|
+
const FlattenTreeAddNodeDecision = {
|
|
13858
|
+
/**
|
|
13859
|
+
* Add all nodes and children
|
|
13860
|
+
*/
|
|
13861
|
+
ADD_ALL: ExploreTreeVisitNodeDecision.VISIT_ALL,
|
|
13862
|
+
/**
|
|
13863
|
+
* Add the node only
|
|
13864
|
+
*/
|
|
13865
|
+
ADD_NODE_ONLY: ExploreTreeVisitNodeDecision.VISIT_NODE_ONLY,
|
|
13866
|
+
/**
|
|
13867
|
+
* Add the node and its children
|
|
13868
|
+
*/
|
|
13869
|
+
ADD_CHILDREN_ONLY: ExploreTreeVisitNodeDecision.VISIT_CHILDREN_ONLY,
|
|
13870
|
+
/**
|
|
13871
|
+
* No value will be added
|
|
13872
|
+
*/
|
|
13873
|
+
SKIP_ALL: ExploreTreeVisitNodeDecision.SKIP_ALL
|
|
13874
|
+
};
|
|
13777
13875
|
/**
|
|
13778
13876
|
* Traverses the tree and flattens it into all tree nodes.
|
|
13779
13877
|
*/
|
|
13780
|
-
function flattenTree(tree) {
|
|
13781
|
-
return flattenTreeToArray(tree, []);
|
|
13878
|
+
function flattenTree(tree, addNodeFn) {
|
|
13879
|
+
return flattenTreeToArray(tree, [], addNodeFn);
|
|
13782
13880
|
}
|
|
13783
13881
|
/**
|
|
13784
13882
|
* Traverses the tree and pushes the nodes into the input array.
|
|
@@ -13787,8 +13885,8 @@ function flattenTree(tree) {
|
|
|
13787
13885
|
* @param array
|
|
13788
13886
|
* @returns
|
|
13789
13887
|
*/
|
|
13790
|
-
function flattenTreeToArray(tree, array) {
|
|
13791
|
-
return flattenTreeToArrayFunction()(tree, array);
|
|
13888
|
+
function flattenTreeToArray(tree, array, addNodeFn) {
|
|
13889
|
+
return flattenTreeToArrayFunction()(tree, array, addNodeFn);
|
|
13792
13890
|
}
|
|
13793
13891
|
/**
|
|
13794
13892
|
* Implementation for flattenTreeToArrayFunction.
|
|
@@ -13800,29 +13898,36 @@ function flattenTreeToArray(tree, array) {
|
|
|
13800
13898
|
* @template N The type of the tree node, must extend TreeNode.
|
|
13801
13899
|
* @template V The type of the values to be collected in the output array.
|
|
13802
13900
|
* @param mapNodeFn An optional function to transform each node N to a value V. If omitted, nodes are cast to V (effectively N if V is N).
|
|
13901
|
+
* @param defaultAddNodeFn An optional function to determine if a node should be visited. If omitted, all nodes are visited. Ignored if the input config is an object with a shouldAddNodeFunction.
|
|
13803
13902
|
* @returns A FlattenTreeFunction<N, V> that performs the tree flattening.
|
|
13804
13903
|
*/
|
|
13805
|
-
function flattenTreeToArrayFunction(
|
|
13806
|
-
const
|
|
13807
|
-
|
|
13808
|
-
|
|
13809
|
-
|
|
13810
|
-
|
|
13811
|
-
|
|
13904
|
+
function flattenTreeToArrayFunction(mapNodeFnOrConfig, defaultAddNodeFn) {
|
|
13905
|
+
const config = typeof mapNodeFnOrConfig === 'function' ? {
|
|
13906
|
+
mapNodeFunction: mapNodeFnOrConfig
|
|
13907
|
+
} : mapNodeFnOrConfig ?? {};
|
|
13908
|
+
const exploreFn = exploreTreeFunction({
|
|
13909
|
+
...config,
|
|
13910
|
+
shouldVisitNodeFunction: config.shouldAddNodeFunction ?? defaultAddNodeFn
|
|
13911
|
+
});
|
|
13912
|
+
return (trees, array = [], inputAddNodeFn) => {
|
|
13913
|
+
exploreFn(trees, value => array.push(value), inputAddNodeFn ? {
|
|
13914
|
+
shouldVisitNodeFunction: inputAddNodeFn
|
|
13915
|
+
} : undefined);
|
|
13812
13916
|
return array;
|
|
13813
13917
|
};
|
|
13814
|
-
return flattenFn;
|
|
13815
13918
|
}
|
|
13816
13919
|
/**
|
|
13817
|
-
* Convenience function for flattening multiple trees with a flatten function.
|
|
13920
|
+
* Convenience function for flattening multiple trees with a single configured flatten function.
|
|
13921
|
+
*
|
|
13922
|
+
* @deprecated FlattenTreeFunction now supports an array of trees.
|
|
13818
13923
|
*
|
|
13819
13924
|
* @param trees
|
|
13820
13925
|
* @param flattenFn
|
|
13821
13926
|
* @returns
|
|
13822
13927
|
*/
|
|
13823
|
-
function flattenTrees(trees, flattenFn) {
|
|
13928
|
+
function flattenTrees(trees, flattenFn, addNodeFn) {
|
|
13824
13929
|
const array = [];
|
|
13825
|
-
|
|
13930
|
+
flattenFn(trees, array, addNodeFn);
|
|
13826
13931
|
return array;
|
|
13827
13932
|
}
|
|
13828
13933
|
|
|
@@ -14112,4 +14217,4 @@ async function iterateFilteredPages(inputPage, loadFn, iterFn) {
|
|
|
14112
14217
|
return count;
|
|
14113
14218
|
}
|
|
14114
14219
|
|
|
14115
|
-
export { ALL_DOUBLE_SLASHES_REGEX, ALL_SLASHES_REGEX, ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX, ASSERTION_ERROR_CODE, ASSERTION_HANDLER, AUTH_ADMIN_ROLE, AUTH_ONBOARDED_ROLE, AUTH_ROLE_CLAIMS_DEFAULT_CLAIM_VALUE, AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE, AUTH_TOS_SIGNED_ROLE, AUTH_USER_ROLE, AbstractUniqueModel, Assert, AssertMax, AssertMin, AssertionError, AssertionIssueHandler, BooleanStringKeyArrayUtility, BooleanStringKeyArrayUtilityInstance, CATCH_ALL_HANDLE_RESULT_KEY, COMMA_JOINER, CUT_VALUE_TO_ZERO_PRECISION, DASH_CHARACTER_PREFIX_INSTANCE, DATE_NOW_VALUE, DEFAULT_CUT_STRING_END_TEXT, DEFAULT_LAT_LNG_STRING_VALUE, DEFAULT_RANDOM_EMAIL_FACTORY_CONFIG, DEFAULT_RANDOM_PHONE_NUMBER_FACTORY_CONFIG, DEFAULT_READABLE_ERROR_CODE, DEFAULT_SLASH_PATH_ILLEGAL_CHARACTERS, DEFAULT_SLASH_PATH_ILLEGAL_CHARACTER_REPLACEMENT, DEFAULT_SLASH_PATH_PATH_MATCHER_NON_MATCHING_FILL_VALUE, DEFAULT_UNKNOWN_MODEL_TYPE_STRING, DOLLAR_AMOUNT_PRECISION, DOLLAR_AMOUNT_STRING_REGEX, DataDoesNotExistError, DataIsExpiredError, Day, DestroyFunctionObject, E164PHONE_NUMBER_REGEX, E164PHONE_NUMBER_WITH_EXTENSION_REGEX, E164PHONE_NUMBER_WITH_OPTIONAL_EXTENSION_REGEX, FINAL_PAGE, FIRST_PAGE, FRACTIONAL_HOURS_PRECISION_FUNCTION, FullStorageObject, GIF_MIME_TYPE, HAS_PORT_NUMBER_REGEX, HAS_WEBSITE_DOMAIN_NAME_REGEX, HEIF_MIME_TYPE, HOURS_IN_DAY, HTTP_OR_HTTPS_REGEX, HashSet, ISO8601_DAY_STRING_REGEX, ISO8601_DAY_STRING_START_REGEX, ISO_8601_DATE_STRING_REGEX, JPEG_MIME_TYPE, KeyValueTypleValueFilter, LAT_LNG_PATTERN, LAT_LNG_PATTERN_MAX_PRECISION, LAT_LONG_100KM_PRECISION, LAT_LONG_100M_PRECISION, LAT_LONG_10CM_PRECISION, LAT_LONG_10KM_PRECISION, LAT_LONG_10M_PRECISION, LAT_LONG_1CM_PRECISION, LAT_LONG_1KM_PRECISION, LAT_LONG_1MM_PRECISION, LAT_LONG_1M_PRECISION, LAT_LONG_GRAINS_OF_SAND_PRECISION, LEADING_SLASHES_REGEX, MAP_IDENTITY, MAX_BITWISE_SET_SIZE, MAX_LATITUDE_VALUE, MAX_LONGITUDE_VALUE, MINUTES_IN_DAY, MINUTES_IN_HOUR, MINUTE_OF_DAY_MAXMIMUM, MINUTE_OF_DAY_MINIUMUM, MIN_LATITUDE_VALUE, MIN_LONGITUDE_VALUE, MONTH_DAY_SLASH_DATE_STRING_REGEX, MS_IN_DAY, MS_IN_HOUR, MS_IN_MINUTE, MS_IN_SECOND, MemoryStorageInstance, ModelRelationUtility, NOOP_MODIFIER, NUMBER_STRING_DENCODER_64, NUMBER_STRING_DENCODER_64_DEFAULT_NEGATIVE_PREFIX, NUMBER_STRING_DENCODER_64_DIGITS, PHONE_EXTENSION_NUMBER_REGEX, PNG_MIME_TYPE, PRIMATIVE_KEY_DENCODER_VALUE, PageCalculator, PropertyDescriptorUtility, RAW_MIME_TYPE, REGEX_SPECIAL_CHARACTERS, REGEX_SPECIAL_CHARACTERS_SET, RelationChange, SECONDS_IN_MINUTE, SHARED_MEMORY_STORAGE, SLASH_PATH_FILE_TYPE_SEPARATOR, SLASH_PATH_SEPARATOR, SORT_VALUE_EQUAL, SORT_VALUE_GREATER_THAN, SORT_VALUE_LESS_THAN, SPACE_JOINER, SPLIT_STRING_TREE_NODE_ROOT_VALUE, SVG_MIME_TYPE, ServerErrorResponse, SetDeltaChange, SimpleStorageObject, SlashPathPathMatcherPartCode, StorageObject, StorageObjectUtility, StoredDataError, SyncState, TIFF_MIME_TYPE, TOTAL_LATITUDE_RANGE, TOTAL_LONGITUDE_RANGE, TOTAL_SPAN_OF_LONGITUDE, TRAILING_FILE_TYPE_SEPARATORS_REGEX, TRAILING_SLASHES_REGEX, TimeAM, TimerCancelledError, TypedServiceRegistryInstance, UNLOADED_PAGE, UNSET_INDEX_NUMBER, US_STATE_CODE_STRING_REGEX, UTC_DATE_STRING_REGEX, UTC_TIMEZONE_STRING, UTF_8_START_CHARACTER, UTF_PRIVATE_USAGE_AREA_START, UnauthorizedServerErrorResponse, WEBP_MIME_TYPE, WEBSITE_TLD_DETECTION_REGEX, WEB_PROTOCOL_PREFIX_REGEX, ZIP_CODE_STRING_REGEX, addHttpToUrl, addLatLngPoints, addMilliseconds, addModifiers, addPlusPrefixToNumber, addPrefix, addPrefixFunction, addSuffix, addSuffixFunction, addToSet, addToSetCopy, addToSplitStringTree, addTrailingSlash, allFalsyOrEmptyKeys, allIndexesInIndexRange, allKeyValueTuples, allMaybeSoKeys, allNonUndefinedKeys, allObjectsAreEqual, allValuesAreMaybeNot, allValuesAreNotMaybe, allowValueOnceFilter, applyBestFit, applySplitStringTreeWithMultipleValues, applyToMultipleFields, approximateTimerEndDate, areEqualContext, areEqualPOJOValues, areEqualPOJOValuesUsingPojoFilter, arrayContainsDuplicateValue, arrayContentsDiffer, arrayDecision, arrayDecisionFunction, arrayFactory, arrayInputFactory, arrayToLowercase, arrayToMap, arrayToObject, arrayToUppercase, asArray, asDecisionFunction, asGetter, asIndexRangeCheckFunctionConfig, asIterable, asMinuteOfDay, asNumber, asObjectCopyFactory, asPromise, asSet, assignValuesToPOJO, assignValuesToPOJOFunction, authClaims, authRoleClaimsService, authRolesSetHasRoles, baseWebsiteUrl, batch, batchCalc, bitwiseObjectDencoder, bitwiseObjectEncoder, bitwiseObjectdecoder, bitwiseSetDecoder, bitwiseSetDencoder, booleanFactory, booleanKeyArrayUtility, boundNumber, boundNumberFunction, boundToRectangle, build, cachedGetter, calculateExpirationDate, capLatValue, capitalizeFirstLetter, caseInsensitiveFilterByIndexOfDecisionFactory, caseInsensitiveString, catchAllHandlerKey, chainMapFunction, chainMapSameFunctions, characterPrefixSuffixInstance, checkAnyHaveExpired, checkAtleastOneNotExpired, coerceToEmailParticipants, combineMaps, compareEqualityWithValueFromItemsFunction, compareEqualityWithValueFromItemsFunctionFactory, compareFnOrder, compareWithMappedValuesFunction, computeNextFractionalHour, computeNextFreeIndexFunction, computeNextFreeIndexOnSortedValuesFunction, concatArrays, concatArraysUnique, containsAllStringsAnyCase, containsAllValues, containsAnyStringAnyCase, containsAnyValue, containsAnyValueFromSet, containsNoValueFromSet, containsNoneOfValue, containsStringAnyCase, convertEmailParticipantStringToParticipant, convertMaybeToArray, convertParticipantToEmailParticipantString, convertToArray, copyArray, copyField, copyLatLngBound, copyLatLngPoint, copyObject, copySetAndDo, countAllInNestedArray, countPOJOKeys, countPOJOKeysFunction, cronExpressionRepeatingEveryNMinutes, cssClassesSet, cutString, cutStringFunction, cutToPrecision, cutValueToInteger, cutValueToPrecision, cutValueToPrecisionFunction, dateFromDateOrTimeNumber, dateFromLogicalDate, dateFromMinuteOfDay, dateOrMillisecondsToDate, dateToHoursAndMinutes, dateToMinuteOfDay, dayOfWeek, daysOfWeekArray, daysOfWeekFromEnabledDays, daysOfWeekNameFunction, daysOfWeekNameMap, decisionFunction, decodeHashedValues, decodeHashedValuesWithDecodeMap, decodeModelKeyTypePair, defaultFilterFromPOJOFunctionNoCopy, defaultForwardFunctionFactory, defaultLatLngPoint, defaultLatLngString, dencodeBitwiseSet, diffLatLngBoundPoints, diffLatLngPoints, dollarAmountString, dollarAmountStringWithUnitFunction, e164PhoneNumberExtensionPair, e164PhoneNumberFromE164PhoneNumberExtensionPair, enabledDaysFromDaysOfWeek, encodeBitwiseSet, encodeModelKeyTypePair, errorMessageContainsString, errorMessageContainsStringFunction, escapeStringCharactersFunction, escapeStringForRegex, excludeValues, excludeValuesFromArray, excludeValuesFromSet, existsInIterable, expandArrayMapTuples, expandArrayValueTuples, expandFlattenTreeFunction, expandIndexSet, expandSlashPathPathMatcherPartToDecisionFunctions, expandTreeFunction, expandTrees, expirationDetails, exponentialPromiseRateLimiter, extendLatLngBound, filterAndMapFunction, filterEmptyArrayValues, filterEmptyPojoValues, filterEmptyValues, filterFalsyAndEmptyValues, filterFromIterable, filterFromPOJO, filterFromPOJOFunction, filterKeyValueTupleFunction, filterKeyValueTuples, filterKeyValueTuplesFunction, filterKeyValueTuplesInputToFilter, filterKeysOnPOJOFunction, filterMaybeArrayFunction, filterMaybeArrayValues, filterMaybeValues, filterNullAndUndefinedValues, filterOnlyUndefinedValues, filterTuplesOnPOJOFunction, filterUndefinedValues, filterUniqueByIndex, filterUniqueCaseInsensitiveStrings, filterUniqueFunction, filterUniqueTransform, filterUniqueValues, filterValuesByDistance, filterValuesByDistanceNoOrder, filterValuesToSet, filterValuesUsingSet, filteredPage, findAllCharacterOccurences, findAllCharacterOccurencesFunction, findBest, findBestIndexMatch, findBestIndexMatchFunction, findBestIndexSetPair, findBestSplitStringTreeChildMatch, findBestSplitStringTreeChildMatchPath, findBestSplitStringTreeMatch, findBestSplitStringTreeMatchPath, findFirstCharacterOccurence, findInIterable, findIndexOfFirstDuplicateValue, findItemsByIndex, findNext, findPOJOKeys, findPOJOKeysFunction, findStringsRegexString, findToIndexSet, findValuesFrom, firstAndLastCharacterOccurrence, firstAndLastValue, firstValue, firstValueFromIterable, fitToIndexRangeFunction, fixExtraQueryParameters, fixMultiSlashesInSlashPath, flattenArray, flattenArrayOrValueArray, flattenArrayToSet, flattenArrayUnique, flattenArrayUniqueCaseInsensitiveStrings, flattenTree, flattenTreeToArray, flattenTreeToArrayFunction, flattenTrees, flattenWhitespace, forEachInIterable, forEachKeyValue, forEachKeyValueOnPOJOFunction, forEachWithArray, forwardFunction, fractionalHoursToMinutes, generateIfDoesNotExist, getArrayNextIndex, getBaseLog, getDayOffset, getDayTomorrow, getDayYesterday, getDaysOfWeekNames, getFunctionType, getNextDay, getNextPageNumber, getOverlappingRectangle, getPageNumber, getPreviousDay, getValueFromGetter, groupValues, handlerBindAccessor, handlerConfigurerFactory, handlerFactory, handlerMappedSetFunction, handlerMappedSetFunctionFactory, handlerSetFunction, hasDifferentStringsNoCase, hasDifferentValues, hasHttpPrefix, hasNonNullValue, hasPortNumber, hasSameTimezone, hasSameValues, hasValueFunction, hasValueOrNotEmpty, hasValueOrNotEmptyObject, hasWebsiteDomain, hasWebsiteTopLevelDomain, hashSetForIndexed, hourToFractionalHour, hoursAndMinutesToString, idBatchFactory, incrementingNumberFactory, indexDeltaGroup, indexDeltaGroupFunction, indexRange, indexRangeCheckFunction, indexRangeCheckReaderFunction, indexRangeForArray, indexRangeOverlapsIndexRange, indexRangeOverlapsIndexRangeFunction, indexRangeReaderPairFactory, indexRefMap, indexedValuesArrayAccessorFactory, insertIntoBooleanKeyArray, invertBooleanReturnFunction, invertDecision, invertFilter, invertMaybeBoolean, isAllowed, isClassLikeType, isCompleteUnitedStatesAddress, isConsideredUtcTimezoneString, isDate, isDefaultLatLngPoint, isDefaultLatLngPointValue, isDefaultReadableError, isDefinedAndNotFalse, isDollarAmountString, isE164PhoneNumber, isE164PhoneNumberWithExtension, isEmptyIterable, isEqualContext, isEqualDate, isEqualToValueDecisionFunction, isEvenNumber, isFalseBooleanKeyArray, isFinalPage, isGetter, isISO8601DateString, isISO8601DayString, isISO8601DayStringStart, isInAllowedDaysOfWeekSet, isInNumberBoundFunction, isInSetDecisionFunction, isIndexNumberInIndexRange, isIndexNumberInIndexRangeFunction, isIndexRangeInIndexRange, isIndexRangeInIndexRangeFunction, isIterable, isKnownHttpWebsiteProtocol, isLatLngBound, isLatLngBoundWithinLatLngBound, isLatLngPoint, isLatLngPointWithinLatLngBound, isLatLngString, isLogicalDateStringCode, isMapIdentityFunction, isMaybeNot, isMaybeNotOrTrue, isMaybeSo, isMinuteOfDay, isModelKey, isMonthDaySlashDate, isNonClassFunction, isNotFalse, isNotNullOrEmptyString, isNumberDivisibleBy, isObjectWithConstructor, isOddNumber, isPast, isPromise, isPromiseLike, isSameLatLngBound, isSameLatLngPoint, isSameNonNullValue, isSameVector, isSelectedDecisionFunctionFactory, isSelectedIndexDecisionFunction, isServerError, isSlashPathFile, isSlashPathFolder, isSlashPathTypedFile, isStandardInternetAccessibleWebsiteUrl, isStringOrTrue, isThrottled, isTrueBooleanKeyArray, isUTCDateString, isUnderThreshold, isUniqueKeyedFunction, isUsStateCodeString, isValidLatLngPoint, isValidLatitude, isValidLongitude, isValidNumberBound, isValidPhoneExtensionNumber, isValidSlashPath, isWebsiteUrl, isWebsiteUrlWithPrefix, isWithinLatLngBoundFunction, isolateSlashPath, isolateSlashPathFunction, isolateWebsitePathFunction, itemCountForBatchIndex, iterableToArray, iterableToMap, iterableToSet, iterablesAreSetEquivalent, iterate, iterateFilteredPages, joinHostAndPort, joinStrings, joinStringsWithCommas, joinStringsWithSpaces, keepCharactersAfterFirstCharacterOccurence, keepCharactersAfterFirstCharacterOccurenceFunction, keepFromSetCopy, keepValuesFromArray, keepValuesFromSet, keyValueMapFactory, labeledValueMap, lastValue, latLngBound, latLngBoundCenterPoint, latLngBoundEastBound, latLngBoundFromInput, latLngBoundFullyWrapsMap, latLngBoundFunction, latLngBoundNorthBound, latLngBoundNorthEastPoint, latLngBoundNorthWestPoint, latLngBoundOverlapsLatLngBound, latLngBoundSouthBound, latLngBoundSouthEastPoint, latLngBoundSouthWestPoint, latLngBoundStrictlyWrapsMap, latLngBoundTuple, latLngBoundTupleFunction, latLngBoundWestBound, latLngBoundWrapsMap, latLngDataPointFunction, latLngPoint, latLngPointFromString, latLngPointFunction, latLngPointPrecisionFunction, latLngString, latLngStringFunction, latLngTuple, latLngTupleFunction, limitArray, lonLatTuple, lowercaseFirstLetter, mailToUrlString, makeBestFit, makeCopyModelFieldFunction, makeDateMonthForMonthOfYear, makeDefaultNonConcurrentTaskKeyFactory, makeGetter, makeHandler, makeHashDecodeMap, makeKeyPairs, makeModelConversionFieldValuesFunction, makeModelMap, makeModelMapFunctions, makeMultiModelKeyMap, makeTimer, makeValuesGroupMap, makeWithFactory, makeWithFactoryInput, mapArrayFunction, mapFunctionOutput, mapFunctionOutputPair, mapGetter, mapGetterFactory, mapIdentityFunction, mapIterable, mapKeysIntersectionObjectToArray, mapMaybeFunction, mapObjectKeysFunction, mapObjectKeysToLowercase, mapObjectMap, mapObjectMapFunction, mapObjectToTargetObject, mapPromiseOrValue, mapToObject, mapToTuples, mapValuesToSet, mappedUseAsyncFunction, mappedUseFunction, mapsHaveSameKeys, maybeMergeModelModifiers, maybeMergeModifiers, maybeModifierMapToFunction, maybeSet, mergeArrays, mergeArraysIntoArray, mergeFilterFunctions, mergeModifiers, mergeObjects, mergeObjectsFunction, mergeSlashPaths, messageFromError, millisecondsToMinutesAndSeconds, mimetypeForImageType, minAndMaxFunction, minAndMaxIndex, minAndMaxIndexFunction, minAndMaxIndexItemsFunction, minAndMaxNumber, minutesToFractionalHours, minutesToHoursAndMinutes, modelFieldConversions, modelFieldMapFunction, modelFieldMapFunctions, modelTypeDataPairFactory, modifier, modifierMapToFunction, modifyModelMapFunction, modifyModelMapFunctions, monthDaySlashDateToDateString, monthOfYearFromDate, monthOfYearFromDateMonth, monthOfYearFromUTCDate, multiKeyValueMapFactory, multiValueMapBuilder, neMostLatLngPoint, nearestDivisibleValues, numberStringDencoder, numberStringDencoderDecodedNumberValueFunction, numberStringDencoderEncodedStringValueFunction, numberStringDencoderFunction, objectCopyFactory, objectDeltaArrayCompressor, objectFieldEqualityChecker, objectFlatMergeMatrix, objectHasKey, objectHasKeys, objectHasNoKeys, objectIsEmpty, objectKeyEqualityComparatorFunction, objectKeysEqualityComparatorFunction, objectMergeMatrix, objectToMap, objectToTuples, overlapsLatLngBoundFunction, overrideInObject, overrideInObjectFunctionFactory, padStartFunction, pairGroupValues, parseISO8601DayStringToUTCDate, partialServerError, passThrough, percentNumberFromDecimal, percentNumberToDecimal, performAsyncTask, performAsyncTasks, performBatchLoop, performMakeLoop, performTaskCountLoop, performTaskLoop, performTasksFromFactoryInParallelFunction, performTasksInParallel, performTasksInParallelFunction, pickOneRandomly, poll, primativeKeyDencoder, primativeKeyDencoderMap, primativeKeyStringDencoder, primativeValuesDelta, promiseReference, protectedFactory, pushArrayItemsIntoArray, pushElementOntoArray, pushItemOrArrayItemsIntoArray, randomArrayFactory, randomArrayIndex, randomBoolean, randomEmailFactory, randomFromArrayFactory, randomLatLngFactory, randomLatLngFromCenterFactory, randomNumber, randomNumberFactory, randomPhoneNumberFactory, randomPickFactory, range, rangedIndexedValuesArrayAccessorFactory, rangedIndexedValuesArrayAccessorInfoFactory, readBooleanKeySafetyWrap, readDomainFromEmailAddress, readDomainsFromEmailAddresses, readEmailDomainFromUrlOrEmailAddress, readIndexNumber, readKeysFrom, readKeysFromFilterUniqueFunctionAdditionalKeys, readKeysFromFilterUniqueFunctionAdditionalKeysInput, readKeysFunction, readKeysSetFrom, readKeysSetFunction, readKeysToMap, readModelKey, readModelKeyFromObject, readModelKeys, readModelKeysFromObjects, readMultipleKeysToMap, readPortNumber, readUniqueModelKey, readWebsiteProtocol, readableError, readableStreamToBase64, readableStreamToBuffer, readableStreamToStringFunction, rectangleOverlapsRectangle, reduceBooleansFn, reduceBooleansWithAnd, reduceBooleansWithAndFn, reduceBooleansWithOr, reduceBooleansWithOrFn, reduceNumbers, reduceNumbersFn, reduceNumbersWithAdd, reduceNumbersWithAddFn, reduceNumbersWithMax, reduceNumbersWithMaxFn, reduceNumbersWithMin, reduceNumbersWithMinFn, removeByKeyFromBooleanKeyArray, removeCharactersAfterFirstCharacterOccurence, removeCharactersAfterFirstCharacterOccurenceFunction, removeExtensionFromPhoneNumber, removeFromBooleanKeyArray, removeFromSet, removeFromSetCopy, removeHttpFromUrl, removeModelsWithKey, removeModelsWithSameKey, removeModifiers, removeTrailingFileTypeSeparators, removeTrailingSlashes, removeValuesAtIndexesFromArrayCopy, removeWebProtocolPrefix, repeatString, replaceCharacterAtIndexIf, replaceCharacterAtIndexWith, replaceInvalidFilePathTypeSeparatorsInSlashPath, replaceInvalidFilePathTypeSeparatorsInSlashPathFunction, replaceLastCharacterIf, replaceLastCharacterIfIsFunction, replaceMultipleFilePathsInSlashPath, replaceStringsFunction, requireModelKey, resetPeriodPromiseRateLimiter, restoreOrder, restoreOrderWithValues, reverseCompareFn, roundNumberToStepFunction, roundNumberUpToStep, roundToPrecision, roundToPrecisionFunction, roundingFunction, runAsyncTaskForValue, runAsyncTasksForValues, runNamedAsyncTasks, runNamedAsyncTasksFunction, safeCompareEquality, safeEqualityComparatorFunction, safeFindBestIndexMatch, searchStringFilterFunction, secondsToMinutesAndSeconds, separateValues, separateValuesToSets, sequentialIncrementingNumberStringModelIdFactory, serverError, setContainsAllValues, setContainsAnyValue, setContainsNoneOfValue, setDeltaChangeKeys, setDeltaFunction, setHasValueFunction, setIncludes, setIncludesFunction, setKeysOnMap, setWebProtocolPrefix, setsAreEquivalent, simpleSortValuesFunctionWithSortRef, simplifyWhitespace, slashPathDetails, slashPathFactory, slashPathFolder, slashPathFolderFactory, slashPathInvalidError, slashPathName, slashPathParts, slashPathPathMatcher, slashPathPathMatcherConfig, slashPathStartTypeFactory, slashPathSubPathMatcher, slashPathType, slashPathValidationFactory, sliceIndexRangeFunction, sliceStringFunction, sortAscendingIndexNumberRefFunction, sortByIndexAscendingCompareFunction, sortByIndexRangeAscendingCompareFunction, sortByLabelFunction, sortByNumberFunction, sortByStringFunction, sortCompareNumberFunction, sortNumbersAscendingFunction, sortValues, sortValuesFunctionOrMapIdentityWithSortRef, sortValuesFunctionWithSortRef, spaceSeparatedCssClasses, splitCommaSeparatedString, splitCommaSeparatedStringToSet, splitFront, splitJoinNameString, splitJoinRemainder, splitStringAtFirstCharacterOccurence, splitStringAtFirstCharacterOccurenceFunction, splitStringAtIndex, splitStringTreeFactory, startOfDayForSystemDateInUTC, startOfDayForUTCDateInUTC, stepsFromIndex, stepsFromIndexFunction, stringCharactersToIndexRecord, stringContains, stringFactoryFromFactory, stringFromDateFactory, stringFromTimeFactory, stringToLowercaseFunction, stringToUppercaseFunction, stringTrimFunction, sumOfIntegersBetween, swMostLatLngPoint, symmetricDifferenceArray, symmetricDifferenceArrayBetweenSets, symmetricDifferenceWithModels, takeFront, takeLast, takeValuesFromIterable, telUrlString, telUrlStringForE164PhoneNumberPair, terminatingFactoryFromArray, throwKeyIsRequired, timePeriodCounter, timer, toAbsoluteSlashPathStartType, toCaseInsensitiveStringArray, toMinuteOfDay, toModelFieldConversions, toModelMapFunctions, toReadableError, toRelativeSlashPathStartType, toggleInSet, toggleInSetCopy, toggleTimerRunning, transformNumberFunction, transformNumberFunctionConfig, transformStringFunction, transformStringFunctionConfig, transformStrings, trimArray, tryWithPromiseFactoriesFunction, typedServiceRegistry, unique, uniqueCaseInsensitiveStrings, uniqueCaseInsensitiveStringsSet, uniqueKeys, uniqueModels, unitedStatesAddressString, unixTimeNumberForNow, unixTimeNumberFromDate, unixTimeNumberFromDateOrTimeNumber, unixTimeNumberToDate, updateMaybeValue, urlWithoutParameters, useAsync, useCallback, useContextFunction, useIterableOrValue, useModelOrKey, usePromise, useValue, validLatLngPoint, validLatLngPointFunction, valueAtIndex, valuesAreBothNullishOrEquivalent, valuesFromPOJO, valuesFromPOJOFunction, vectorMinimumSizeResizeFunction, vectorsAreEqual, waitForMs, websiteDomainAndPathPair, websiteDomainAndPathPairFromWebsiteUrl, websitePathAndQueryPair, websitePathFromWebsiteDomainAndPath, websitePathFromWebsiteUrl, websiteUrlDetails, websiteUrlFromPaths, wrapIndexRangeFunction, wrapLatLngPoint, wrapLngValue, wrapMapFunctionOutput, wrapNumberFunction, wrapTuples, wrapUseAsyncFunction, wrapUseFunction };
|
|
14220
|
+
export { ALL_DOUBLE_SLASHES_REGEX, ALL_SLASHES_REGEX, ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX, ASSERTION_ERROR_CODE, ASSERTION_HANDLER, AUTH_ADMIN_ROLE, AUTH_ONBOARDED_ROLE, AUTH_ROLE_CLAIMS_DEFAULT_CLAIM_VALUE, AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE, AUTH_TOS_SIGNED_ROLE, AUTH_USER_ROLE, AbstractUniqueModel, Assert, AssertMax, AssertMin, AssertionError, AssertionIssueHandler, BooleanStringKeyArrayUtility, BooleanStringKeyArrayUtilityInstance, CATCH_ALL_HANDLE_RESULT_KEY, COMMA_JOINER, CUT_VALUE_TO_ZERO_PRECISION, DASH_CHARACTER_PREFIX_INSTANCE, DATE_NOW_VALUE, DEFAULT_CUT_STRING_END_TEXT, DEFAULT_LAT_LNG_STRING_VALUE, DEFAULT_RANDOM_EMAIL_FACTORY_CONFIG, DEFAULT_RANDOM_PHONE_NUMBER_FACTORY_CONFIG, DEFAULT_READABLE_ERROR_CODE, DEFAULT_SLASH_PATH_ILLEGAL_CHARACTERS, DEFAULT_SLASH_PATH_ILLEGAL_CHARACTER_REPLACEMENT, DEFAULT_SLASH_PATH_PATH_MATCHER_NON_MATCHING_FILL_VALUE, DEFAULT_UNKNOWN_MODEL_TYPE_STRING, DOLLAR_AMOUNT_PRECISION, DOLLAR_AMOUNT_STRING_REGEX, DataDoesNotExistError, DataIsExpiredError, Day, DestroyFunctionObject, E164PHONE_NUMBER_REGEX, E164PHONE_NUMBER_WITH_EXTENSION_REGEX, E164PHONE_NUMBER_WITH_OPTIONAL_EXTENSION_REGEX, FINAL_PAGE, FIRST_PAGE, FRACTIONAL_HOURS_PRECISION_FUNCTION, FlattenTreeAddNodeDecision, FullStorageObject, GIF_MIME_TYPE, HAS_PORT_NUMBER_REGEX, HAS_WEBSITE_DOMAIN_NAME_REGEX, HEIF_MIME_TYPE, HOURS_IN_DAY, HTTP_OR_HTTPS_REGEX, HashSet, ISO8601_DAY_STRING_REGEX, ISO8601_DAY_STRING_START_REGEX, ISO_8601_DATE_STRING_REGEX, JPEG_MIME_TYPE, KeyValueTypleValueFilter, LAT_LNG_PATTERN, LAT_LNG_PATTERN_MAX_PRECISION, LAT_LONG_100KM_PRECISION, LAT_LONG_100M_PRECISION, LAT_LONG_10CM_PRECISION, LAT_LONG_10KM_PRECISION, LAT_LONG_10M_PRECISION, LAT_LONG_1CM_PRECISION, LAT_LONG_1KM_PRECISION, LAT_LONG_1MM_PRECISION, LAT_LONG_1M_PRECISION, LAT_LONG_GRAINS_OF_SAND_PRECISION, LEADING_SLASHES_REGEX, MAP_IDENTITY, MAX_BITWISE_SET_SIZE, MAX_LATITUDE_VALUE, MAX_LONGITUDE_VALUE, MINUTES_IN_DAY, MINUTES_IN_HOUR, MINUTE_OF_DAY_MAXMIMUM, MINUTE_OF_DAY_MINIUMUM, MIN_LATITUDE_VALUE, MIN_LONGITUDE_VALUE, MONTH_DAY_SLASH_DATE_STRING_REGEX, MS_IN_DAY, MS_IN_HOUR, MS_IN_MINUTE, MS_IN_SECOND, MemoryStorageInstance, ModelRelationUtility, NOOP_MODIFIER, NUMBER_STRING_DENCODER_64, NUMBER_STRING_DENCODER_64_DEFAULT_NEGATIVE_PREFIX, NUMBER_STRING_DENCODER_64_DIGITS, PHONE_EXTENSION_NUMBER_REGEX, PNG_MIME_TYPE, PRIMATIVE_KEY_DENCODER_VALUE, PageCalculator, PropertyDescriptorUtility, RAW_MIME_TYPE, REGEX_SPECIAL_CHARACTERS, REGEX_SPECIAL_CHARACTERS_SET, RelationChange, SECONDS_IN_MINUTE, SHARED_MEMORY_STORAGE, SLASH_PATH_FILE_TYPE_SEPARATOR, SLASH_PATH_SEPARATOR, SORT_VALUE_EQUAL, SORT_VALUE_GREATER_THAN, SORT_VALUE_LESS_THAN, SPACE_JOINER, SPLIT_STRING_TREE_NODE_ROOT_VALUE, SVG_MIME_TYPE, ServerErrorResponse, SetDeltaChange, SimpleStorageObject, SlashPathPathMatcherPartCode, StorageObject, StorageObjectUtility, StoredDataError, SyncState, TIFF_MIME_TYPE, TOTAL_LATITUDE_RANGE, TOTAL_LONGITUDE_RANGE, TOTAL_SPAN_OF_LONGITUDE, TRAILING_FILE_TYPE_SEPARATORS_REGEX, TRAILING_SLASHES_REGEX, TimeAM, TimerCancelledError, TypedServiceRegistryInstance, UNLOADED_PAGE, UNSET_INDEX_NUMBER, US_STATE_CODE_STRING_REGEX, UTC_DATE_STRING_REGEX, UTC_TIMEZONE_STRING, UTF_8_START_CHARACTER, UTF_PRIVATE_USAGE_AREA_START, UnauthorizedServerErrorResponse, WEBP_MIME_TYPE, WEBSITE_TLD_DETECTION_REGEX, WEB_PROTOCOL_PREFIX_REGEX, ZIP_CODE_STRING_REGEX, addHttpToUrl, addLatLngPoints, addMilliseconds, addModifiers, addPlusPrefixToNumber, addPrefix, addPrefixFunction, addSuffix, addSuffixFunction, addToSet, addToSetCopy, addToSplitStringTree, addTrailingSlash, allFalsyOrEmptyKeys, allIndexesInIndexRange, allKeyValueTuples, allMaybeSoKeys, allNonUndefinedKeys, allObjectsAreEqual, allValuesAreMaybeNot, allValuesAreNotMaybe, allowValueOnceFilter, applyBestFit, applySplitStringTreeWithMultipleValues, applyToMultipleFields, approximateTimerEndDate, areEqualContext, areEqualPOJOValues, areEqualPOJOValuesUsingPojoFilter, arrayContainsDuplicateValue, arrayContentsDiffer, arrayDecision, arrayDecisionFunction, arrayFactory, arrayInputFactory, arrayToLowercase, arrayToMap, arrayToObject, arrayToUppercase, asArray, asDecisionFunction, asGetter, asIndexRangeCheckFunctionConfig, asIterable, asMinuteOfDay, asNumber, asObjectCopyFactory, asPromise, asSet, assignValuesToPOJO, assignValuesToPOJOFunction, authClaims, authRoleClaimsService, authRolesSetHasRoles, baseWebsiteUrl, batch, batchCalc, bitwiseObjectDencoder, bitwiseObjectEncoder, bitwiseObjectdecoder, bitwiseSetDecoder, bitwiseSetDencoder, booleanFactory, booleanKeyArrayUtility, boundNumber, boundNumberFunction, boundToRectangle, build, cachedGetter, calculateExpirationDate, capLatValue, capitalizeFirstLetter, caseInsensitiveFilterByIndexOfDecisionFactory, caseInsensitiveString, catchAllHandlerKey, chainMapFunction, chainMapSameFunctions, characterPrefixSuffixInstance, checkAnyHaveExpired, checkAtleastOneNotExpired, coerceToEmailParticipants, combineMaps, compareEqualityWithValueFromItemsFunction, compareEqualityWithValueFromItemsFunctionFactory, compareFnOrder, compareWithMappedValuesFunction, computeNextFractionalHour, computeNextFreeIndexFunction, computeNextFreeIndexOnSortedValuesFunction, concatArrays, concatArraysUnique, containsAllStringsAnyCase, containsAllValues, containsAnyStringAnyCase, containsAnyValue, containsAnyValueFromSet, containsNoValueFromSet, containsNoneOfValue, containsStringAnyCase, convertEmailParticipantStringToParticipant, convertMaybeToArray, convertParticipantToEmailParticipantString, convertToArray, copyArray, copyField, copyLatLngBound, copyLatLngPoint, copyObject, copySetAndDo, countAllInNestedArray, countPOJOKeys, countPOJOKeysFunction, cronExpressionRepeatingEveryNMinutes, cssClassesSet, cutString, cutStringFunction, cutToPrecision, cutValueToInteger, cutValueToPrecision, cutValueToPrecisionFunction, dateFromDateOrTimeNumber, dateFromLogicalDate, dateFromMinuteOfDay, dateOrMillisecondsToDate, dateToHoursAndMinutes, dateToMinuteOfDay, dayOfWeek, daysOfWeekArray, daysOfWeekFromEnabledDays, daysOfWeekNameFunction, daysOfWeekNameMap, decisionFunction, decodeHashedValues, decodeHashedValuesWithDecodeMap, decodeModelKeyTypePair, defaultFilterFromPOJOFunctionNoCopy, defaultForwardFunctionFactory, defaultLatLngPoint, defaultLatLngString, dencodeBitwiseSet, diffLatLngBoundPoints, diffLatLngPoints, dollarAmountString, dollarAmountStringWithUnitFunction, e164PhoneNumberExtensionPair, e164PhoneNumberFromE164PhoneNumberExtensionPair, enabledDaysFromDaysOfWeek, encodeBitwiseSet, encodeModelKeyTypePair, errorMessageContainsString, errorMessageContainsStringFunction, escapeStringCharactersFunction, escapeStringForRegex, excludeValues, excludeValuesFromArray, excludeValuesFromSet, existsInIterable, expandArrayMapTuples, expandArrayValueTuples, expandFlattenTreeFunction, expandIndexSet, expandSlashPathPathMatcherPartToDecisionFunctions, expandTreeFunction, expandTrees, expirationDetails, exponentialPromiseRateLimiter, extendLatLngBound, filterAndMapFunction, filterEmptyArrayValues, filterEmptyPojoValues, filterEmptyValues, filterFalsyAndEmptyValues, filterFromIterable, filterFromPOJO, filterFromPOJOFunction, filterKeyValueTupleFunction, filterKeyValueTuples, filterKeyValueTuplesFunction, filterKeyValueTuplesInputToFilter, filterKeysOnPOJOFunction, filterMaybeArrayFunction, filterMaybeArrayValues, filterMaybeValues, filterNullAndUndefinedValues, filterOnlyUndefinedValues, filterTuplesOnPOJOFunction, filterUndefinedValues, filterUniqueByIndex, filterUniqueCaseInsensitiveStrings, filterUniqueFunction, filterUniqueTransform, filterUniqueValues, filterValuesByDistance, filterValuesByDistanceNoOrder, filterValuesToSet, filterValuesUsingSet, filteredPage, findAllCharacterOccurences, findAllCharacterOccurencesFunction, findBest, findBestIndexMatch, findBestIndexMatchFunction, findBestIndexSetPair, findBestSplitStringTreeChildMatch, findBestSplitStringTreeChildMatchPath, findBestSplitStringTreeMatch, findBestSplitStringTreeMatchPath, findFirstCharacterOccurence, findInIterable, findIndexOfFirstDuplicateValue, findItemsByIndex, findNext, findPOJOKeys, findPOJOKeysFunction, findStringsRegexString, findToIndexSet, findValuesFrom, firstAndLastCharacterOccurrence, firstAndLastValue, firstValue, firstValueFromIterable, fitToIndexRangeFunction, fixExtraQueryParameters, fixMultiSlashesInSlashPath, flattenArray, flattenArrayOrValueArray, flattenArrayToSet, flattenArrayUnique, flattenArrayUniqueCaseInsensitiveStrings, flattenTree, flattenTreeToArray, flattenTreeToArrayFunction, flattenTrees, flattenWhitespace, forEachInIterable, forEachKeyValue, forEachKeyValueOnPOJOFunction, forEachWithArray, forwardFunction, fractionalHoursToMinutes, generateIfDoesNotExist, getArrayNextIndex, getBaseLog, getDayOffset, getDayTomorrow, getDayYesterday, getDaysOfWeekNames, getFunctionType, getNextDay, getNextPageNumber, getOverlappingRectangle, getPageNumber, getPreviousDay, getValueFromGetter, groupValues, handlerBindAccessor, handlerConfigurerFactory, handlerFactory, handlerMappedSetFunction, handlerMappedSetFunctionFactory, handlerSetFunction, hasDifferentStringsNoCase, hasDifferentValues, hasHttpPrefix, hasNonNullValue, hasPortNumber, hasSameTimezone, hasSameValues, hasValueFunction, hasValueOrNotEmpty, hasValueOrNotEmptyObject, hasWebsiteDomain, hasWebsiteTopLevelDomain, hashSetForIndexed, hourToFractionalHour, hoursAndMinutesToString, idBatchFactory, incrementingNumberFactory, indexDeltaGroup, indexDeltaGroupFunction, indexRange, indexRangeCheckFunction, indexRangeCheckReaderFunction, indexRangeForArray, indexRangeOverlapsIndexRange, indexRangeOverlapsIndexRangeFunction, indexRangeReaderPairFactory, indexRefMap, indexedValuesArrayAccessorFactory, insertIntoBooleanKeyArray, invertBooleanReturnFunction, invertDecision, invertFilter, invertMaybeBoolean, isAllowed, isClassLikeType, isCompleteUnitedStatesAddress, isConsideredUtcTimezoneString, isDate, isDefaultLatLngPoint, isDefaultLatLngPointValue, isDefaultReadableError, isDefinedAndNotFalse, isDollarAmountString, isE164PhoneNumber, isE164PhoneNumberWithExtension, isEmptyIterable, isEqualContext, isEqualDate, isEqualToValueDecisionFunction, isEvenNumber, isFalseBooleanKeyArray, isFinalPage, isGetter, isISO8601DateString, isISO8601DayString, isISO8601DayStringStart, isInAllowedDaysOfWeekSet, isInNumberBoundFunction, isInSetDecisionFunction, isIndexNumberInIndexRange, isIndexNumberInIndexRangeFunction, isIndexRangeInIndexRange, isIndexRangeInIndexRangeFunction, isIterable, isKnownHttpWebsiteProtocol, isLatLngBound, isLatLngBoundWithinLatLngBound, isLatLngPoint, isLatLngPointWithinLatLngBound, isLatLngString, isLogicalDateStringCode, isMapIdentityFunction, isMaybeNot, isMaybeNotOrTrue, isMaybeSo, isMinuteOfDay, isModelKey, isMonthDaySlashDate, isNonClassFunction, isNotFalse, isNotNullOrEmptyString, isNumberDivisibleBy, isObjectWithConstructor, isOddNumber, isPast, isPromise, isPromiseLike, isSameLatLngBound, isSameLatLngPoint, isSameNonNullValue, isSameVector, isSelectedDecisionFunctionFactory, isSelectedIndexDecisionFunction, isServerError, isSlashPathFile, isSlashPathFolder, isSlashPathTypedFile, isStandardInternetAccessibleWebsiteUrl, isStringOrTrue, isThrottled, isTrueBooleanKeyArray, isUTCDateString, isUnderThreshold, isUniqueKeyedFunction, isUsStateCodeString, isValidLatLngPoint, isValidLatitude, isValidLongitude, isValidNumberBound, isValidPhoneExtensionNumber, isValidSlashPath, isWebsiteUrl, isWebsiteUrlWithPrefix, isWithinLatLngBoundFunction, isolateSlashPath, isolateSlashPathFunction, isolateWebsitePathFunction, itemCountForBatchIndex, iterableToArray, iterableToMap, iterableToSet, iterablesAreSetEquivalent, iterate, iterateFilteredPages, joinHostAndPort, joinStrings, joinStringsWithCommas, joinStringsWithSpaces, keepCharactersAfterFirstCharacterOccurence, keepCharactersAfterFirstCharacterOccurenceFunction, keepFromSetCopy, keepValuesFromArray, keepValuesFromSet, keyValueMapFactory, labeledValueMap, lastValue, latLngBound, latLngBoundCenterPoint, latLngBoundEastBound, latLngBoundFromInput, latLngBoundFullyWrapsMap, latLngBoundFunction, latLngBoundNorthBound, latLngBoundNorthEastPoint, latLngBoundNorthWestPoint, latLngBoundOverlapsLatLngBound, latLngBoundSouthBound, latLngBoundSouthEastPoint, latLngBoundSouthWestPoint, latLngBoundStrictlyWrapsMap, latLngBoundTuple, latLngBoundTupleFunction, latLngBoundWestBound, latLngBoundWrapsMap, latLngDataPointFunction, latLngPoint, latLngPointFromString, latLngPointFunction, latLngPointPrecisionFunction, latLngString, latLngStringFunction, latLngTuple, latLngTupleFunction, limitArray, lonLatTuple, lowercaseFirstLetter, mailToUrlString, makeBestFit, makeCopyModelFieldFunction, makeDateMonthForMonthOfYear, makeDefaultNonConcurrentTaskKeyFactory, makeGetter, makeHandler, makeHashDecodeMap, makeKeyPairs, makeModelConversionFieldValuesFunction, makeModelMap, makeModelMapFunctions, makeMultiModelKeyMap, makeTimer, makeValuesGroupMap, makeWithFactory, makeWithFactoryInput, mapArrayFunction, mapFunctionOutput, mapFunctionOutputPair, mapGetter, mapGetterFactory, mapIdentityFunction, mapIterable, mapKeysIntersectionObjectToArray, mapMaybeFunction, mapObjectKeysFunction, mapObjectKeysToLowercase, mapObjectMap, mapObjectMapFunction, mapObjectToTargetObject, mapPromiseOrValue, mapToObject, mapToTuples, mapValuesToSet, mappedUseAsyncFunction, mappedUseFunction, mapsHaveSameKeys, maybeMergeModelModifiers, maybeMergeModifiers, maybeModifierMapToFunction, maybeSet, mergeArrays, mergeArraysIntoArray, mergeFilterFunctions, mergeModifiers, mergeObjects, mergeObjectsFunction, mergeSlashPaths, messageFromError, millisecondsToMinutesAndSeconds, mimetypeForImageType, minAndMaxFunction, minAndMaxIndex, minAndMaxIndexFunction, minAndMaxIndexItemsFunction, minAndMaxNumber, minutesToFractionalHours, minutesToHoursAndMinutes, modelFieldConversions, modelFieldMapFunction, modelFieldMapFunctions, modelTypeDataPairFactory, modifier, modifierMapToFunction, modifyModelMapFunction, modifyModelMapFunctions, monthDaySlashDateToDateString, monthOfYearFromDate, monthOfYearFromDateMonth, monthOfYearFromUTCDate, multiKeyValueMapFactory, multiValueMapBuilder, neMostLatLngPoint, nearestDivisibleValues, numberStringDencoder, numberStringDencoderDecodedNumberValueFunction, numberStringDencoderEncodedStringValueFunction, numberStringDencoderFunction, objectCopyFactory, objectDeltaArrayCompressor, objectFieldEqualityChecker, objectFlatMergeMatrix, objectHasKey, objectHasKeys, objectHasNoKeys, objectIsEmpty, objectKeyEqualityComparatorFunction, objectKeysEqualityComparatorFunction, objectMergeMatrix, objectToMap, objectToTuples, overlapsLatLngBoundFunction, overrideInObject, overrideInObjectFunctionFactory, padStartFunction, pairGroupValues, parseISO8601DayStringToUTCDate, partialServerError, passThrough, percentNumberFromDecimal, percentNumberToDecimal, performAsyncTask, performAsyncTasks, performBatchLoop, performMakeLoop, performTaskCountLoop, performTaskLoop, performTasksFromFactoryInParallelFunction, performTasksInParallel, performTasksInParallelFunction, pickOneRandomly, poll, primativeKeyDencoder, primativeKeyDencoderMap, primativeKeyStringDencoder, primativeValuesDelta, promiseReference, protectedFactory, pushArrayItemsIntoArray, pushElementOntoArray, pushItemOrArrayItemsIntoArray, randomArrayFactory, randomArrayIndex, randomBoolean, randomEmailFactory, randomFromArrayFactory, randomLatLngFactory, randomLatLngFromCenterFactory, randomNumber, randomNumberFactory, randomPhoneNumberFactory, randomPickFactory, range, rangedIndexedValuesArrayAccessorFactory, rangedIndexedValuesArrayAccessorInfoFactory, readBooleanKeySafetyWrap, readDomainFromEmailAddress, readDomainsFromEmailAddresses, readEmailDomainFromUrlOrEmailAddress, readIndexNumber, readKeysFrom, readKeysFromFilterUniqueFunctionAdditionalKeys, readKeysFromFilterUniqueFunctionAdditionalKeysInput, readKeysFunction, readKeysSetFrom, readKeysSetFunction, readKeysToMap, readModelKey, readModelKeyFromObject, readModelKeys, readModelKeysFromObjects, readMultipleKeysToMap, readPortNumber, readUniqueModelKey, readWebsiteProtocol, readableError, readableStreamToBase64, readableStreamToBuffer, readableStreamToStringFunction, rectangleOverlapsRectangle, reduceBooleansFn, reduceBooleansWithAnd, reduceBooleansWithAndFn, reduceBooleansWithOr, reduceBooleansWithOrFn, reduceNumbers, reduceNumbersFn, reduceNumbersWithAdd, reduceNumbersWithAddFn, reduceNumbersWithMax, reduceNumbersWithMaxFn, reduceNumbersWithMin, reduceNumbersWithMinFn, removeByKeyFromBooleanKeyArray, removeCharactersAfterFirstCharacterOccurence, removeCharactersAfterFirstCharacterOccurenceFunction, removeExtensionFromPhoneNumber, removeFromBooleanKeyArray, removeFromSet, removeFromSetCopy, removeHttpFromUrl, removeModelsWithKey, removeModelsWithSameKey, removeModifiers, removeTrailingFileTypeSeparators, removeTrailingSlashes, removeValuesAtIndexesFromArrayCopy, removeWebProtocolPrefix, repeatString, replaceCharacterAtIndexIf, replaceCharacterAtIndexWith, replaceInvalidFilePathTypeSeparatorsInSlashPath, replaceInvalidFilePathTypeSeparatorsInSlashPathFunction, replaceLastCharacterIf, replaceLastCharacterIfIsFunction, replaceMultipleFilePathsInSlashPath, replaceStringsFunction, requireModelKey, resetPeriodPromiseRateLimiter, restoreOrder, restoreOrderWithValues, reverseCompareFn, roundNumberToStepFunction, roundNumberUpToStep, roundToPrecision, roundToPrecisionFunction, roundingFunction, runAsyncTaskForValue, runAsyncTasksForValues, runNamedAsyncTasks, runNamedAsyncTasksFunction, safeCompareEquality, safeEqualityComparatorFunction, safeFindBestIndexMatch, searchStringFilterFunction, secondsToMinutesAndSeconds, separateValues, separateValuesToSets, sequentialIncrementingNumberStringModelIdFactory, serverError, setContainsAllValues, setContainsAnyValue, setContainsNoneOfValue, setDeltaChangeKeys, setDeltaFunction, setHasValueFunction, setIncludes, setIncludesFunction, setKeysOnMap, setWebProtocolPrefix, setsAreEquivalent, simpleSortValuesFunctionWithSortRef, simplifyWhitespace, slashPathDetails, slashPathFactory, slashPathFolder, slashPathFolderFactory, slashPathInvalidError, slashPathName, slashPathParts, slashPathPathMatcher, slashPathPathMatcherConfig, slashPathStartTypeFactory, slashPathSubPathMatcher, slashPathType, slashPathValidationFactory, sliceIndexRangeFunction, sliceStringFunction, sortAscendingIndexNumberRefFunction, sortByIndexAscendingCompareFunction, sortByIndexRangeAscendingCompareFunction, sortByLabelFunction, sortByNumberFunction, sortByStringFunction, sortCompareNumberFunction, sortNumbersAscendingFunction, sortValues, sortValuesFunctionOrMapIdentityWithSortRef, sortValuesFunctionWithSortRef, spaceSeparatedCssClasses, splitCommaSeparatedString, splitCommaSeparatedStringToSet, splitFront, splitJoinNameString, splitJoinRemainder, splitStringAtFirstCharacterOccurence, splitStringAtFirstCharacterOccurenceFunction, splitStringAtIndex, splitStringTreeFactory, startOfDayForSystemDateInUTC, startOfDayForUTCDateInUTC, stepsFromIndex, stepsFromIndexFunction, stringCharactersToIndexRecord, stringContains, stringFactoryFromFactory, stringFromDateFactory, stringFromTimeFactory, stringToLowercaseFunction, stringToUppercaseFunction, stringTrimFunction, sumOfIntegersBetween, swMostLatLngPoint, symmetricDifferenceArray, symmetricDifferenceArrayBetweenSets, symmetricDifferenceWithModels, takeFront, takeLast, takeValuesFromIterable, telUrlString, telUrlStringForE164PhoneNumberPair, terminatingFactoryFromArray, throwKeyIsRequired, timePeriodCounter, timer, toAbsoluteSlashPathStartType, toCaseInsensitiveStringArray, toMinuteOfDay, toModelFieldConversions, toModelMapFunctions, toReadableError, toRelativeSlashPathStartType, toggleInSet, toggleInSetCopy, toggleTimerRunning, transformNumberFunction, transformNumberFunctionConfig, transformStringFunction, transformStringFunctionConfig, transformStrings, trimArray, tryWithPromiseFactoriesFunction, typedServiceRegistry, unique, uniqueCaseInsensitiveStrings, uniqueCaseInsensitiveStringsSet, uniqueKeys, uniqueModels, unitedStatesAddressString, unixTimeNumberForNow, unixTimeNumberFromDate, unixTimeNumberFromDateOrTimeNumber, unixTimeNumberToDate, updateMaybeValue, urlWithoutParameters, useAsync, useCallback, useContextFunction, useIterableOrValue, useModelOrKey, usePromise, useValue, validLatLngPoint, validLatLngPointFunction, valueAtIndex, valuesAreBothNullishOrEquivalent, valuesFromPOJO, valuesFromPOJOFunction, vectorMinimumSizeResizeFunction, vectorsAreEqual, waitForMs, websiteDomainAndPathPair, websiteDomainAndPathPairFromWebsiteUrl, websitePathAndQueryPair, websitePathFromWebsiteDomainAndPath, websitePathFromWebsiteUrl, websiteUrlDetails, websiteUrlFromPaths, wrapIndexRangeFunction, wrapLatLngPoint, wrapLngValue, wrapMapFunctionOutput, wrapNumberFunction, wrapTuples, wrapUseAsyncFunction, wrapUseFunction };
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ArrayOrValue } from './array';
|
|
1
2
|
import { type ReadKeyFunction } from '../key';
|
|
2
3
|
import { type MapFunction } from '../value/map';
|
|
3
4
|
import { type TransformStringFunctionConfig } from '../string/transform';
|
|
@@ -21,7 +22,11 @@ export interface FilterUniqueStringsTransformConfig extends TransformStringFunct
|
|
|
21
22
|
*
|
|
22
23
|
* Ignored if toLowercase or toUppercase is used for transforming.
|
|
23
24
|
*/
|
|
24
|
-
caseInsensitive?: boolean;
|
|
25
|
+
readonly caseInsensitive?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Will exclude these values from the result.
|
|
28
|
+
*/
|
|
29
|
+
readonly exclude?: ArrayOrValue<string>;
|
|
25
30
|
}
|
|
26
31
|
/**
|
|
27
32
|
* Transforms an array of strings into an array of unique strings.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AuthRole, type AuthRoleSet } from './auth.role';
|
|
2
2
|
import { type ArrayOrValue } from '../array/array';
|
|
3
|
-
import { SetIncludesMode } from '../set';
|
|
3
|
+
import { type SetIncludesMode } from '../set';
|
|
4
4
|
import { type Maybe } from '../value/maybe.type';
|
|
5
5
|
/**
|
|
6
6
|
* Key in the claims.
|
package/src/lib/boolean.d.ts
CHANGED
package/src/lib/date/minute.d.ts
CHANGED
package/src/lib/path/path.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type MapSameFunction } from '../value/map';
|
|
2
|
-
import { DecisionFunction } from '../value/decision';
|
|
2
|
+
import { type DecisionFunction } from '../value/decision';
|
|
3
3
|
import { type ArrayOrValue } from '../array/array';
|
|
4
4
|
import { type FactoryWithRequiredInput } from '../getter/getter';
|
|
5
5
|
import { type PrimativeValue } from '../type';
|
|
6
|
-
import { Maybe } from '../value/maybe.type';
|
|
7
|
-
import { IndexRangeInput } from '../value/indexed';
|
|
6
|
+
import { type Maybe } from '../value/maybe.type';
|
|
7
|
+
import { type IndexRangeInput } from '../value/indexed';
|
|
8
8
|
export declare const SLASH_PATH_SEPARATOR = "/";
|
|
9
9
|
export declare const SLASH_PATH_FILE_TYPE_SEPARATOR = ".";
|
|
10
10
|
export type SlashPathSeparatorString = typeof SLASH_PATH_SEPARATOR;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AsyncFactory } from '../getter/getter';
|
|
2
|
-
import { Maybe } from '../value';
|
|
3
|
-
import { RunAsyncTasksForValuesConfig } from './promise';
|
|
1
|
+
import { type AsyncFactory } from '../getter/getter';
|
|
2
|
+
import { type Maybe } from '../value';
|
|
3
|
+
import { type RunAsyncTasksForValuesConfig } from './promise';
|
|
4
4
|
/**
|
|
5
5
|
* A function that returns a Promise, typically returning void/no value.
|
|
6
6
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type MapFunction } from '../value/map';
|
|
2
2
|
import { type ArrayOrValue } from '../array/array';
|
|
3
3
|
import { type PrimativeKey } from '../key';
|
|
4
|
-
import { HandleResult, InternalHandlerFunction, type Handler, type HandlerAccessor, type HandlerSetAccessor } from './handler';
|
|
4
|
+
import { type HandleResult, type InternalHandlerFunction, type Handler, type HandlerAccessor, type HandlerSetAccessor } from './handler';
|
|
5
5
|
/**
|
|
6
6
|
* Wraps a HandlerAccessor and the item it is bound to in order to be a HandlerSetAccessor.
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FactoryWithInput, type Factory, type FactoryWithRequiredInput } from '../getter';
|
|
2
|
-
import { Maybe } from '../value';
|
|
3
|
-
import { TransformStringFunctionConfig } from './transform';
|
|
1
|
+
import { type FactoryWithInput, type Factory, type FactoryWithRequiredInput } from '../getter';
|
|
2
|
+
import { type Maybe } from '../value';
|
|
3
|
+
import { type TransformStringFunctionConfig } from './transform';
|
|
4
4
|
export type StringFactory<K extends string = string> = Factory<K>;
|
|
5
5
|
export type ToStringFunction<T, K extends string = string> = FactoryWithRequiredInput<K, T>;
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ArrayOrValue } from '../array';
|
|
1
|
+
import { type ArrayOrValue } from '../array';
|
|
2
2
|
import { type MapFunction } from '../value/map';
|
|
3
|
-
import { MaybeNot, type Maybe } from '../value/maybe.type';
|
|
3
|
+
import { type MaybeNot, type Maybe } from '../value/maybe.type';
|
|
4
4
|
/**
|
|
5
5
|
* Converts a string to a value.
|
|
6
6
|
*/
|
|
@@ -11,9 +11,10 @@ export interface ExpandTree<T> {
|
|
|
11
11
|
* These child values will be recursively processed to form child nodes.
|
|
12
12
|
*
|
|
13
13
|
* @param value The current value of type T to retrieve children for.
|
|
14
|
+
* @param depth The depth of the current node.
|
|
14
15
|
* @returns An array of child values of type T, or undefined/null if no children exist.
|
|
15
16
|
*/
|
|
16
|
-
getChildren(value: T): Maybe<T[]>;
|
|
17
|
+
getChildren(value: T, depth: number): Maybe<T[]>;
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* Extended ExpandTree configuration that includes a custom node builder.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type ArrayOrValue } from '../array/array';
|
|
2
|
+
import { type Maybe } from '../value/maybe.type';
|
|
3
|
+
import { type TreeNode } from './tree';
|
|
4
|
+
/**
|
|
5
|
+
* Decides how to visit a node during tree exploration.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ExploreTreeVisitNodeDecision: {
|
|
8
|
+
/**
|
|
9
|
+
* Visits all nodes and children
|
|
10
|
+
*/
|
|
11
|
+
readonly VISIT_ALL: 0;
|
|
12
|
+
/**
|
|
13
|
+
* Visits the node only
|
|
14
|
+
*/
|
|
15
|
+
readonly VISIT_NODE_ONLY: 1;
|
|
16
|
+
/**
|
|
17
|
+
* Visits the node and its children
|
|
18
|
+
*/
|
|
19
|
+
readonly VISIT_CHILDREN_ONLY: 2;
|
|
20
|
+
/**
|
|
21
|
+
* No value will be visited
|
|
22
|
+
*/
|
|
23
|
+
readonly SKIP_ALL: 3;
|
|
24
|
+
};
|
|
25
|
+
export type ExploreTreeVisitNodeDecision = (typeof ExploreTreeVisitNodeDecision)[keyof typeof ExploreTreeVisitNodeDecision];
|
|
26
|
+
/**
|
|
27
|
+
* A function that determines if a node should be visited.
|
|
28
|
+
*
|
|
29
|
+
* The mapped value is also present.
|
|
30
|
+
*/
|
|
31
|
+
export type ExploreTreeVisitNodeDecisionFunction<N extends TreeNode<unknown>, V = N> = (node: N, nodeMappedValue: V) => ExploreTreeVisitNodeDecision;
|
|
32
|
+
/**
|
|
33
|
+
* A function that visits a node.
|
|
34
|
+
*/
|
|
35
|
+
export type ExploreTreeVisitNodeFunction<N extends TreeNode<unknown>, V> = (value: V, node: N) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a traversal function that can be used to visit nodes.
|
|
38
|
+
*/
|
|
39
|
+
export type ExploreTreeTraversalFactoryFunction<N extends TreeNode<unknown>, V> = (visit: ExploreTreeVisitNodeFunction<N, V>, traverseTree: (tree: N) => void) => (node: N, nodeMappedValue: V, visitDecision: ExploreTreeVisitNodeDecision) => void;
|
|
40
|
+
export interface ExploreTreeFunctionConfig<N extends TreeNode<unknown>, V = N> {
|
|
41
|
+
/**
|
|
42
|
+
* A custom traversal function to use instead of the default traversal function.
|
|
43
|
+
*/
|
|
44
|
+
traverseFunctionFactory?: ExploreTreeTraversalFactoryFunction<N, V>;
|
|
45
|
+
/**
|
|
46
|
+
* A function that maps a node to a specific value before visiting it.
|
|
47
|
+
*/
|
|
48
|
+
mapNodeFunction?: (node: N) => V;
|
|
49
|
+
/**
|
|
50
|
+
* A function that determines if a node should be visited.
|
|
51
|
+
*/
|
|
52
|
+
shouldVisitNodeFunction?: Maybe<ExploreTreeVisitNodeDecisionFunction<N, V>>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Explores the input trees.
|
|
56
|
+
*/
|
|
57
|
+
export type ExploreTreeFunction<N extends TreeNode<unknown, N>, V> = (trees: ArrayOrValue<N>, visit: ExploreTreeVisitNodeFunction<N, V>, override?: ExploreTreeFunctionConfig<N, V>) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Convenience function for exploring the input trees
|
|
60
|
+
|
|
61
|
+
* @param trees
|
|
62
|
+
* @param visitNodeFn
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
export declare function exploreTreeFunction<N extends TreeNode<unknown, N>, V>(config?: Maybe<ExploreTreeFunctionConfig<N, V>>): ExploreTreeFunction<N, V>;
|
|
66
|
+
/**
|
|
67
|
+
* A depth-first traversal factory function.
|
|
68
|
+
*
|
|
69
|
+
* @returns A ExploreTreeTraversalFactoryFunction<N, V>.
|
|
70
|
+
*/
|
|
71
|
+
export declare function depthFirstExploreTreeTraversalFactoryFunction<N extends TreeNode<unknown, N>, V>(): ExploreTreeTraversalFactoryFunction<N, V>;
|
|
72
|
+
/**
|
|
73
|
+
* A breadth-first traversal factory function.
|
|
74
|
+
*
|
|
75
|
+
* Visits nodes level by level, processing all nodes at depth N before moving to depth N+1.
|
|
76
|
+
*
|
|
77
|
+
* @returns A ExploreTreeTraversalFactoryFunction<N, V>.
|
|
78
|
+
*/
|
|
79
|
+
export declare function breadthFirstExploreTreeTraversalFactoryFunction<N extends TreeNode<unknown, N>, V>(): ExploreTreeTraversalFactoryFunction<N, V>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { type ArrayOrValue } from '../array/array';
|
|
2
|
+
import { type Maybe } from '../value/maybe.type';
|
|
1
3
|
import { type TreeNode } from './tree';
|
|
4
|
+
import { type ExploreTreeFunctionConfig, ExploreTreeVisitNodeDecision, type ExploreTreeVisitNodeDecisionFunction } from './tree.explore';
|
|
2
5
|
/**
|
|
3
6
|
* A function that flattens a tree structure into an array of values.
|
|
4
7
|
*
|
|
@@ -6,13 +9,42 @@ import { type TreeNode } from './tree';
|
|
|
6
9
|
* @template V The type of values in the resulting flattened array.
|
|
7
10
|
* @param tree The root node of the tree to flatten.
|
|
8
11
|
* @param array Optional. An existing array to push the flattened values into. If not provided, a new array is created.
|
|
12
|
+
* @param addNodeFn Optional. A function to determine if a node should be visited. If not provided, all nodes are visited.
|
|
9
13
|
* @returns An array containing the flattened values from the tree.
|
|
10
14
|
*/
|
|
11
|
-
export type FlattenTreeFunction<N extends TreeNode<unknown>, V> = (
|
|
15
|
+
export type FlattenTreeFunction<N extends TreeNode<unknown>, V> = (trees: ArrayOrValue<N>, array?: V[], addNodeFn?: Maybe<FlattenTreeAddNodeDecisionFunction<N, V>>) => V[];
|
|
16
|
+
/**
|
|
17
|
+
* Decides how to add a node to the flattened array during flattening.
|
|
18
|
+
*/
|
|
19
|
+
export declare const FlattenTreeAddNodeDecision: {
|
|
20
|
+
/**
|
|
21
|
+
* Add all nodes and children
|
|
22
|
+
*/
|
|
23
|
+
readonly ADD_ALL: 0;
|
|
24
|
+
/**
|
|
25
|
+
* Add the node only
|
|
26
|
+
*/
|
|
27
|
+
readonly ADD_NODE_ONLY: 1;
|
|
28
|
+
/**
|
|
29
|
+
* Add the node and its children
|
|
30
|
+
*/
|
|
31
|
+
readonly ADD_CHILDREN_ONLY: 2;
|
|
32
|
+
/**
|
|
33
|
+
* No value will be added
|
|
34
|
+
*/
|
|
35
|
+
readonly SKIP_ALL: 3;
|
|
36
|
+
};
|
|
37
|
+
export type FlattenTreeAddNodeDecision = ExploreTreeVisitNodeDecision;
|
|
38
|
+
/**
|
|
39
|
+
* A function that determines if a node should be visited.
|
|
40
|
+
*
|
|
41
|
+
* The mapped value is also present.
|
|
42
|
+
*/
|
|
43
|
+
export type FlattenTreeAddNodeDecisionFunction<N extends TreeNode<unknown>, V = N> = ExploreTreeVisitNodeDecisionFunction<N, V>;
|
|
12
44
|
/**
|
|
13
45
|
* Traverses the tree and flattens it into all tree nodes.
|
|
14
46
|
*/
|
|
15
|
-
export declare function flattenTree<N extends TreeNode<unknown> = TreeNode<unknown>>(tree: N): N[];
|
|
47
|
+
export declare function flattenTree<N extends TreeNode<unknown> = TreeNode<unknown>>(tree: N, addNodeFn?: Maybe<FlattenTreeAddNodeDecisionFunction<N>>): N[];
|
|
16
48
|
/**
|
|
17
49
|
* Traverses the tree and pushes the nodes into the input array.
|
|
18
50
|
*
|
|
@@ -20,7 +52,10 @@ export declare function flattenTree<N extends TreeNode<unknown> = TreeNode<unkno
|
|
|
20
52
|
* @param array
|
|
21
53
|
* @returns
|
|
22
54
|
*/
|
|
23
|
-
export declare function flattenTreeToArray<N extends TreeNode<unknown> = TreeNode<unknown>>(tree: N, array: N[]): N[];
|
|
55
|
+
export declare function flattenTreeToArray<N extends TreeNode<unknown> = TreeNode<unknown>>(tree: N, array: N[], addNodeFn?: Maybe<FlattenTreeAddNodeDecisionFunction<N>>): N[];
|
|
56
|
+
export interface FlattenTreeToArrayFunctionConfig<N extends TreeNode<unknown>, V> extends Omit<ExploreTreeFunctionConfig<N, V>, 'shouldVisitNodeFunction'> {
|
|
57
|
+
readonly shouldAddNodeFunction?: Maybe<FlattenTreeAddNodeDecisionFunction<N, V>>;
|
|
58
|
+
}
|
|
24
59
|
/**
|
|
25
60
|
* Creates a FlattenTreeFunction that flattens tree nodes themselves into an array.
|
|
26
61
|
*
|
|
@@ -28,6 +63,13 @@ export declare function flattenTreeToArray<N extends TreeNode<unknown> = TreeNod
|
|
|
28
63
|
* @returns A FlattenTreeFunction that collects nodes of type N.
|
|
29
64
|
*/
|
|
30
65
|
export declare function flattenTreeToArrayFunction<N extends TreeNode<unknown>>(): FlattenTreeFunction<N, N>;
|
|
66
|
+
/**
|
|
67
|
+
* Creates a FlattenTreeFunction that flattens tree nodes themselves into an array.
|
|
68
|
+
*
|
|
69
|
+
* @template N The type of the tree node.
|
|
70
|
+
* @returns A FlattenTreeFunction that collects nodes of type N.
|
|
71
|
+
*/
|
|
72
|
+
export declare function flattenTreeToArrayFunction<N extends TreeNode<unknown, N>, V>(config: FlattenTreeToArrayFunctionConfig<N, V>): FlattenTreeFunction<N, V>;
|
|
31
73
|
/**
|
|
32
74
|
* Creates a FlattenTreeFunction that flattens tree nodes into an array of mapped values.
|
|
33
75
|
*
|
|
@@ -36,12 +78,14 @@ export declare function flattenTreeToArrayFunction<N extends TreeNode<unknown>>(
|
|
|
36
78
|
* @param mapNodeFn An optional function to transform each node N into a value V. If not provided, nodes are returned as is.
|
|
37
79
|
* @returns A FlattenTreeFunction that collects values of type V.
|
|
38
80
|
*/
|
|
39
|
-
export declare function flattenTreeToArrayFunction<N extends TreeNode<unknown, N>, V>(mapNodeFn?: (node: N) => V): FlattenTreeFunction<N, V>;
|
|
81
|
+
export declare function flattenTreeToArrayFunction<N extends TreeNode<unknown, N>, V>(mapNodeFn?: (node: N) => V, defaultAddNodeFn?: Maybe<FlattenTreeAddNodeDecisionFunction<N, V>>): FlattenTreeFunction<N, V>;
|
|
40
82
|
/**
|
|
41
|
-
* Convenience function for flattening multiple trees with a flatten function.
|
|
83
|
+
* Convenience function for flattening multiple trees with a single configured flatten function.
|
|
84
|
+
*
|
|
85
|
+
* @deprecated FlattenTreeFunction now supports an array of trees.
|
|
42
86
|
*
|
|
43
87
|
* @param trees
|
|
44
88
|
* @param flattenFn
|
|
45
89
|
* @returns
|
|
46
90
|
*/
|
|
47
|
-
export declare function flattenTrees<N extends TreeNode<unknown, N>, V>(trees: N
|
|
91
|
+
export declare function flattenTrees<N extends TreeNode<unknown, N>, V>(trees: ArrayOrValue<N>, flattenFn: FlattenTreeFunction<N, V>, addNodeFn?: Maybe<FlattenTreeAddNodeDecisionFunction<N, V>>): V[];
|
package/test/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [12.5.5](https://github.com/dereekb/dbx-components/compare/v12.5.4-dev...v12.5.5) (2025-10-18)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
## [12.5.4](https://github.com/dereekb/dbx-components/compare/v12.5.3-dev...v12.5.4) (2025-10-17)
|
|
6
10
|
|
|
7
11
|
|