yumechi-no-kuni/src/api/models/drive-file.ts
syuilo 19e12bf5cf ✌️
2017-01-17 10:39:21 +09:00

13 lines
300 B
TypeScript

import db from '../../db/mongodb';
export default db.get('drive_files');
export function validateFileName(name: string): boolean {
return (
(name.trim().length > 0) &&
(name.length <= 200) &&
(name.indexOf('\\') === -1) &&
(name.indexOf('/') === -1) &&
(name.indexOf('..') === -1)
);
}