blob: 95c88107db5e7f8011b5f778bb7512c58841843a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
function sanitizeRepoName(dirty)
{
const valid_repo_name = /^[a-zA-Z0-9\.\-_]+$/;
return valid_repo_name.test(dirty);
}
function sanitizeCommitID(dirty)
{
const valid_commit_id = /^[a-fA-F0-9]{40}$/;
return valid_commit_id.test(dirty);
}
module.exports.sanitizeRepoName = sanitizeRepoName;
module.exports.sanitizeCommitID = sanitizeCommitID;
|