function subjects(selector, ancestor) {
    if (selector == null || typeof selector != "object") {
      return [];
    }
    if (ancestor == null) {
      ancestor = selector;
    }
    const results = selector.subject ? [ancestor] : [];
    for (let property in selector) {
      if (!{}.hasOwnProperty.call(selector, property)) {
        continue;
      }
      [].push.apply(
        results,
        subjects(
          selector[property],
          property === "left" ? selector[property] : ancestor
        )
      );
    }
    return results;
  }
/*
   * For each selector node marked as a subject, find the portion of the selector that the subject must match.
   */
For each selector node marked as a subject, find the portion of the selector that the subject must match.
For each selector node marked as a subject find the portion of the selector that the subject must match .
function subjects(selector, ancestor) {
    if (selector == null || typeof selector != "object") {
      return [];
    }
    if (ancestor == null) {
      ancestor = selector;
    }
    const results = selector.subject ? [ancestor] : [];
    for (let property in selector) {
      if (!{}.hasOwnProperty.call(selector, property)) {
        continue;
      }
      [].push.apply(
        results,
        subjects(
          selector[property],
          property === "left" ? selector[property] : ancestor
        )
      );
    }
    return results;
  }
function subjects ( selector , ancestor ) { if ( selector == null || typeof selector != "object" ) { return [ ] ; } if ( ancestor == null ) { ancestor = selector ; } const results = selector . subject ? [ ancestor ] : [ ] ; for ( let property in selector ) { if ( ! { } . hasOwnProperty . call ( selector , property ) ) { continue ; } [ ] . push . apply ( results , subjects ( selector [ property ] , property === "left" ? selector [ property ] : ancestor ) ) ; } return results ; }
For each selector node marked as a subject, find the portion of the selector that the subject must match.
For each selector node marked as a subject find the portion of the selector that the subject must match .