<commit_before>import {Injectable} from '@angular/core';
import {SelectItem} from '../common/selectitem';

@Injectable()
export class ObjectUtils {

    public equals(obj1: any, obj2: any, field?: string): boolean {
        if (field)
            return (this.resolveFieldData(obj1, field) === this.resolveFieldData(obj2, field));
        else
            return this.equalsByValue(obj1, obj2);
    }

    public equalsByValue(obj1: any, obj2: any, visited?: any[]): boolean {
        if (obj1 == null && obj2 == null) {
            return true;
        }
        if (obj1 == null || obj2 == null) {
            return false;
        }

        if (obj1 == obj2) {
            return true;
        }

        if (typeof obj1 == 'object' && typeof obj2 == 'object') {
            if (visited) {
                if (visited.includes(obj1)) return false;
            } else {
                visited = [];
            }
            visited.push(obj1);

            for (var p in obj1) {
                if (obj1.hasOwnProperty(p) !== obj2.hasOwnProperty(p)) {
                    return false;
                }

                switch (typeof (obj1[p])) {
                    case 'object':
                        if (!this.equalsByValue(obj1[p], obj2[p], visited)) return false;
                        break;

                    case 'function':
                        if (typeof (obj2[p]) == 'undefined' || (p != 'compare' && obj1[p].toString() != obj2[p].toString())) return false;<commit_msg>AOT fix<commit_after>import {Injectable} from '@angular/core';
import {SelectItem} from '../common/selectitem';

@Injectable()
export class ObjectUtils {

    public equals(obj1: any, obj2: any, field?: string): boolean {
        if (field)
            return (this.resolveFieldData(obj1, field) === this.resolveFieldData(obj2, field));
        else
            return this.equalsByValue(obj1, obj2);
    }

    public equalsByValue(obj1: any, obj2: any, visited?: any[]): boolean {
        if (obj1 == null && obj2 == null) {
            return true;
        }
        if (obj1 == null || obj2 == null) {
            return false;
        }

        if (obj1 == obj2) {
            return true;
        }

        if (typeof obj1 == 'object' && typeof obj2 == 'object') {
            if (visited) {
                if (visited.indexOf(obj1) !== -1) return false;
            } else {
                visited = [];
            }
            visited.push(obj1);

            for (var p in obj1) {
                if (obj1.hasOwnProperty(p) !== obj2.hasOwnProperty(p)) {
                    return false;
                }

                switch (typeof (obj1[p])) {
                    case 'object':
                        if (!this.equalsByValue(obj1[p], obj2[p], visited)) return false;
                        break;

                    case 'function':
                        if (typeof (obj2[p]) == 'undefined' || (p != 'compare' && obj1[p].toString() != obj2[p].toString())) return false;
{'fraction_non_alphanumeric': 0.13885180240320427, 'fraction_numerical': 0.018357810413885182, 'mean_word_length': 1.5549872122762147, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6188018', 'n_tokens_mistral': 859, 'n_tokens_neox': 833, 'n_words': 217}