mirror of
https://github.com/Ravinou/borgwarehouse
synced 2026-03-14 22:35:46 +01:00
9 lines
302 B
TypeScript
9 lines
302 B
TypeScript
// BorgWarehouse repository name is an 8-character hexadecimal string
|
|
|
|
export default function repositoryNameCheck(name: unknown): boolean {
|
|
if (typeof name !== 'string') {
|
|
return false;
|
|
}
|
|
const repositoryNameRegex = /^[a-f0-9]{8}$/;
|
|
return repositoryNameRegex.test(name) ? true : false;
|
|
}
|