<commit_before>import ArrayExpectation from './expectations/array-expectation';
import BooleanExpectation from './expectations/boolean-expectation';
import FunctionExpectation from './expectations/function-expectation';
import NumberExpectation from './expectations/number-expectation';
import ObjectExpectation from './expectations/object-expectation';
import StringExpectation from './expectations/string-expectation';

type IExpectParameterTypes = Array<any> | boolean | Function | number | string | Object;
type IExpectationReturnTypes = ArrayExpectation | BooleanExpectation | FunctionExpectation | NumberExpectation | StringExpectation | ObjectExpectation;

function expect(sut: Array<any>): ArrayExpectation;
function expect(sut: boolean): BooleanExpectation;
function expect(sut: Function): FunctionExpectation;
function expect(sut: number): NumberExpectation;
function expect(sut: string): StringExpectation;
function expect(sut: Object): ObjectExpectation;

function expect(sut: IExpectParameterTypes): IExpectationReturnTypes {
	// Check for Array
	if (sut instanceof Array) {
		return new ArrayExpectation(sut);
	}

	// Check for Boolean
	if (typeof sut === 'boolean') {
		return new BooleanExpectation(sut);
	}

	// Check for Function
	if (typeof sut === 'function') {
		return new FunctionExpectation(sut as Function);
	}

	// Check for Number
	if (typeof sut === 'number') {
		return new NumberExpectation(sut);
	}

	// Check for String
	if (typeof sut === 'string') {
		return new StringExpectation(sut);
	}

	// Finally, if none of the above match use the generic ObjectExpectation
	return new ObjectExpectation(undefined);
};

export default expect;<commit_msg>Expectation should be called with the correct parameters<commit_after>import ArrayExpectation from './expectations/array-expectation';
import BooleanExpectation from './expectations/boolean-expectation';
import FunctionExpectation from './expectations/function-expectation';
import NumberExpectation from './expectations/number-expectation';
import ObjectExpectation from './expectations/object-expectation';
import StringExpectation from './expectations/string-expectation';

type IExpectParameterTypes = Array<any> | boolean | Function | number | string | Object;
type IExpectationReturnTypes = ArrayExpectation | BooleanExpectation | FunctionExpectation | NumberExpectation | StringExpectation | ObjectExpectation;

function expect(sut: Array<any>): ArrayExpectation;
function expect(sut: boolean): BooleanExpectation;
function expect(sut: Function): FunctionExpectation;
function expect(sut: number): NumberExpectation;
function expect(sut: string): StringExpectation;
function expect(sut: Object): ObjectExpectation;

function expect(sut: IExpectParameterTypes): IExpectationReturnTypes {
	// Check for Array
	if (sut instanceof Array) {
		return new ArrayExpectation(sut);
	}

	// Check for Boolean
	if (typeof sut === 'boolean') {
		return new BooleanExpectation(sut);
	}

	// Check for Function
	if (typeof sut === 'function') {
		return new FunctionExpectation(sut as Function);
	}

	// Check for Number
	if (typeof sut === 'number') {
		return new NumberExpectation(sut);
	}

	// Check for String
	if (typeof sut === 'string') {
		return new StringExpectation(sut);
	}

	// Finally, if none of the above match use the generic ObjectExpectation
	return new ObjectExpectation(sut);
};

export default expect;
{'fraction_non_alphanumeric': 0.10132547864506627, 'fraction_numerical': 0.0, 'mean_word_length': 5.902439024390244, 'pattern_counts': {'":': 0, '<': 7, '<?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': '172260', 'n_tokens_mistral': 926, 'n_tokens_neox': 896, 'n_words': 280}