KOSASIH / SilkRoad

Avoid use of == and != JS-0050
Anti-pattern
Minor
8 months agoa year old
Expected '===' and instead saw '=='
5166      return elementWidth + 'px';
5167    }
5168
5169    if (method == 'style') {5170      var style = $element.attr('style');
5171
5172      if (typeof(style) !== 'string') {
Expected '===' and instead saw '=='
5156      return this._resolveWidth($element, 'element');
5157    }
5158
5159    if (method == 'element') {5160      var elementWidth = $element.outerWidth(false);
5161
5162      if (elementWidth <= 0) {
Expected '===' and instead saw '=='
5146  Select2.prototype._resolveWidth = function ($element, method) {
5147    var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
5148
5149    if (method == 'resolve') {5150      var styleWidth = this._resolveWidth($element, 'style');
5151
5152      if (styleWidth != null) {
Expected '===' and instead saw '=='
4990
4991    // Prefer the element's `dataset` attribute if it exists
4992    // jQuery 1.x does not correctly handle data attributes with multiple dashes
4993    if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {4994      dataset = $.extend(true, {}, $e[0].dataset, $e.data());
4995    } else {
4996      dataset = $e.data();
Expected '!==' and instead saw '!='
4491    maximumSelected: function (args) {
4492      var message = 'You can only select ' + args.maximum + ' item';
4493
4494      if (args.maximum != 1) {4495        message += 's';
4496      }
4497