@ethnolib/find-language 0.0.5 → 0.0.7

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.
@@ -1,3 +1,5 @@
1
+ export declare function getShortestSufficientLangtag(langtag: string): string | undefined;
2
+ export declare function getMaximalLangtag(langtag: string): string | undefined;
1
3
  export declare function createTag({ languageCode, scriptCode, regionCode, dialectCode, }: {
2
4
  languageCode?: string;
3
5
  scriptCode?: string;
@@ -4,4 +4,5 @@ export declare const START_OF_MATCH_MARKER = "[";
4
4
  export declare const END_OF_MATCH_MARKER = "]";
5
5
  export declare function demarcateResults(results: FuseResult<ILanguage>[]): FuseResult<ILanguage>[];
6
6
  export declare function stripDemarcation(demarcatedText: string | undefined): string | undefined;
7
+ export declare function deepStripDemarcation<T>(demarcated: T): T;
7
8
  export declare function demarcateExactMatches(searchString: string, result: ILanguage): ILanguage;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A library for fuzzy-searching for languages and other utils for language choosers",
4
4
  "author": "SIL Global",
5
5
  "license": "MIT",
6
- "version": "0.0.5",
6
+ "version": "0.0.7",
7
7
  "main": "./index.js",
8
8
  "types": "./index.d.ts",
9
9
  "scripts": {
@@ -1,3 +1,5 @@
1
1
  import { IRegion, IScript } from './findLanguageInterfaces';
2
2
  export declare function getAllRegions(): IRegion[];
3
+ export declare function getRegionBySubtag(code: string): IRegion | undefined;
3
4
  export declare function getAllScripts(): IScript[];
5
+ export declare function getScriptBySubtag(code: string): IScript | undefined;
@@ -2,3 +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;
@@ -1 +0,0 @@
1
- export declare function getShortestSufficientLangtag(langtag: string): string;