Skip to content

Prefix and postfix - redundant dashes #256

@justanotheranonymoususer

Description

Tmp Version

0.2.1

Expected Behavior

When I use the following example code from the readme:

tmp.file({ mode: 0o644, prefix: 'prefix-', postfix: '.txt' }, /*...*/);

I expect to get a filename like this:
prefix-blabla-blabla.txt
That was the behavior in old versions.

Experienced Behavior

I get a filename like this:
prefix--blabla-blabla-.txt

While the first redundant dash can be fixed by removing - from prefix, the dash before the extension stays there.
i.e. If I have postfix: '.txt', I get [...]bla[...]-.tmp.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions