<commit_before>import {AlbumFile} from '../db/db';
import {IAlbumFile} from '../db/interfaces';

export default function(
	meId: string,
	fileId: string
): Promise<IAlbumFile> {
	return new Promise<IAlbumFile>((resolve, reject) => {
		AlbumFile.findById(fileId, (findErr: any, file: IAlbumFile) => {
			if (findErr !== null) {
				reject(findErr);
			} else if (file === null) {
				reject('file-not-found');
			} else if (file.user.toString() !== meId.toString()) {
				reject('file-not-found');
			} else {
				resolve(file);
			}
		});
	});
}<commit_msg>Refactyronid<commit_after>import {AlbumFile} from '../db/db';
import {IAlbumFile} from '../db/interfaces';

export default (
	meId: string,
	fileId: string
) => new Promise<IAlbumFile>((resolve, reject) =>
{
	AlbumFile.findById(fileId, (err: any, file: IAlbumFile) => {
		if (err) {
			reject(err);
		} else if (file === null) {
			reject('file-not-found');
		} else if (file.user.toString() !== meId.toString()) {
			reject('file-not-found');
		} else {
			resolve(file);
		}
	});
});
{'fraction_non_alphanumeric': 0.19961612284069097, 'fraction_numerical': 0.0, 'mean_word_length': 3.8511627906976744, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5494820', 'n_tokens_mistral': 420, 'n_tokens_neox': 370, 'n_words': 78}