File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,36 @@ if (noRequiredFieldsValidator(input)) {
205
205
if ( typeof input . c !== 'undefined' ) assertType < string > ( input . c )
206
206
}
207
207
208
+ const signupValidator = createValidator ( {
209
+ type : 'object' ,
210
+ properties : {
211
+ email : {
212
+ type : 'string'
213
+ } ,
214
+ paymentInformation : {
215
+ type : 'object' ,
216
+ properties : {
217
+ plan : { type : 'string' } ,
218
+ token : { type : 'string' }
219
+ } ,
220
+ required : [
221
+ 'plan' as 'plan' ,
222
+ 'token' as 'token'
223
+ ]
224
+ }
225
+ } ,
226
+ required : [
227
+ 'paymentInformation'
228
+ ]
229
+ } )
230
+
231
+ if ( signupValidator ( input ) ) {
232
+ if ( typeof input . email !== 'string' ) assertType < undefined > ( input . email )
233
+ if ( typeof input . email !== 'undefined' ) assertType < string > ( input . email )
234
+ assertType < string > ( input . paymentInformation . plan )
235
+ assertType < string > ( input . paymentInformation . token )
236
+ }
237
+
208
238
const animalValidator = createValidator ( {
209
239
oneOf : [
210
240
{
You can’t perform that action at this time.
0 commit comments