<commit_before>import {app} from './app';

export function dashCase(str) {
	return str.replace(/([A-Z])/g, function ($1) {
		return "-" + $1.toLowerCase();
	});
}

export function funcName(func) {
	return funcMeta(func).name;
}

export function superClass(func) {
	return funcMeta(func).superClass;
}

/**
@function Metadata
@param {Function} func
@returns {Object} The function metadata.
*/
export function funcMeta(func) {
	if (!func) {
		return null;
	}

	if (func.$meta !== undefined) {
		if (testEqualConstructor(func.$meta.top)) {
			return func.$meta;
		}
		if (testEqualConstructor(func.$meta.base)) {
			return func.$meta;
		}
		if (func.$meta.wrappers.findIndex(testEqualConstructor) >= 0) {
			return func.$meta;
		}
	}

	let meta = {
		controller: null,
		service:    null,
		state:      null,
		wrappers:   null,
		base:       func,
		top:        func,
		name:       getName(),
		superClass: getSuperClass(),<commit_msg>fixed: func.$meta.wrappers defaults to empty array instead of undefined<commit_after>import {app} from './app';

export function dashCase(str) {
	return str.replace(/([A-Z])/g, function ($1) {
		return "-" + $1.toLowerCase();
	});
}

export function funcName(func) {
	return funcMeta(func).name;
}

export function superClass(func) {
	return funcMeta(func).superClass;
}

/**
@function Metadata
@param {Function} func
@returns {Object} The function metadata.
*/
export function funcMeta(func) {
	if (!func) {
		return null;
	}

	if (func.$meta !== undefined) {
		if (testEqualConstructor(func.$meta.top)) {
			return func.$meta;
		}
		if (testEqualConstructor(func.$meta.base)) {
			return func.$meta;
		}
		if (func.$meta.wrappers.findIndex(testEqualConstructor) >= 0) {
			return func.$meta;
		}
	}

	let meta = {
		controller: null,
		service:    null,
		state:      null,
		wrappers:   [],
		base:       func,
		top:        func,
		name:       getName(),
		superClass: getSuperClass(),
{'fraction_non_alphanumeric': 0.1571279916753382, 'fraction_numerical': 0.003121748178980229, 'mean_word_length': 3.4825174825174825, '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': '5470482', 'n_tokens_mistral': 702, 'n_tokens_neox': 661, 'n_words': 154}