function selectorMatches()

in transforms/sort-comp.js [142:178]


function selectorMatches(selector, method) {
  const methodName = method.key.name;

  if (
    method.static &&
    selector === 'static-methods' &&
    defaultMethodsOrder.indexOf(methodName) === -1
  ) {
    return true;
  }

  if (
    !method.value &&
    method.typeAnnotation &&
    selector === 'type-annotations'
  ) {
    return true;
  }

  if (method.static && selector === 'static-methods') {
    return true;
  }

  if (selector === methodName) {
    return true;
  }

  const selectorIsRe = regExpRegExp.test(selector);

  if (selectorIsRe) {
    const match = selector.match(regExpRegExp);
    const selectorRe = new RegExp(match[1], match[2]);
    return selectorRe.test(methodName);
  }

  return false;
}