<commit_before>﻿/// <reference path="navigation.d.ts" />
/// <reference path="knockout.d.ts" />
import Navigation = require('navigation');
import ko = require('knockout');

class LinkUtility {
    static setLink(stateNavigator: Navigation.StateNavigator, element: HTMLAnchorElement, linkAccessor: () => string) {
        try {
            element.href = stateNavigator.historyManager.getHref(linkAccessor());
        } catch (e) {
            element.removeAttribute('href');
        }
    }

    static getData(stateNavigator: Navigation.StateNavigator, navigationData, includeCurrentData, currentDataKeys) {
        if (currentDataKeys)
            navigationData = stateNavigator.stateContext.includeCurrentData(navigationData, currentDataKeys.trim().split(/\s*,\s*/));
        if (includeCurrentData)
            navigationData = stateNavigator.stateContext.includeCurrentData(navigationData);
        return navigationData;
    }

    static setActive(element: HTMLAnchorElement, stateNavigator: Navigation.StateNavigator, navigationData: any, activeCssClass, disableActive) {
        if (!activeCssClass && !disableActive)
            return;
        var active = !!element.href;
        for (var key in navigationData) {
            var val = navigationData[key];
            active = active && (val == null || this.areEqual(val, stateNavigator.stateContext.data[key]));
        }<commit_msg>Made parameter consistent with getData function<commit_after>﻿/// <reference path="navigation.d.ts" />
/// <reference path="knockout.d.ts" />
import Navigation = require('navigation');
import ko = require('knockout');

class LinkUtility {
    static setLink(stateNavigator: Navigation.StateNavigator, element: HTMLAnchorElement, linkAccessor: () => string) {
        try {
            element.href = stateNavigator.historyManager.getHref(linkAccessor());
        } catch (e) {
            element.removeAttribute('href');
        }
    }

    static getData(stateNavigator: Navigation.StateNavigator, navigationData, includeCurrentData, currentDataKeys) {
        if (currentDataKeys)
            navigationData = stateNavigator.stateContext.includeCurrentData(navigationData, currentDataKeys.trim().split(/\s*,\s*/));
        if (includeCurrentData)
            navigationData = stateNavigator.stateContext.includeCurrentData(navigationData);
        return navigationData;
    }

    static setActive(element: HTMLAnchorElement, stateNavigator: Navigation.StateNavigator, navigationData, activeCssClass, disableActive) {
        if (!activeCssClass && !disableActive)
            return;
        var active = !!element.href;
        for (var key in navigationData) {
            var val = navigationData[key];
            active = active && (val == null || this.areEqual(val, stateNavigator.stateContext.data[key]));
        }
{'fraction_non_alphanumeric': 0.11496285815351963, 'fraction_numerical': 0.0, 'mean_word_length': 3.3709428129829986, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '914186', 'n_tokens_mistral': 736, 'n_tokens_neox': 719, 'n_words': 150}