mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-30 14:38:10 +09:00
14 lines
331 B
TypeScript
14 lines
331 B
TypeScript
import db from '../../db/mongodb';
|
|
|
|
export default db.get('drive_files') as any; // fuck type definition
|
|
|
|
export function validateFileName(name: string): boolean {
|
|
return (
|
|
(name.trim().length > 0) &&
|
|
(name.length <= 200) &&
|
|
(name.indexOf('\\') === -1) &&
|
|
(name.indexOf('/') === -1) &&
|
|
(name.indexOf('..') === -1)
|
|
);
|
|
}
|