diff options
Diffstat (limited to 'api/sanitization.js')
-rw-r--r-- | api/sanitization.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/api/sanitization.js b/api/sanitization.js new file mode 100644 index 0000000..5c9d009 --- /dev/null +++ b/api/sanitization.js @@ -0,0 +1,10 @@ +function sanitizeRepoName(dirty) +{ + const valid_repo_name = /^[a-zA-Z0-9\.\-_]+$/; + if(valid_repo_name.test(dirty)) { + return true; + } + return false; +} + +module.exports.sanitizeRepoName = sanitizeRepoName;
\ No newline at end of file |