<commit_before>u = do ->
  'use strict'

  forEach = Array::forEach
  push    = Array::push
  slice   = Array::slice

  u = window.u = (selector) ->
    if !(this instanceof u)
      return new u(selector)

    if !selector
      return this

    if selector instanceof u
      return selector

    if typeof selector is 'string'
      return push.apply this, slice.call(document.querySelectorAll(selector))

    if typeof selector is 'function'
      u(document).ready selector

  u:: =
    length: 0

    each: (callback) ->
      forEach.call this, (el, idx) ->
        callback.call el, idx
      return this

    ready: (callback) ->
      if document.readyState is 'complete'
        callback u

      document.addEventListener 'DOMContentLoaded', ->
        callback u

    text: (value) ->
      return this[0].textContent if value is undefined
      this.each ->
        this.textContent = value

    find: (selector) ->
      results = new u()
      this.each ->
        window.el = this
        push.apply results, slice.call(this.querySelectorAll selector)
      return results

    html: (value) ->
      return this[0].innerHTML if value is undefined
      this.each ->
        this.innerHTML = value

    append: (el) ->
      this.each ->
        this.appendChild el

    prepend: (el) ->
      this.each ->
        this.insertBefore el, this.firstChild

    on: (type, func) ->
      this.each ->
        this.addEventListener type, func

    off: (type, func) ->
      this.each ->
        this.removeEventListener type, func

   u

@u = u<commit_msg>Refactor main file<commit_after>u            = require('./micro.core.coffee')
dom          = require('./micro.dom.coffee')
utils        = require('./micro.utils.coffee')
localstorage = require('./micro.localstorage.coffee')
ajax         = require('./micro.ajax.coffee')

utils.extend u::, dom
utils.extend u, utils, db: localstorage, ajax

if typeof module isnt 'undefined'
  if module.exports
    exports = module.exports = u
  exports.u = u

window.u = u if typeof window isnt 'undefined'
{'fraction_non_alphanumeric': 0.11413307430791647, 'fraction_numerical': 0.0014570179698882952, 'mean_word_length': 2.198757763975155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '4359552', 'n_tokens_mistral': 615, 'n_tokens_neox': 586, 'n_words': 175}