<commit_before>import {h} from 'dom-chef';
import select from 'select-dom';
import {getCleanPathname, isEnterprise} from '../libs/page-detect';
import api from '../libs/api';

export default async () => {
	const container = select('body.page-profile .UnderlineNav-body');

	if (select.exists('.rgh-user-gist') || !container) {
		return;
	}

	const username = getCleanPathname();
	const href = isEnterprise() ? `/gist/${username}` : `https://gist.github.com/${username}`;
	const link = <a href={href} class="UnderlineNav-item rgh-user-gist" role="tab">Gists </a>;
	container.append(link);

	const userData = await api(`users/${username}`);

	link.appendChild(<span class="Counter">{userData.public_gists}</span>);
};<commit_msg>Add missing attribute to Gists tab (#952)<commit_after>import {h} from 'dom-chef';
import select from 'select-dom';
import {getCleanPathname, isEnterprise} from '../libs/page-detect';
import api from '../libs/api';

export default async () => {
	const container = select('body.page-profile .UnderlineNav-body');

	if (select.exists('.rgh-user-gist') || !container) {
		return;
	}

	const username = getCleanPathname();
	const href = isEnterprise() ? `/gist/${username}` : `https://gist.github.com/${username}`;
	const link = <a href={href} class="UnderlineNav-item rgh-user-gist" role="tab" aria-selected="false">Gists </a>;
	container.append(link);

	const userData = await api(`users/${username}`);

	link.appendChild(<span class="Counter">{userData.public_gists}</span>);
};
{'fraction_non_alphanumeric': 0.1908244680851064, 'fraction_numerical': 0.0019946808510638296, 'mean_word_length': 5.297071129707113, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '6021060', 'n_tokens_mistral': 505, 'n_tokens_neox': 496, 'n_words': 109}