seneca icon indicating copy to clipboard operation
seneca copied to clipboard

built-in message validation inspired by Vue.js props validation

Open rjrodger opened this issue 4 years ago • 1 comments

Except validation is deep. This:

seneca.add({
  foo: 'bar',
  count: Number,
  what: String,
  obj: {
     zed: Boolean,
     list: [String]
  }
}, action)

rjrodger avatar Jan 11 '21 23:01 rjrodger

@rjrodger Is it currently planned for the implementation of such message validation system to support union types? E.g. if, as a user, I want to match on ‘:foo‘ when it's either 'bar' or 'baz' or null. If yes, then what is the syntax envisioned to be like?

lilsweetcaligula avatar Jun 08 '21 13:06 lilsweetcaligula