<commit_before>/**
 * returns a function which can trap `target` function calls
 * @param {Function} target
 * @param {onApply} onApply
 */
export const intercept = ( target, onApply ) => {
	const fn = function ( ...args ) {
		return onApply( target, this, args );
	};

	fn.prototype = target.prototype;

	return fn;
}

/**
 * call `target` function as it should have
 * @type {onApply}
 */
export const invoke = ( target, thisArg, args ) => {
	return target.apply( thisArg, args )
}

/**
 * @callback onApply
 * @param {Function} target - The function should have invoked
 * @param {any} thisArg - The object used as `this` to the target
 * @param {any[]} args - A list of arguments passed to the target.
 * @returns {any}
 */<commit_msg>docs(intercept.js): correct type for `thisArg`<commit_after>/**
 * returns a function which can trap `target` function calls
 * @param {Function} target
 * @param {onApply} onApply
 */
export const intercept = ( target, onApply ) => {
	const fn = function ( ...args ) {
		return onApply( target, this, args );
	};

	fn.prototype = target.prototype;

	return fn;
}

/**
 * call `target` function as it should have
 * @type {onApply}
 */
export const invoke = ( target, thisArg, args ) => {
	return target.apply( thisArg, args )
}

/**
 * @callback onApply
 * @param {Function} target - The function should have invoked
 * @param {object | undefined} thisArg - The object used as `this` to the target
 * @param {any[]} args - A list of arguments passed to the target.
 * @returns {any}
 */
{'fraction_non_alphanumeric': 0.1382699868938401, 'fraction_numerical': 0.0, 'mean_word_length': 3.544642857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4693266', 'n_tokens_mistral': 468, 'n_tokens_neox': 459, 'n_words': 179}