github-actions
released this
16 Nov 10:26
·
34 commits
to main
since this release
Minor Changes
-
9d67bdf: Add
getFiles
andgetDirectories
toDirectory
. -
1bd1de3: Adds
hasExtension
method toFile
to help constrain the type:import { Directory } from 'renoun/file-system' const posts = new Directory<{ mdx: { frontmatter: { title: string } } }>({ path: 'posts', }) const mdxFiles = await posts .getFiles() .filter((post) => post.hasExtension('mdx'))
-
4d263fe: Add
includeIndexAndReadme
option togetEntries
for controlling default filtering ofindex
andreadme
files. -
e09a837: Adds
isFileWithExtension
utility:const fileSystem = new VirtualFileSystem({ 'Button.tsx': '', }) const directory = new Directory<{ tsx: { metadata: {} } }>({ fileSystem, }) const file = await directory.getFileOrThrow('Button') if (isFileWithExtension(file, 'tsx')) { // file is typed as File<{ tsx: { metadata: {} } }> }
-
a36058f: Add
getEditPath
method toJavaScriptFileExport
.