Simplify incrementFileName#75398
Conversation
| }); | ||
| // name copy 5(.txt) => name copy 6(.txt) | ||
| // name copy(.txt) => name copy 2(.txt) | ||
| let suffixRegex = /^(.+ copy)( \d+)?$/; |
There was a problem hiding this comment.
We prefer to use const over let when possible
| }); | ||
| let namePrefix = name; | ||
| let extSuffix = ''; | ||
| if (!isFolder) { |
There was a problem hiding this comment.
Would it help to use the paths.extname helper to simplify things here?
|
This is some great work. I love it, especailly the tests! If you want you can address my two minor comments. I would merge this either way. Thanks a lot! |
|
@isidorn updated the PR, now I'm using |
|
Great work, merging in. |
Fixes #55128