Skip to content

Instantly share code, notes, and snippets.

@maciejcieslar
Created November 7, 2018 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maciejcieslar/47a55a54f876621ec46368a161cfddf6 to your computer and use it in GitHub Desktop.
Save maciejcieslar/47a55a54f876621ec46368a161cfddf6 to your computer and use it in GitHub Desktop.
const parseArguments = (execution: program.Command) => {
const { ext = [], watch = [], ignore = [], delay = 0, exe } = execution
if (!exe) {
throw new Error('No script provided')
}
return {
delay,
extensions: ext.map((e) => `.${e}`),
watchedDirectories: watch,
ignoredDirectories: [...ignore, 'node_modules', 'build'],
shouldWatchEveryDirectory: not(watch.length),
shouldWatchEveryExtension: not(ext.length),
script: exe,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment