File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ const generateVariables = variables => {
147147} ;
148148
149149const generateVertex = ( collection , vertexData ) => {
150- const vertexName = collection . collectionName ;
150+ const vertexName = transformToValidGremlinName ( collection . collectionName ) ;
151151 const propertiesScript = addPropertiesScript ( collection , vertexData ) ;
152152
153153 return `${ graphName } .addV(${ JSON . stringify ( vertexName ) } )${ propertiesScript } ` ;
@@ -169,7 +169,7 @@ const generateVertices = (collections, jsonData) => {
169169}
170170
171171const generateEdge = ( from , to , relationship , edgeData ) => {
172- const edgeName = relationship . name ;
172+ const edgeName = transformToValidGremlinName ( relationship . name ) ;
173173 const propertiesScript = addPropertiesScript ( relationship , edgeData ) ;
174174
175175 return `${ from } .addE(${ JSON . stringify ( edgeName ) } ).\n${ DEFAULT_INDENT } to(${ to } )${ propertiesScript } ` ;
@@ -535,7 +535,7 @@ const transformToValidGremlinName = name => {
535535 return DEFAULT_NAME ;
536536 }
537537
538- const nameWithoutSpecialCharacters = name . replace ( / [ \s ` ~ ! @ # % ^ & * ( ) _ | + \- = ? ; : ' " , . < > \{ \} \[ \] \\ \/ ] / gi, '_' ) ;
538+ const nameWithoutSpecialCharacters = name . replace ( / [ \f \t \n \v \r ` ~ ! @ # % ^ & * _ | + \- = ? ; : ' " , . < > \{ \} \[ \] \\ \/ ] / gi, '_' ) ;
539539 const startsFromDigit = nameWithoutSpecialCharacters . match ( / ^ [ 0 - 9 ] .* $ / ) ;
540540
541541 if ( startsFromDigit ) {
You can’t perform that action at this time.
0 commit comments