@ethnolib/find-language 0.0.9 → 0.0.11

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/package.json CHANGED
@@ -3,14 +3,15 @@
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.9",
6
+ "version": "0.0.11",
7
7
  "main": "./index.js",
8
8
  "types": "./index.d.ts",
9
9
  "scripts": {
10
- "langtag-processing": "ts-node-esm ./langtagProcessing.ts",
10
+ "langtag-processing": "tsx ./langtagProcessing.ts",
11
11
  "build": "nx vite:build",
12
12
  "typecheck": "tsc",
13
- "test": "nx vite:test --config vitest.config.ts"
13
+ "test": "nx vite:test --config vitest.config.ts",
14
+ "lint": "eslint ."
14
15
  },
15
16
  "dependencies": {
16
17
  "fuse.js": "^7.0.0",
@@ -20,11 +21,11 @@
20
21
  "devDependencies": {
21
22
  "@nx/vite": "^19.1.2",
22
23
  "@types/node": "^20.16.11",
23
- "ts-node": "^10.9.2",
24
+ "tsx": "^4.19.2",
24
25
  "typescript": "^5.2.2"
25
26
  },
26
27
  "// We've tested with 18 and have no reason to believe it won't work with higher versions": "",
27
28
  "engines": {
28
- "node": ">=18.0.0"
29
+ "node": ">=18.18"
29
30
  }
30
31
  }
@@ -2,6 +2,7 @@ import { FuseResult } from 'fuse.js';
2
2
  import { ILanguage, IScript } from './findLanguageInterfaces';
3
3
  export declare function stripResultMetadata(results: FuseResult<ILanguage>[]): ILanguage[];
4
4
  export declare function filterScripts(scriptFilter: (value: IScript) => boolean, results: ILanguage[]): ILanguage[];
5
+ export declare function modifyScripts(scriptModifier: (value: IScript) => IScript, results: ILanguage[]): ILanguage[];
5
6
  export declare function codeMatches(code1: string | undefined, code2: string | undefined): boolean;
6
7
  export declare function substituteInSpecialEntry(targetCode: string, getSpecialEntry: (result: ILanguage) => ILanguage, results: ILanguage[]): ILanguage[];
7
8
  export declare function filterLanguageCodes(langCodeFilter: (value: string) => boolean, results: ILanguage[]): ILanguage[];
package/testUtils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ILanguage } from './findLanguageInterfaces';
1
+ import { ILanguage, IScript } from './findLanguageInterfaces';
2
2
  interface ILanguageTestEntry {
3
3
  autonym?: string;
4
4
  exonym?: string;
@@ -6,7 +6,7 @@ interface ILanguageTestEntry {
6
6
  languageSubtag?: string;
7
7
  regionNames?: string;
8
8
  names?: string[];
9
- scripts?: any[];
9
+ scripts?: IScript[];
10
10
  variants?: string;
11
11
  alternativeTags?: string[];
12
12
  }