"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.addClass = addClass;
exports.removeClass = removeClass;

/*
 * @Author: lianghaosen
 * @Date: 2018-12-03 15:49:28
 * @Last Modified by: lianghaosen
 * @Last Modified time: 2018-12-04 11:16:16
 */
function addClass(node, className) {
  node.className += " ".concat(className);
}

function removeClass(node, className) {
  var arr = className.split(/\s+/);
  var nArr = node.className.split(/\s+/);
  arr.forEach(function (a) {
    var index = nArr.indexOf(a);

    if (index !== -1) {
      nArr.splice(index, 1);
    }
  });
  node.className = nArr.join(" ");
}