mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 16:49:06 +01:00
auto-fixed prefer-const violation
This commit is contained in:
@@ -21,7 +21,7 @@ export function incrementDecrement(delta: number): Thenable<boolean> | undefined
|
||||
|
||||
return editor.edit(editBuilder => {
|
||||
editor.selections.forEach(selection => {
|
||||
let rangeToReplace = locate(editor.document, selection.isReversed ? selection.anchor : selection.active);
|
||||
const rangeToReplace = locate(editor.document, selection.isReversed ? selection.anchor : selection.active);
|
||||
if (!rangeToReplace) {
|
||||
return;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export function incrementDecrement(delta: number): Thenable<boolean> | undefined
|
||||
*/
|
||||
export function update(numString: string, delta: number): string {
|
||||
let m: RegExpMatchArray | null;
|
||||
let decimals = (m = numString.match(/\.(\d+)$/)) ? m[1].length : 1;
|
||||
const decimals = (m = numString.match(/\.(\d+)$/)) ? m[1].length : 1;
|
||||
let output = String((parseFloat(numString) + delta).toFixed(decimals)).replace(/\.0+$/, '');
|
||||
|
||||
if (m = numString.match(/^\-?(0\d+)/)) {
|
||||
|
||||
Reference in New Issue
Block a user