Olian04 / Recordari

Recordari is a type and structure validation tool for configuration files
MIT License
4 stars 0 forks source link

Add support for shorthand notations #16

Closed Olian04 closed 3 years ago

Olian04 commented 6 years ago

Ex:

R.Object.Like({
  foo: { bar: R.Number }, // R.Object.Like({ bar: R.Number })
  bar: [ R.Number ], // R.Array.Like([ R.Number ])
  biz: 1,  // R.Number.Exact(1)
  boz: 'a',  // R.String.Exact('a')
  baz: true,  // R.Boolean.True
});

Should work everywhere where a Constraint could be used. In object, arrays, "and", "or"

R.Object.Like({
  bar: [ 1, 'yes', R.Function ], // R.Array.Like([ R.Number.Exact(1), R.String.Exact('yes'), R.Function ])
});