File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import { distinct } from "@std/collections/distinct" ;
2+ import { distinctBy } from "@std/collections/distinct-by" ;
23import { shuffle } from "@std/random/shuffle" ;
3- import { deduplicateErrors } from "../../misc/deduplicate_errors.ts" ;
44import { errors } from "../../telo_misikeke/telo_misikeke.js" ;
55import { ArrayResult , ArrayResultError } from "../array_result.ts" ;
66import { parser } from "../parser/parser.ts" ;
@@ -31,3 +31,6 @@ export function translate(tokiPona: string): ArrayResult<string> {
3131 return ArrayResult . errors ( error ) ;
3232 }
3333}
34+ function deduplicateErrors < const T extends Error > ( errors : Iterable < T > ) {
35+ return distinctBy ( errors , ( { message } ) => message ) ;
36+ }
You can’t perform that action at this time.
0 commit comments