Refactor CLI and add tests

This commit is contained in:
Typicode
2015-07-15 18:44:33 +02:00
parent e3a7db949b
commit ccf67724e3
22 changed files with 368 additions and 172 deletions

17
src/cli/utils/is.js Normal file
View File

@ -0,0 +1,17 @@
module.exports = {
JSON: isJSON,
JS: isJS,
URL: isURL
}
function isJSON (s) {
return /\.json$/.test(s)
}
function isJS (s) {
return /\.js$/.test(s)
}
function isURL (s) {
return /^(http|https):/.test(s)
}