(($) => {
  $.plugin(`children`, function (context) {
    let kids = [];

    this.each((el) => {
      if (el !== null) {
        kids.push([].slice.call(el.children));
      }
    });
    kids = [].concat.apply([], kids);

    if (!context) {
      return $(kids);
    }


    return $.matches(kids, context);
  });
})(collector);