Last active
July 7, 2016 00:39
-
-
Save tcdw/e59d68f1b8ef7e709766141d447f4cf6 to your computer and use it in GitHub Desktop.
Illegal Alphabet Checker
This file contains hidden or 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
| #!/usr/bin/env node | |
| var content = process.argv[process.argv.length - 1]; | |
| if (content == process.title) { | |
| console.log("Usage: " + process.title + " <content>"); | |
| process.exit(); | |
| } else { | |
| var illegalAlphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); | |
| illegalAlphabet.forEach(function(alphabet) { | |
| if (content.indexOf(alphabet) != -1) { | |
| console.error("Error! Found illegal alphabet " + alphabet); | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment