mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-07 17:36:00 +00:00
change(developer/compilers): parseWordlist can take a WordListSource instance
This commit is contained in:
parent
59a3af04e2
commit
ca89784635
1 changed files with 4 additions and 2 deletions
|
|
@ -74,9 +74,11 @@ export function parseWordListFromFilename(wordlist: WordList, filename: string):
|
|||
* @param contents contents of the file to import
|
||||
*
|
||||
*/
|
||||
export function parseWordList(wordlist: WordList, contents: string): void {
|
||||
export function parseWordList(wordlist: WordList, contents: string | WordListSource): void {
|
||||
const TAB = "\t";
|
||||
let source = new WordListFromMemory(contents);
|
||||
let source = typeof contents == "string"
|
||||
? new WordListFromMemory(contents)
|
||||
: contents;
|
||||
|
||||
// @ts-ignore: unused
|
||||
for (let [lineno, line] of source.lines()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue