Problem
In docs/api.md under the tmpfile() section (line 331), the inline comment shows an output filename that doesn't match the input argument:
f1 = tmpfile() // /os/based/tmp/zx-1ra1iofojgg
f2 = tmpfile('f2.txt') // /os/based/tmp/zx-1ra1iofojgg/foo.txt
f3 = tmpfile('f3.txt', 'string or buffer')
f4 = tmpfile('f4.sh', 'echo "foo"', 0o744) // executable
The argument passed is 'f2.txt', but the comment shows the resulting path ending in foo.txt. Looking at the implementation in src/goods.ts, tempfile(name) returns path.join(tempdir(), name), so the result for tmpfile('f2.txt') would end in f2.txt, not foo.txt.
Expected
The comment should reflect the actual returned path based on the argument.
Suggested fix
- f2 = tmpfile('f2.txt') // /os/based/tmp/zx-1ra1iofojgg/foo.txt
+ f2 = tmpfile('f2.txt') // /os/based/tmp/zx-1ra1iofojgg/f2.txt
Problem
In
docs/api.mdunder thetmpfile()section (line 331), the inline comment shows an output filename that doesn't match the input argument:The argument passed is
'f2.txt', but the comment shows the resulting path ending infoo.txt. Looking at the implementation insrc/goods.ts,tempfile(name)returnspath.join(tempdir(), name), so the result fortmpfile('f2.txt')would end inf2.txt, notfoo.txt.Expected
The comment should reflect the actual returned path based on the argument.
Suggested fix