Closed gutte closed 5 years ago
@gutte nice find. the same is true for the async file method. perhaps you want to fix it there, too?
@gutte some tests against this issue would be nice, too.
Looking at _generateTmpName(opts), this seems to be the original and desired behaviour, if the user decides to pass in an empty postfix, then the file shall have no '.tmp' extension, see at the very end of the _generateTmpName(opts) function, where the name is assembled from an array.
Okay, here was inverse logic in place. The issue correctly describes the wrong behaviour.
Good find, but we'll need to add tests for this.
Hey, yes sorry for the short pull request description. The issue description is clearer.
The behavior for fallback to the default postfix (.tmp) should now be the same for sync and async functions.
I am currently doing the tests for this, both for async/sync file and also for async/sync tmpName.
{postfix :""}
gives filename without file extension.