<commit_before># ---
# console
# ---
- trigger: cl
  scope: javascript
  description: console.log
  text: |
        console.log(${1:obj});${2}

- trigger: cd
  scope: javascript
  description: console.dir
  text: |
        console.dir(${1:obj});${2}

- trigger: ce
  scope: javascript
  description: console.error
  text: |
        console.error(${1:obj});${2}

- trigger: cll
  scope: javascript
  description: console.log
  text: |
        console.log('${1:obj}:', ${1:obj});${2}

- trigger: cdd
  scope: javascript
  description: console.dir
  text: |
       console.dir('${1:obj}:', ${1:obj});${2}

- trigger: cee
  scope: javascript
  description: console.error
  text: |
        console.error('${1:obj}:', ${1:obj});${2}

# ---
# DOM
# ---
- trigger: ae
  scope: javascript
  description: document.addEventListener
  text: |
        ${1:document}.addEventListener('${2:event}', function(e) {
          ${3}
        });${4}

- trigger: ac
  scope: javascript
  description: document.appendChild
  text: |
        ${1:document}.appendChild(${2:elem});${3}

- trigger: rc
  scope: javascript
  description: document.removeChild
  text: |
        ${1:document}.removeChild(${2:elem});${3}

- trigger: cel
  scope: javascript
  description: document.createElement
  text: |
        ${1:document}.createElement(${2:elem});${3}

- trigger: gi
  scope: javascript
  description: document.getElementById
  text: |
        ${1:document}.getElementById('${2:id}');${3}

- trigger: gc
  scope: javascript
  description: document.getElementsByClassName
  text: |
        ${1:document}.getElementsByClassName('${2:class}');${3}

- trigger: gt
  scope: javascript
  description: document.getElementsByTagName
  text: |
        ${1:document}.getElementsByTagName('${2:tag}');${3}

- trigger: qs
  scope: javascript
  description: document.querySelector
  text: |
        ${1:document}.querySelector('${2:selector}');${3}

- trigger: qsa
  scope: javascript
  description: document.querySelectorAll
  text: |
        ${1:document}.querySelectorAll('${2:selector}');${3}

# ---
# Loop
# ---
- trigger: fe
  scope: javascript
  description: forEach
  text: |
        ${1:myArray}.forEach(function (${2:elem}) {
          ${3}
        });${4}

- trigger: fi
  scope: javascript
  description: for in
  text: |
        for (${1:prop} in ${2:obj}) {
          if (${2:obj}.hasOwnProperty(${1:prop})) {
            ${3}
          }
        }${4}

# ---
# function
# ---
- trigger: fn
  scope: javascript
  description: function
  text: |
        function ${1:methodName} (${2:arguments}) {
          ${3}
        }${4}

- trigger: afn
  scope: javascript
  description: for in
  text: |
        function (${1:arguments}) {
          ${2}
        };${3}

- trigger: pr
  scope: javascript
  description: prototype
  text: |
        ${1:ClassName}.prototype.${2:methodName} = function (${3:arguments}) {
          ${4}
        };${5}

# ---
# function
# ---
- trigger: si
  scope: javascript<commit_msg>fix: wrong description of afn<commit_after># ---
# console
# ---
- trigger: cl
  scope: javascript
  description: console.log
  text: |
        console.log(${1:obj});${2}

- trigger: cd
  scope: javascript
  description: console.dir
  text: |
        console.dir(${1:obj});${2}

- trigger: ce
  scope: javascript
  description: console.error
  text: |
        console.error(${1:obj});${2}

- trigger: cll
  scope: javascript
  description: console.log
  text: |
        console.log('${1:obj}:', ${1:obj});${2}

- trigger: cdd
  scope: javascript
  description: console.dir
  text: |
       console.dir('${1:obj}:', ${1:obj});${2}

- trigger: cee
  scope: javascript
  description: console.error
  text: |
        console.error('${1:obj}:', ${1:obj});${2}

# ---
# DOM
# ---
- trigger: ae
  scope: javascript
  description: document.addEventListener
  text: |
        ${1:document}.addEventListener('${2:event}', function(e) {
          ${3}
        });${4}

- trigger: ac
  scope: javascript
  description: document.appendChild
  text: |
        ${1:document}.appendChild(${2:elem});${3}

- trigger: rc
  scope: javascript
  description: document.removeChild
  text: |
        ${1:document}.removeChild(${2:elem});${3}

- trigger: cel
  scope: javascript
  description: document.createElement
  text: |
        ${1:document}.createElement(${2:elem});${3}

- trigger: gi
  scope: javascript
  description: document.getElementById
  text: |
        ${1:document}.getElementById('${2:id}');${3}

- trigger: gc
  scope: javascript
  description: document.getElementsByClassName
  text: |
        ${1:document}.getElementsByClassName('${2:class}');${3}

- trigger: gt
  scope: javascript
  description: document.getElementsByTagName
  text: |
        ${1:document}.getElementsByTagName('${2:tag}');${3}

- trigger: qs
  scope: javascript
  description: document.querySelector
  text: |
        ${1:document}.querySelector('${2:selector}');${3}

- trigger: qsa
  scope: javascript
  description: document.querySelectorAll
  text: |
        ${1:document}.querySelectorAll('${2:selector}');${3}

# ---
# Loop
# ---
- trigger: fe
  scope: javascript
  description: forEach
  text: |
        ${1:myArray}.forEach(function (${2:elem}) {
          ${3}
        });${4}

- trigger: fi
  scope: javascript
  description: for in
  text: |
        for (${1:prop} in ${2:obj}) {
          if (${2:obj}.hasOwnProperty(${1:prop})) {
            ${3}
          }
        }${4}

# ---
# function
# ---
- trigger: fn
  scope: javascript
  description: function
  text: |
        function ${1:methodName} (${2:arguments}) {
          ${3}
        }${4}

- trigger: afn
  scope: javascript
  description: anonymous function
  text: |
        function (${1:arguments}) {
          ${2}
        };${3}

- trigger: pr
  scope: javascript
  description: prototype
  text: |
        ${1:ClassName}.prototype.${2:methodName} = function (${3:arguments}) {
          ${4}
        };${5}

# ---
# function
# ---
- trigger: si
  scope: javascript
{'fraction_non_alphanumeric': 0.18195463642428286, 'fraction_numerical': 0.021681120747164776, 'mean_word_length': 2.793168880455408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2385933', 'n_tokens_mistral': 2043, 'n_tokens_neox': 1968, 'n_words': 401}