Last active
November 9, 2018 15:55
-
-
Save maciejcieslar/f3217ddc9dd86d6ec5dc770fec450579 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fromEvent(chokidar.watch(process.cwd()), 'all').pipe( | |
// ... | |
map(([event, filePath]: string[]) => { | |
const filename = path.basename(filePath) | |
const extension = path.extname(filename) | |
return { | |
event, | |
filename, | |
extension, | |
filePath: filePath.slice(process.cwd().length + 1), | |
} | |
}), | |
// ... | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment