File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ const generateUISchemaType = ({
42
42
uiSchema,
43
43
formData
44
44
} ) => {
45
+ const isTelephone = ( propName ) => _ . has ( uiSchema , `${ propName } .ui:options.inputType` ) ;
45
46
/**
46
47
* Todo: do something with uiSchema validations here
47
48
* maxLength
@@ -51,6 +52,10 @@ const generateUISchemaType = ({
51
52
* maximum
52
53
*/
53
54
Object . keys ( schema . properties ) . forEach ( ( schemaProp ) => {
55
+ const isTelephoneNumber = isTelephone ( schemaProp ) ? '+3119121345' : namor . generate ( {
56
+ words : 3 ,
57
+ saltLength : 0 ,
58
+ } ) ;
54
59
let data =
55
60
schema . properties [ schemaProp ] . type === 'number' ||
56
61
schema . properties [ schemaProp ] . type === 'integer'
@@ -59,10 +64,7 @@ const generateUISchemaType = ({
59
64
numbers : 5 ,
60
65
saltLength : 0 ,
61
66
} ) . replace ( 0 , '' )
62
- : namor . generate ( {
63
- words : 3 ,
64
- saltLength : 0 ,
65
- } )
67
+ : isTelephoneNumber
66
68
67
69
if ( schema . properties [ schemaProp ] . maximum ) {
68
70
data = schema . properties [ schemaProp ] . maximum ;
You can’t perform that action at this time.
0 commit comments