<commit_before>import {inject} from 'aurelia-framework';
import {I18N} from 'aurelia-i18n';
import {EventAggregator} from 'aurelia-event-aggregator';
import {parseJSON} from './resources/jsonparser';
import {Field} from './resources/elements/abstract/field';
import {schema, fieldsToShow} from './schemas/index';
import {Validation} from './validation';
import YAML from 'yamljs';
import $ from 'jquery';

@inject(I18N, EventAggregator)
export class App {
  constructor(i18n, ea) {
    Field.internationalizer = i18n;
    Field.eventAggregator = ea;
    Field.validationFunctions = new Validation(i18n);
    // Allow access from browser console
    window.Field = Field;
    window.$oai = this;

    try {
      const pointerlessSchema = $.extend(true, {}, schema);
      this.forms = parseJSON('form', pointerlessSchema);
      if (window.localStorage['openapi-v2-design']) {
        const savedData = JSON.parse(window.localStorage['openapi-v2-design']);
        this.forms.setValue(savedData);
      }
    } catch (exception) {
      console.log(exception);
      this.exception = exception;<commit_msg>Remove Field from window<commit_after>import {inject} from 'aurelia-framework';
import {I18N} from 'aurelia-i18n';
import {EventAggregator} from 'aurelia-event-aggregator';
import {parseJSON} from './resources/jsonparser';
import {Field} from './resources/elements/abstract/field';
import {schema, fieldsToShow} from './schemas/index';
import {Validation} from './validation';
import YAML from 'yamljs';
import $ from 'jquery';

@inject(I18N, EventAggregator)
export class App {
  constructor(i18n, ea) {
    Field.internationalizer = i18n;
    Field.eventAggregator = ea;
    Field.validationFunctions = new Validation(i18n);
    // Allow access from browser console
    window.$oai = this;

    try {
      const pointerlessSchema = $.extend(true, {}, schema);
      this.forms = parseJSON('form', pointerlessSchema);
      if (window.localStorage['openapi-v2-design']) {
        const savedData = JSON.parse(window.localStorage['openapi-v2-design']);
        this.forms.setValue(savedData);
      }
    } catch (exception) {
      console.log(exception);
      this.exception = exception;
{'fraction_non_alphanumeric': 0.135184342284934, 'fraction_numerical': 0.012744651797906235, 'mean_word_length': 4.018264840182648, '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': '2295054', 'n_tokens_mistral': 674, 'n_tokens_neox': 656, 'n_words': 156}