Replacement function for jQuery $.width()
Borrowed with thanks from https://github.com/nefe/You-Dont-Need-jQuery#2.2
190053
function getWidth(el) {
  let styles = window.getComputedStyle(el);
  let width = el.offsetWidth;
  let borderLeftWidth = parseFloat(styles.borderLeftWidth);
  let borderRightWidth = parseFloat(styles.borderRightWidth);
  let paddingLeft = parseFloat(styles.paddingLeft);
  let paddingRight = parseFloat(styles.paddingRight);
  return width - borderLeftWidth - borderRightWidth - paddingRight - paddingLeft;
}
1060158
def width(self, width=None):
        """"""

        if width is None:
            return self._width
        else:
            if not is_numeric(width):
                raise TypeError("width must be numeric, not '%s'" % str(width))
            self._width = width
310197
def hrule(width=None, char=None):
    """"""
    width = width or HRWIDTH
    char = char or HRCHAR
    return echo(getline(char, width))
292849
function screenSize() {
        var w = window.outerWidth || html.clientWidth;

        // remove earlier widths
        html.className = html.className.replace(/ (w|lt)-\d+/g, "");

        // add new ones
        pushClass("w-" + Math.round(w / 100) * 100);

        each(conf.screens, function(width) {
            if (w <= width) { pushClass("lt-" + width); }
        });

        api.feature();
    }
1169871
function() {
			var element = this._.element.getFirst();
			return { width: element.$.offsetWidth || 0, height: element.$.offsetHeight || 0 };
		}
282803
function(element) {
        if(!element) return;

        var children = element.children();
        if(children.length <= 0) return;

        var totalWidth = 0;
        for(var i = 0; i < children.length; i++) {
            totalWidth += $(children[i]).width();
        }

        element.width(totalWidth);
    }
465476
function wrap (rule) {
  return ($) => {
    let value = rule($)
    if (typeof value !== 'string') return

    // remove extra whitespace
    value = value.replace(/\s+/g, ' ')
    value = value.trim()

    return value
  }
}
350796
function(jRef, bWidth, iValue, fDoBefore, fDoAfter){
		if (fDoBefore) {
			var iVal = fDoBefore(jRef);
			if (iVal != undefined) {
				iValue = iVal;
			}
		}
		var _fDoAfter = fDoAfter ? function(){fDoAfter(jRef);} : function(){};
		if (jQuery.fx.off) {
			if (bWidth) {
				jRef.width(iValue);
			} else {
				jRef.height(iValue);
			}
			_fDoAfter();
		} else {
			var oParam = bWidth ? {width: iValue} : {height: iValue};
			jRef.stop(true, true).animate(oParam, 200, 'linear', _fDoAfter);
		}
	}
38014
function(){
      var ele = this[0];

      if( ele ){
        var w = ele._private.style.width;
        return w.strValue === 'auto' ? ele._private.autoWidth : w.pxValue;
      }
    }
481245
function lpad (str, width) {
  while (String(str).length < width) {
    str = ' ' + str
  }
  return str
}
1204088
def opt_width(self, width):
        
        if width != "auto":
            width = int(width)
        self.conf["width"] = width
439764
function fitWidth(s, len)
{
    s = s.trim();
    if(s.length <= len) return [s];

    var result = [];
    while(s.length > len)
    {
        var i = len
        for(; s[i] != ' ' && i >= 0; i--) 
            /* empty loop */ ;

        if(i == -1)
        {
            for(i = len + 1; s[i] != ' ' && i < s.length; i++) 
                /* empty loop */ ;
            
            if(i == s.length)
            {
                result.push(s);
                return result;
            }
        }
        result.push(s.substr(0, i));
        s = s.substr(i).trimLeft();
    }
    result.push(s);
    return result;
}
422877
function checkLength(str) {
        var ctm = ctx.measureText(str);
        return ctm.width <= tm.width;
      }
1015010
function (width, units) {
          width = width.toString();
          units = units || width.replace(/^[-\.\d]+/, '') || '%';
          this.widthUnits = units;
          width = parseFloat(width);

          if (width < 0) {
            return false;
          }

          if (units === '%') {
            width = Math.min(100, width);
            width = Math.max(0, width);
          }
          this.style.width = width + '' + units;
          return true;
        }
207790
function() {
            var width = self.innerWidth,  // Safari
                mode = document[COMPAT_MODE];
            
            if (mode || isIE) { // IE, Gecko, Opera
                width = (mode == CSS1_COMPAT) ?
                        documentElement.clientWidth : // Standards
                        document.body.clientWidth; // Quirks
            }
            return width;
        }
464383
function getWidth(el, defaultValue) {
    var width = this.getStyle(el, 'width', defaultValue);
    if (width === 'auto') {
      width = el.offsetWidth;
    }
    return parseFloat(width);
  }
1090261
def wrap(self, width):
        """"""
        res = []
        prev_state = set()
        part = []
        cwidth = 0
        for char, _width, state in zip(self._string, self._width, self._state):
            if cwidth + _width > width:
                if prev_state:
                    part.append(self.ANSI_RESET)
                res.append("".join(part))
                prev_state = set()
                part = []
                cwidth = 0
            cwidth += _width
            if prev_state == state:
                pass
            elif prev_state <= state:
                part.extend(state - prev_state)
            else:
                part.append(self.ANSI_RESET)
                part.extend(state)
            prev_state = state
            part.append(char)
        if prev_state:
            part.append(self.ANSI_RESET)
        if part:
            res.append("".join(part))
        return res