We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 45d4c5e commit aed9d52Copy full SHA for aed9d52
1 file changed
src/dictionary/parallel_parser.ts
@@ -90,16 +90,18 @@ export async function parseDictionary(source: string): Promise<Dictionary> {
90
}
91
continue;
92
93
- if (errors.length === 0) {
94
- for (const [word, definition] of entries.entries()) {
95
- if (dictionary.has(word)) {
96
- errors.push(new ResultError(`duplicate Toki Pona word "${word}"`));
97
- break;
98
- } else {
99
- dictionary.set(word, definition);
100
- }
+ for (const [word, definition] of entries.entries()) {
+ if (dictionary.has(word)) {
+ errors.push(new ResultError(`duplicate Toki Pona word "${word}"`));
+ break;
+ } else {
+ dictionary.set(word, definition);
101
102
103
104
- return dictionary;
+ if (errors.length === 0) {
+ return dictionary;
105
+ throw new AggregateError(errors);
106
+ }
107
0 commit comments