<commit_before><commit_msg>Initial commit<commit_after>/// <reference path="../../../typings/bundle.d.ts" />

import async = require('async');
import Post = require('../../models/post');
import User = require('../../models/user');
import conf = require('../../config');

export = render;

var render = (req: any, res: any): void => {
	async.series([
		(callback: any) => {
			User.find(req.rootPost.userId, (user: User) => {
				callback(null, user);
			});
		},
		(callback: any) => {
			Post.getBeforeTalk(req.rootPost.id, (posts: Post[]) => {
				async.map(posts, (post: any, next: any) => {
					User.find(post.userId, (user: User) => {
						post.user = user;
						next(null, user);
					});
				}, (err: any, results: any[]) => {
					callback(null, results);
				});
			});
		}
	], (err: any, results: any) => {
		res.display(req, res, 'post', {
			post: req.rootPost,
			postUser: results[0],
			beforeTalks: results[1]
		});
	});
};
{'fraction_non_alphanumeric': 0.2346072186836518, 'fraction_numerical': 0.0021231422505307855, 'mean_word_length': 2.96218487394958, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 13, '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': '1333299', 'n_tokens_mistral': 382, 'n_tokens_neox': 326, 'n_words': 69}