Ben M

Results 54 comments of Ben M

Is this somehow possible using a validation function? I still don't really know how this ramda stuff works, though I write some pseudo code) ``` const validationRules = { foo:...

But I'm sure, you could write a function, that does this internally :) A simple function that returns an array of validation rules. But this function does the validation itself...

Okay, I now found a way, to make this possible... It's not very nice, and it's even not working for now, because spected has some issues with null / undefined...

Yeah, I saw that. Maybe there should be some "catch" at the beginning of the `validate` function, that checks if `input` is a "simple type". Then you may also be...

It finally got merged :)

I'd really need some help for the typings... I'm one step further now: ```ts declare function spected(spec: SPEC, input: ROOTINPUT): Result; export type Predicate = (value: INPUT, inputs: ROOTINPUT) =>...

The DefinitelyTyped repo doesn't include the latest version yet. So you may copy and paste the code from my comment above and use it. There's a small problem with TypeScript's...

First let's try to get the `SpecValue` working. The only missing part should be the `((value: INPUT) => any)` (here it needs something better than `any`) After that, I should...

I'll try that and will report back in a few minutes :) --- **EDIT:** So it can be for example: ``` const rules = { foo: (values) => [[val =>...

For objects: yes, true. I forgot that. This is working fine and gives the correct result: ``` const data = { foo: { bar: 42 } } const rules =...