core-decorators icon indicating copy to clipboard operation
core-decorators copied to clipboard

Decorators for validations

Open varunkumar opened this issue 7 years ago • 2 comments

Is there any plan to add decorators for performing various validations - type checks, null checks, custom checks on properties? Does it make sense to have them as part of this collection?

I would be happy to contribute if this seems fit and has potential interests.

varunkumar avatar Oct 04 '17 13:10 varunkumar

No plans, but we can definitely discuss them! I think let's start with describing some concrete examples (with pseudo code) then we can go from there to see if they'd be a good fit.

As a guiding principle: the overall goal of core-decorators right now is mostly to implement decorators for fundamental things. The sort of decorators you might expect to be available by default in JavaScript, but aren't. It's not a strict definition though, if a given decorator is provides enough convenience and utility to be included. 😄

jayphelps avatar Oct 04 '17 19:10 jayphelps

@jayphelps I found a case where I wanted to validate the Type of an argument passed into a method. Would this be something you'd be into having a look at. I'd be stoked to try to contribute

cosmocochrane1 avatar Feb 15 '18 21:02 cosmocochrane1