Closed jose-nunez closed 5 years ago
Yes, the type
property is just a setter function - see here for details. The example you wrote above will work fine.
Got it. This is the working example:
const args = [
{ name: 'name', alias: 'n', type: String },
{ name: 'age', alias: 'a', type: Number },
{ name: 'birth', type: myDate => new Date(myDate) }
]
The first one returns a string
Thanks a lot!
Hi. Thanks for this package! Is it possible to convert arguments to Date, the same way you do with String or Number? Something like:
I built a wrapper that will convert Dates and also Json objects from the input. I'll try to bring them to the package one day