<commit_before>const $ = window.jQuery
const startswith = require('lodash.startswith')

const createLink = require('../helpers').createLink
const cratesurl = require('./rust').cratesurl

module.exports.process = function process () {
  switch (location.pathname.split('/').slice(-1)[0]) {
    case 'Cargo.toml':
      cargotoml()
      break
  }
}

function cargotoml () {
  var depsOpen = false

  $('.blob-code-inner').each((_, elem) => {
    elem = $(elem)
    let line = elem.text().trim()

    if (line === '[dependencies]' || line === '[dev-dependencies]') {
      depsOpen = true
      return
    }

    if (startswith(line, '[')) {
      depsOpen = false
      return
    }<commit_msg>#41 - conditional dependencies for Cargo.toml<commit_after>const $ = window.jQuery
const startswith = require('lodash.startswith')

const createLink = require('../helpers').createLink
const cratesurl = require('./rust').cratesurl

module.exports.process = function process () {
  switch (location.pathname.split('/').slice(-1)[0]) {
    case 'Cargo.toml':
      cargotoml()
      break
  }
}

function cargotoml () {
  var depsOpen = false

  $('.blob-code-inner').each((_, elem) => {
    elem = $(elem)
    let line = elem.text().trim()

    if (/(\[|\.)(dev-)?dependencies\]/.test(line)) {
      depsOpen = true
      return
    }

    if (startswith(line, '[')) {
      depsOpen = false
      return
    }
{'fraction_non_alphanumeric': 0.17844396859386152, 'fraction_numerical': 0.004282655246252677, 'mean_word_length': 2.9271708683473388, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7174643', 'n_tokens_mistral': 475, 'n_tokens_neox': 455, 'n_words': 91}