'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
/**
 * Created by geweimin on 17/6/19.
 */
var addClassName = exports.addClassName = function addClassName(obj, cls) {
  var objClass = obj.className;
  var blank = objClass !== '' ? ' ' : '';
  var added = objClass + blank + cls;
  obj.className = added;
};

var removeClassName = exports.removeClassName = function removeClassName(obj, cls) {
  var objClass = ' ' + obj.className + ' ';
  objClass = objClass.replace(/(\s+)/gi, ' ');
  var removed = objClass.replace(' ' + cls + ' ', ' ');
  removed = removed.replace(/(^\s+)|(\s+$)/g, '');
  obj.className = removed;
};