File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -126,10 +126,15 @@ const parseLine = (() => {
126
126
continue ;
127
127
}
128
128
129
+ let value = Number ( argument ) ;
130
+ if ( Number . isNaN ( value ) ) {
131
+ value = argument ;
132
+ }
133
+
129
134
if ( options . flatten ) {
130
- result . words . push ( ` ${ letter } ${ argument } ` ) ;
135
+ result . words . push ( letter + value ) ;
131
136
} else {
132
- result . words . push ( [ letter , Number ( argument ) ] ) ;
137
+ result . words . push ( [ letter , value ] ) ;
133
138
}
134
139
}
135
140
Original file line number Diff line number Diff line change @@ -152,11 +152,11 @@ describe('gcode-parser', () => {
152
152
'$H' ,
153
153
'F1000' ,
154
154
'(*** LAYER: 0 ***)' ,
155
- 'T5 M6 ' ,
155
+ 'T5 M06 ' ,
156
156
'S200' ,
157
157
'(* SHAPE Nr: 0 *)' ,
158
158
'G0 X 180.327 Y 137.080' ,
159
- 'M3 '
159
+ 'M03 '
160
160
] . join ( '\n' ) ;
161
161
const expectedResults = [
162
162
'' ,
You can’t perform that action at this time.
0 commit comments