<commit_before>// Used by promise extensions that are based on array extensions.

'use strict';

var callable = require('es5-ext/lib/Object/valid-callable')
  , silent   = require('es5-ext/lib/Function/prototype/silent')
  , extend   = require('../../extend');

module.exports = function (name, ext) {
	extend(name, [function (cb) {
		(cb == null) || callable(cb);
	}], function (args, resolve) {
		var cb, cbs;
		if (this.failed) {
			return resolve(this.promise);
		} else {
			return resolve(silent.call(ext).call(this.value,
				args[0], args[1], args[2]));
		}
	});
};<commit_msg>Directly gather result.<commit_after>// Used by promise extensions that are based on array extensions.

'use strict';

var callable = require('es5-ext/lib/Object/valid-callable')
  , extend   = require('../../extend');

module.exports = function (name, ext) {
	extend(name, [function (cb) {
		(cb == null) || callable(cb);
	}], function (args, resolve) {
		var result;
		if (this.failed) {
			return resolve(this.promise);
		} else {
			try {
				result = ext.call(this.value, args[0], args[1], args[2]);
			} catch (e) {
				return resolve(e);
			}
			return resolve(result);
		}
	});
};
{'fraction_non_alphanumeric': 0.1815856777493606, 'fraction_numerical': 0.0076726342710997444, 'mean_word_length': 3.550387596899225, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4593631', 'n_tokens_mistral': 437, 'n_tokens_neox': 403, 'n_words': 98}