<commit_before>var keystone		= require('keystone'),
	async			= require('async'),
	SuccessStory	= keystone.list('Success Story');

	exports.getRandomStory = function getRandomStory(req, res, done) {

		let locals = res.locals;

		// TODO: Handle the error if we get one
		SuccessStory.model.findRandom(function(err, successStory){
			locals.randomSuccessStory = successStory;
			// execute done function if async is used to continue the flow of execution
			done();
		});

	};<commit_msg>#208 | ES6ify the success story middleware<commit_after>const keystone		= require( 'keystone' );
const async			= require( 'async' );
const SuccessStory	= keystone.list( 'Success Story' );

exports.getRandomStory = ( req, res, done ) => {

	let locals = res.locals;

	// TODO: Handle the error if we get one
	SuccessStory.model.findRandom( ( err, successStory ) => {
		locals.randomSuccessStory = successStory;
		// execute done function if async is used to continue the flow of execution
		done();
	});

};
{'fraction_non_alphanumeric': 0.11681772406847936, 'fraction_numerical': 0.004028197381671702, 'mean_word_length': 4.204188481675392, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5000663', 'n_tokens_mistral': 337, 'n_tokens_neox': 294, 'n_words': 94}