<commit_before>$ ->
  $('.properties-widget').each ->
    property = (name, type) ->
      return {
        name: ko.observable(name)
        type: ko.observable(type)
        deleteProperty: () ->
          viewModel.properties.remove(this)
      }

    viewModel =
      properties: ko.observableArray()
      addProperty: () ->
        viewModel.properties.push(property())

    viewModel.value = ko.computed () ->
      # Convert viewModel.properties into json
      return JSON.stringify(ko.toJS(viewModel).properties)

    value = $(this).data('value')
    if value
      for i in value
        viewModel.properties.push(property(i.name, i.type))

    ko.applyBindings(viewModel, this)

    window.v = viewModel<commit_msg>Don't start with two empty properties<commit_after>$ ->
  $('.properties-widget').each ->
    property = (name, type) ->
      return {
        name: ko.observable(name)
        type: ko.observable(type)
        deleteProperty: () ->
          viewModel.properties.remove(this)
      }

    viewModel =
      properties: ko.observableArray()
      addProperty: () ->
        viewModel.properties.push(property())

    viewModel.value = ko.computed () ->
      # Convert viewModel.properties into json
      return JSON.stringify(ko.toJS(viewModel).properties)

    value = $(this).data('value')
    if not value == '""'
      for i in value
        viewModel.properties.push(property(i.name, i.type))

    ko.applyBindings(viewModel, this)

    window.v = viewModel
{'fraction_non_alphanumeric': 0.13453815261044177, 'fraction_numerical': 0.0, 'mean_word_length': 2.468677494199536, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5554714', 'n_tokens_mistral': 445, 'n_tokens_neox': 431, 'n_words': 83}