<commit_before>module.exports = function(mongoose) {
	'use strict';

	mongoose.Query.prototype.order = function (options) {
		if (!options || !options.sort) {
			return this;
		}

		/*
		
		options: 
			string (ex '-storeNumber, storeName')
			array (ex ['-storeNumber'])
			object (ex { 'storeNumber' : -1, 'storeName' : 1 })

		*/

		var
			fields = [],
			self = this,
			sort = options.sort || {},
			value = null;

		if (typeof sort === 'string') {
			fields = sort.split(',');
			for (var index = 0; index < fields.length; index++) {
				fields[index] = fields[index].trim();
			}
		} else if (Array.isArray(sort) && sort.length) {
			fields = sort;
		} else if (typeof sort === 'object') {
			for (var property in sort) {<commit_msg>Removing notes<commit_after>module.exports = function(mongoose) {
	'use strict';

	mongoose.Query.prototype.order = function (options) {
		if (!options || !options.sort) {
			return this;
		}

		var
			fields = [],
			self = this,
			sort = options.sort || {},
			value = null;

		if (typeof sort === 'string') {
			fields = sort.split(',');
			for (var index = 0; index < fields.length; index++) {
				fields[index] = fields[index].trim();
			}
		} else if (Array.isArray(sort) && sort.length) {
			fields = sort;
		} else if (typeof sort === 'object') {
			for (var property in sort) {
{'fraction_non_alphanumeric': 0.17784476262245666, 'fraction_numerical': 0.003014318010550113, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4770715', 'n_tokens_mistral': 520, 'n_tokens_neox': 444, 'n_words': 117}