iceshrimp/src/api/models/drive-file.ts
2017-01-18 16:30:47 +09:00

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)
);
}