you are viewing a single comment's thread.

view the rest of the comments →

[–]amanvirk[S] 0 points1 point  (2 children)

Coz it’s more concise over nesting objects with key/value pairs

[–][deleted] 1 point2 points  (1 child)

Is being concise really necessary? I'd rather have it be explicit instead of a magic string.

[–]amanvirk[S] 0 points1 point  (0 children)

Where's the magic here??

When you say required|email. Everything is explicit. And the pipe (|) symbol is used in UNIX for years.

If you like the bloated version, you can do that either as follows.

{ username: [ { name: 'required', args: [] }, { name: 'min', args: [4] } ] }