Initial commit 🍀
This commit is contained in:
10
src/api/models/user.ts
Normal file
10
src/api/models/user.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
const collection = global.db.collection('users');
|
||||
|
||||
collection.createIndex('username');
|
||||
collection.createIndex('token');
|
||||
|
||||
export default collection;
|
||||
|
||||
export function validateUsername(username: string): boolean {
|
||||
return /^[a-zA-Z0-9\-]{3,20}$/.test(username);
|
||||
}
|
Reference in New Issue
Block a user