(function($) {
  $.plugin(`hasClass`, function(klass) {
    return this.some((node) => {
      let cn = node.className,
        reg = new RegExp(klass);

      return (reg.test(cn));
    });
  });
})(collector);