@baleada/logic 0.24.0 → 0.24.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -42,7 +42,7 @@ function createNumber(options = {}) {
|
|
|
42
42
|
return (string) => parseInt(string, radix);
|
|
43
43
|
}
|
|
44
44
|
function createResults(candidates, options = {}) {
|
|
45
|
-
const narrowedOptions = predicateFunction(options) ? options(fastFuzzy.sortKind) : options, searcher = new fastFuzzy.Searcher(candidates, narrowedOptions);
|
|
45
|
+
const narrowedOptions = predicateFunction(options) ? options({ sortKind: fastFuzzy.sortKind }) : options, searcher = new fastFuzzy.Searcher(candidates, narrowedOptions);
|
|
46
46
|
return (query) => searcher.search(query);
|
|
47
47
|
}
|
|
48
48
|
|
package/lib/index.d.ts
CHANGED
|
@@ -727,10 +727,12 @@ declare function createSanitize(options?: Config): StringTransform<string>;
|
|
|
727
727
|
declare function createNumber(options?: {
|
|
728
728
|
radix?: number;
|
|
729
729
|
}): StringTransform<number>;
|
|
730
|
-
type CreateResultsOptions<Candidate extends string | object,
|
|
731
|
-
returnMatchData?:
|
|
730
|
+
type CreateResultsOptions<Candidate extends string | object, ReturnsMatchData extends boolean> = Omit<FullOptions<Candidate>, 'returnMatchData'> & {
|
|
731
|
+
returnMatchData?: ReturnsMatchData;
|
|
732
732
|
};
|
|
733
|
-
declare function createResults<Candidate extends string | object,
|
|
733
|
+
declare function createResults<Candidate extends string | object, ReturnsMatchData extends boolean = false>(candidates: Candidate[], options?: (CreateResultsOptions<Candidate, ReturnsMatchData> | ((api: {
|
|
734
|
+
sortKind: typeof sortKind;
|
|
735
|
+
}) => CreateResultsOptions<Candidate, ReturnsMatchData>))): StringTransform<ReturnsMatchData extends true ? MatchData<Candidate>[] : Candidate[]>;
|
|
734
736
|
|
|
735
737
|
type ToGraphYielded = {
|
|
736
738
|
node: GraphNode<string>;
|
package/lib/index.js
CHANGED
|
@@ -40,7 +40,7 @@ function createNumber(options = {}) {
|
|
|
40
40
|
return (string) => parseInt(string, radix);
|
|
41
41
|
}
|
|
42
42
|
function createResults(candidates, options = {}) {
|
|
43
|
-
const narrowedOptions = predicateFunction(options) ? options(sortKind) : options, searcher = new Searcher(candidates, narrowedOptions);
|
|
43
|
+
const narrowedOptions = predicateFunction(options) ? options({ sortKind }) : options, searcher = new Searcher(candidates, narrowedOptions);
|
|
44
44
|
return (query) => searcher.search(query);
|
|
45
45
|
}
|
|
46
46
|
|