We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would be nice to be able to delete a directory and recreate it without losing the reference to the directory.
Pain Point
const myDir = project.getDirectoryOrThrow("my-dir"); myDir.delete(); myDir.createSourceFile(...); // error since myDir was forgotten :(
Solution?
Something like delete(), but it won't forget the directory reference and will queue a mkdir immediately after.
delete()
const myDir = project.getDirectoryOrThrow("my-dir"); myDir.recreate(); myDir.createSourceFile(...); // ok
Probably would have a name like recreate() or deleteDescendants().
recreate()
deleteDescendants()
Edit: I went with .clear().
.clear()
The text was updated successfully, but these errors were encountered:
feat: #763 - Add Directory#clear().
df93db3
No branches or pull requests
Would be nice to be able to delete a directory and recreate it without losing the reference to the directory.
Pain Point
Solution?
Something like
delete()
, but it won't forget the directory reference and will queue a mkdir immediately after.Probably would have a name like
recreate()
ordeleteDescendants()
.Edit: I went with
.clear()
.The text was updated successfully, but these errors were encountered: