UNPKG
lean4-code-actions
Version:
latest (1.1.32)
1.1.32
Refactorings and snippets for Lean 4
lean4-code-actions
/
libs
/
utils
/
Validator
/
parseMany.ts
7 lines
(5 loc)
•
257 B
text/typescript
View Raw
1
2
3
4
5
6
7
import
{ flatten }
from
'remeda'
import
{
Mapper
}
from
'../Mapper'
export
function
parseMany<
Val
,
Err
>(
values
:
Val
[],
parseOne
:
Mapper
<
Val
,
Err
[]>,
parseAll
:
Mapper
<
Val
[],
Err
[]>) {
return
flatten<
Err
[]>(values.
map
(parseOne)).
concat
(
parseAll
(values)) }