Closed
Description
What is the problem this feature will solve?
Some (user-land) APIs return a file extension without the dot.
What is the feature you are proposing to solve the problem?
It would be nice if path.format()
would handle file extension without the leading dot.
Current behavior:
path.format({name: 'x', ext: 'png'});
//=> 'xpng'
Wanted behavior:
path.format({name: 'x', ext: 'png'});
//=> 'x.png'
The current behavior makes no sense and should at minimum have caused an error.
So what I'm requested is that if the ext
is missing a leading dot, it would be added.
What alternatives have you considered?
No response