{"size": 556, "ext": "js", "max_stars_repo_path": "app/assets/javascripts/terms/index.js", "max_stars_repo_name": "visnix/gitlab-foss", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/assets/javascripts/terms/index.js", "max_issues_repo_name": "visnix/gitlab-foss", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/assets/javascripts/terms/index.js", "max_forks_repo_name": "visnix/gitlab-foss", "max_forks_repo_forks_event_min_datetime": "2021-12-02T08:02:15.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-02T08:02:15.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 23.1666666667, "max_line_length": 73, "alphanum_fraction": 0.6654676259}
import Vue from 'vue';

import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import TermsApp from './components/app.vue';

export const initTermsApp = () => {
  const el = document.getElementById('js-terms-of-service');

  if (!el) return false;

  const { terms, permissions, paths } = convertObjectPropsToCamelCase(
    JSON.parse(el.dataset.termsData),
    { deep: true },
  );

  return new Vue({
    el,
    provide: { terms, permissions, paths },
    render(createElement) {
      return createElement(TermsApp);
    },
  });
};
