File tree Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -965,16 +965,15 @@ Draw.loadPlugin(function (ui) {
965
965
* @returns
966
966
*/
967
967
function getDbLabel ( label , columnQuantifiers ) {
968
- label = removeHtml ( label ) ;
968
+ let result = removeHtml ( label ) ;
969
969
// fix duplicate spaces and different space chars
970
- label = label
971
- . replace ( / \s + / g, " " ) ;
972
- const firstSpaceIndex = label [ 0 ] == columnQuantifiers . Start &&
973
- label . indexOf ( columnQuantifiers . End + " " ) !== - 1
974
- ? label . indexOf ( columnQuantifiers . End + " " )
975
- : label . indexOf ( " " ) ;
976
- const attributeType = label . substring ( firstSpaceIndex + 1 ) . trim ( ) ;
977
- const attributeName = RemoveNameQuantifiers ( label . substring ( 0 , firstSpaceIndex + 1 ) ) ;
970
+ result = result . toString ( ) . replace ( / \s + / g, " " ) ;
971
+ const firstSpaceIndex = result [ 0 ] == columnQuantifiers . Start &&
972
+ result . indexOf ( columnQuantifiers . End + " " ) !== - 1
973
+ ? result . indexOf ( columnQuantifiers . End + " " )
974
+ : result . indexOf ( " " ) ;
975
+ const attributeType = result . substring ( firstSpaceIndex + 1 ) . trim ( ) ;
976
+ const attributeName = RemoveNameQuantifiers ( result . substring ( 0 , firstSpaceIndex + 1 ) ) ;
978
977
const attribute = {
979
978
attributeName,
980
979
attributeType
Original file line number Diff line number Diff line change @@ -81,16 +81,15 @@ Draw.loadPlugin(function(ui) {
81
81
* @returns
82
82
*/
83
83
function getDbLabel ( label : string , columnQuantifiers : ColumnQuantifiers ) : TableAttribute {
84
- label = removeHtml ( label ) ;
84
+ let result = removeHtml ( label ) ;
85
85
// fix duplicate spaces and different space chars
86
- label = label
87
- . replace ( / \s + / g, " " ) ;
88
- const firstSpaceIndex = label [ 0 ] == columnQuantifiers . Start &&
89
- label . indexOf ( columnQuantifiers . End + " " ) !== - 1
90
- ? label . indexOf ( columnQuantifiers . End + " " )
91
- : label . indexOf ( " " ) ;
92
- const attributeType = label . substring ( firstSpaceIndex + 1 ) . trim ( ) ;
93
- const attributeName = RemoveNameQuantifiers ( label . substring ( 0 , firstSpaceIndex + 1 ) ) ;
86
+ result = result . toString ( ) . replace ( / \s + / g, " " ) ;
87
+ const firstSpaceIndex = result [ 0 ] == columnQuantifiers . Start &&
88
+ result . indexOf ( columnQuantifiers . End + " " ) !== - 1
89
+ ? result . indexOf ( columnQuantifiers . End + " " )
90
+ : result . indexOf ( " " ) ;
91
+ const attributeType = result . substring ( firstSpaceIndex + 1 ) . trim ( ) ;
92
+ const attributeName = RemoveNameQuantifiers ( result . substring ( 0 , firstSpaceIndex + 1 ) ) ;
94
93
const attribute = {
95
94
attributeName,
96
95
attributeType
You can’t perform that action at this time.
0 commit comments