@ethnolib/find-language 0.0.20 → 0.0.21
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/index.js +1 -1
- package/index.mjs +5 -4
- package/package.json +1 -1
- package/searchForLanguage.d.ts +1 -1
package/index.mjs
CHANGED
|
@@ -302926,13 +302926,14 @@ function eb(r) {
|
|
|
302926
302926
|
}
|
|
302927
302927
|
return _;
|
|
302928
302928
|
}
|
|
302929
|
-
function tb(r) {
|
|
302930
|
-
var
|
|
302931
|
-
|
|
302929
|
+
function tb(r, m) {
|
|
302930
|
+
var h;
|
|
302931
|
+
const y = new Sn(ts, {
|
|
302932
302932
|
keys: ["languageSubtag", "iso639_3_code"],
|
|
302933
302933
|
threshold: 0
|
|
302934
302934
|
// exact matches only
|
|
302935
|
-
}).search(r)
|
|
302935
|
+
}).search(r);
|
|
302936
|
+
return m ? m(y, r)[0] : (h = y[0]) == null ? void 0 : h.item;
|
|
302936
302937
|
}
|
|
302937
302938
|
const Rh = /* @__PURE__ */ new Set([
|
|
302938
302939
|
"ang",
|
package/package.json
CHANGED
package/searchForLanguage.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import { FuseResult } from 'fuse.js';
|
|
|
2
2
|
import { ILanguage } from './findLanguageInterfaces';
|
|
3
3
|
export declare const fieldsToSearch: string[];
|
|
4
4
|
export declare function searchForLanguage(queryString: string): FuseResult<ILanguage>[];
|
|
5
|
-
export declare function getLanguageBySubtag(code: string): ILanguage | undefined;
|
|
5
|
+
export declare function getLanguageBySubtag(code: string, searchResultModifier?: (results: FuseResult<ILanguage>[], searchString: string) => ILanguage[]): ILanguage | undefined;
|