-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
the docs state that Failures will be accumulated in a list
Lines 316 to 332 in 5668595
| ```javascript | |
| List.fromArray([ | |
| Success("a"), | |
| Success("b"), | |
| Success("c") | |
| ]).sequenceValidation() | |
| // => Success(List("a", "b", "c")) | |
| List.fromArray([ | |
| Success("a"), | |
| Success("b"), | |
| Fail("c"), | |
| Fail("d"), | |
| Success("e") | |
| ]).sequenceValidation() | |
| // => Fail(List("c", "d")) | |
| ``` |
const { Success, Fail, List } = require("monet");
> List.fromArray([
... Success("a"),
... Success("b"),
... Success("c")
... ]).sequenceValidation()
{
val: {
isNil: false,
head_: 'a',
tail_: {
isNil: false,
head_: 'b',
tail_: [Object],
size_: 2,
'@@type': 'monet.js/List'
},
size_: 3,
'@@type': 'monet.js/List'
},
isSuccessValue: true,
'@@type': 'monet.js/Validation'
}
> // => Success(List("a", "b", "c"))
undefined
>
> List.fromArray([
... Success("a"),
... Success("b"),
... Fail("c"),
... Fail("d"),
... Success("e")
... ]).sequenceValidation()
{ val: 'cd', isSuccessValue: false, '@@type': 'monet.js/Validation' }And unless I;ve done this wrong, the type in the second example is returned as a string and not a list
"monet": "^0.9.3",
> node --version
v16.13.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels