Skip to content

Commit 3c65653

Browse files
committed
Changed substr to slice
1 parent fbe40dc commit 3c65653

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/views/providers/gcodeTreeParser.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class GCodeTreeParser {
135135
x = -1;
136136
}
137137

138-
if (!(tmp = words[i + x].substr(1)).match(/\./g)) {
138+
if (!(tmp = words[i + x].slice(1)).match(/\./g)) {
139139
// Milliseconds
140140
tmp = Number(tmp) / 1000;
141141
}
@@ -393,12 +393,11 @@ export class GCodeTreeParser {
393393
}
394394

395395
node = new NavTreeNode(
396-
`Spindle On ${words[i + x].substr(1) === undefined ? '' : words[i + x].substr(1)}RPM` +
397-
' CW',
396+
`Spindle On ${words[i + x].slice(1) === undefined ? '' : words[i + x].slice(1)}RPM` + ' CW',
398397
TreeItemCollapsibleState.None,
399398
);
400399
node.tooltip = `Spindle On Clockwise (${
401-
words[i + x].substr(1) === undefined ? '' : words[i + x].substr(1)
400+
words[i + x].slice(1) === undefined ? '' : words[i + x].slice(1)
402401
}RPM)`;
403402
node.setIcon(IconType.SpindleCW);
404403
node.command = {
@@ -419,12 +418,12 @@ export class GCodeTreeParser {
419418
x = -1;
420419
}
421420
node = new NavTreeNode(
422-
`Spindle On ${words[i + x].substr(1) === undefined ? '' : words[i + x].substr(1)}RPM` +
421+
`Spindle On ${words[i + x].slice(1) === undefined ? '' : words[i + x].slice(1)}RPM` +
423422
' CCW',
424423
TreeItemCollapsibleState.None,
425424
);
426425
node.tooltip = `Spindle On Counter Clockwise (${
427-
words[i + x].substr(1) === undefined ? '' : words[i + x].substr(1)
426+
words[i + x].slice(1) === undefined ? '' : words[i + x].slice(1)
428427
}RPM)`;
429428
node.setIcon(IconType.SpindleCCW);
430429
node.command = {

0 commit comments

Comments
 (0)