Skip to content

Commit b5a741b

Browse files
committed
Add JSDoc to withTmpFile
1 parent 15b91db commit b5a741b

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎src/util.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,15 @@ export async function withTmpDir<T>(
8989
return result;
9090
}
9191

92-
// Creates a random temporary file, runs the given body, and then deletes the file.
92+
/**
93+
* Creates a temporary file with the given contents, runs the given body, and
94+
* then deletes the file. Note that, to create a temporary file, we first create
95+
* a temporary directory via {@link withTmpDir} and then create the file within
96+
* that directory.
97+
* @param baseFileName The name to assign the temporary file.
98+
* @param contents The contents to write to the temporary file.
99+
* @param body The anonymous function to execute with the temporary file.
100+
*/
93101
export async function withTmpFile<T>(
94102
baseFileName: string,
95103
contents: string,

0 commit comments

Comments
 (0)