@baleada/logic 0.24.0 → 0.24.1
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 +3 -1
- 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
|
@@ -730,7 +730,9 @@ declare function createNumber(options?: {
|
|
|
730
730
|
type CreateResultsOptions<Candidate extends string | object, MatchData extends boolean> = Omit<FullOptions<Candidate>, 'returnMatchData'> & {
|
|
731
731
|
returnMatchData?: MatchData;
|
|
732
732
|
};
|
|
733
|
-
declare function createResults<Candidate extends string | object, MatchData extends boolean = false>(candidates: Candidate[], options?: (CreateResultsOptions<Candidate, MatchData> | ((
|
|
733
|
+
declare function createResults<Candidate extends string | object, MatchData extends boolean = false>(candidates: Candidate[], options?: (CreateResultsOptions<Candidate, MatchData> | ((api: {
|
|
734
|
+
sortKind: typeof sortKind;
|
|
735
|
+
}) => CreateResultsOptions<Candidate, MatchData>))): StringTransform<MatchData 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
|
|