<commit_before>// use VueScript2 to handle lazy-loading of routes in conjunction
// with browserify-shim. See Gruntfile for details.
import Vue from 'vue'
import VS2 from 'vue-script2'
// import VS2 from './ignored/Script2'
Vue.use(VS2)

export function lazyLoadVue (component: string, base: string = '/simple/js') {
  // if we wanted to support vue-hot-reload-api in
  // lazy-loaded modules, then we could do something like this in main.js:
  // window.HOTAPI = require('vue-hot-reload-api')
  return function (resolve: Function, reject: Function) {
    VS2.load(`${base}/${component}.js`)
    .then(() => resolve(window[component]))
    .catch((err) => reject(err))
  }
}

// manually implemented lodash functions are better than even:
// https://github.com/lodash/babel-plugin-lodash
// additional tiny versions of lodash functions are available in VueScript2
export function mapValues (obj: Object, fn: Function, o: Object = {}) {
  for (let key in obj) { o[key] = fn(obj[key]) }
  return o
}

// bind local properties to on-the-fly created vue components
// now it only works with either single values ('boundKey') or passing the whole form object
// TODO: it should work with more complex but still filtered values, see CreateGroupRules comp
export const connect = (component, boundData, boundKey) => ({
  template: `<comp v-model="value"></comp>`,
  components: { comp: component },
  computed: {<commit_msg>no more anonymous components<commit_after>// use VueScript2 to handle lazy-loading of routes in conjunction
// with browserify-shim. See Gruntfile for details.
import Vue from 'vue'
import VS2 from 'vue-script2'
// import VS2 from './ignored/Script2'
Vue.use(VS2)

export function lazyLoadVue (component: string, base: string = '/simple/js') {
  // if we wanted to support vue-hot-reload-api in
  // lazy-loaded modules, then we could do something like this in main.js:
  // window.HOTAPI = require('vue-hot-reload-api')
  return function (resolve: Function, reject: Function) {
    VS2.load(`${base}/${component}.js`)
    .then(() => resolve(window[component]))
    .catch((err) => reject(err))
  }
}

// manually implemented lodash functions are better than even:
// https://github.com/lodash/babel-plugin-lodash
// additional tiny versions of lodash functions are available in VueScript2
export function mapValues (obj: Object, fn: Function, o: Object = {}) {
  for (let key in obj) { o[key] = fn(obj[key]) }
  return o
}

// bind local properties to on-the-fly created vue components
// now it only works with either single values ('boundKey') or passing the whole form object
// TODO: it should work with more complex but still filtered values, see CreateGroupRules comp
export const connect = (component, boundData, boundKey) => ({
  name: 'Connected' + component.name,
  template: `<comp v-model="value"></comp>`,
  components: { comp: component },
  computed: {
{'fraction_non_alphanumeric': 0.12755632582322357, 'fraction_numerical': 0.005545927209705373, 'mean_word_length': 4.036649214659686, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4482860', 'n_tokens_mistral': 857, 'n_tokens_neox': 846, 'n_words': 316}