<commit_before>const xmldom = require('xmldom')
const Parser = new xmldom.DOMParser()

const typeExceptions = [ 'g', 'svg' ]

function getAttributes (el, list) {
  const att = {}

  list.forEach(name => {
    att[name] = parseFloat(el.getAttribute(name))
  })

  return att
}

const decoders = {
  path (el) {
    return el.getAttribute('d')
  },

  circle (el) {
    const att = getAttributes(el, [ 'cx', 'cy', 'r' ])
    return 'M' + (att.cx - att.r) + ',' + att.cy +
      'a' + att.r + ',' + att.r + ' 0 1,0 ' + (2 * att.r) + ',0' +
      'a' + att.r + ',' + att.r + ' 0 1,0'  + (-2 * att.r) + ',0'
  },

  ellipse (el) {
    const att = getAttributes(el, [ 'cx', 'cy', 'rx', 'ry' ])
    return 'M' + (att.cx - att.rx) + ',' + att.cy +
      'a' + att.rx + ',' + att.ry + ' 0 1,0 ' + (2 * att.rx) + ',0' +
      'a' + att.rx + ',' + att.ry + ' 0 1,0'  + (-2 * att.rx) + ',0'
  },

  polygon (el) {
    const points = el.getAttribute('points')
      .replace(/  /g, ' ')
      .trim()
      .split(/\s+|,/)

    const x0 = points.shift()
    const y0 = points.shift()

    return 'M' + x0 + ',' + y0 + 'L' + points.join(' ')
  },

  pollyline (el) {
    return this.polygon(el)
  },

  rect (el) {
    const att = getAttributes(el, [ 'x', 'y', 'width', 'height' ])
    return 'M' + att.x + ',' + att.y + 'L' + (att.x + att.width) + ',' + att.y + ' ' +
      (att.x + att.width) + ',' + (att.y + att.height) + ' ' + att.x + ',' + (att.y + att.height)
  },

  line (el) {
    const att = getAttributes(el, [ 'x1', 'x2', 'y1', 'y2' ])
    return 'M' + att.x1 + ',' + att.y1 + 'L' + att.x2 + ',' + att.y2<commit_msg>fix(app): Update build system to match eva icons svg structure<commit_after>const xmldom = require('xmldom')
const Parser = new xmldom.DOMParser()

const typeExceptions = [ 'g', 'svg', 'defs', 'style' ]

function getAttributes (el, list) {
  const att = {}

  list.forEach(name => {
    att[name] = parseFloat(el.getAttribute(name))
  })

  return att
}

const decoders = {
  path (el) {
    return el.getAttribute('d')
  },

  circle (el) {
    const att = getAttributes(el, [ 'cx', 'cy', 'r' ])
    return 'M' + (att.cx - att.r) + ',' + att.cy +
      'a' + att.r + ',' + att.r + ' 0 1,0 ' + (2 * att.r) + ',0' +
      'a' + att.r + ',' + att.r + ' 0 1,0'  + (-2 * att.r) + ',0'
  },

  ellipse (el) {
    const att = getAttributes(el, [ 'cx', 'cy', 'rx', 'ry' ])
    return 'M' + (att.cx - att.rx) + ',' + att.cy +
      'a' + att.rx + ',' + att.ry + ' 0 1,0 ' + (2 * att.rx) + ',0' +
      'a' + att.rx + ',' + att.ry + ' 0 1,0'  + (-2 * att.rx) + ',0'
  },

  polygon (el) {
    const points = el.getAttribute('points')
      .replace(/  /g, ' ')
      .trim()
      .split(/\s+|,/)

    const x0 = points.shift()
    const y0 = points.shift()

    return 'M' + x0 + ',' + y0 + 'L' + points.join(' ')
  },

  polyline (el) {
    return this.polygon(el)
  },

  rect (el) {
    const att = getAttributes(el, [ 'x', 'y', 'width', 'height' ])
    return 'M' + att.x + ',' + att.y + 'L' + (att.x + att.width) + ',' + att.y + ' ' +
      (att.x + att.width) + ',' + (att.y + att.height) + ' ' + att.x + ',' + (att.y + att.height)
  },

  line (el) {
    const att = getAttributes(el, [ 'x1', 'x2', 'y1', 'y2' ])
    return 'M' + att.x1 + ',' + att.y1 + 'L' + att.x2 + ',' + att.y2
{'fraction_non_alphanumeric': 0.2503793626707132, 'fraction_numerical': 0.019423368740515933, 'mean_word_length': 2.231372549019608, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '1178324', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1420, 'n_words': 314}