-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
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
fs.walk #192
fs.walk #192
Conversation
fs/walk.ts
Outdated
} | ||
|
||
|
||
export function *walk(dir: string, options: WalkOptions = {}): IterableIterator<FileInfo> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jsdoc with example please
fs/walk_test.ts
Outdated
await mkdir(d + "/dir_empty"); | ||
}, | ||
function emptyDir() { | ||
const arr = Array.from(walk("."), (f: FileInfo) => f.path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beautiful!
remove(d, {recursive: true}); | ||
} | ||
} | ||
test({ name, fn }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this pattern of wrapping the test function for setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bert suggested this in discussion of setup/teardown for testFileserver - I should push a branch with that change too...
Is symlink not supported in windows? |
@ry does this suffice for jsdoc? This supports lots of options now, and has both async and sync versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hayd Yes, thanks. LGTM
#189