packages/plugin/index.js
function getContainerName(skip = 0) {
      let element = null;
      let mixin = null;
      for (let i = policyPath.length - (skip * 2); (i -= 2) >= 0;) {
        const policyPathElement = policyPath[i];
        if (typeof policyPathElement === 'object') {
          if (policyPathElement.type === 'Tag') {
            element = policyPathElement.name.toLowerCase();
            break;
          } else if (policyPathElement.type === 'Mixin' && !policyPathElement.call) {
            mixin = policyPathElement.name;
            break;
          }
        }
      }
      return { element, mixin };
    }
function getContainerName(skip = 0) {
      let element = null;
      let mixin = null;
      for (let i = policyPath.length - (skip * 2); (i -= 2) >= 0;) {
        const policyPathElement = policyPath[i];
        if (typeof policyPathElement === 'object') {
          if (policyPathElement.type === 'Tag') {
            element = policyPathElement.name.toLowerCase();
            break;
          } else if (policyPathElement.type === 'Mixin' && !policyPathElement.call) {
            mixin = policyPathElement.name;
            break;
          }
        }
      }
      return { element, mixin };
    }
function getContainerName ( skip = 0 ) { let element = null ; let mixin = null ; for ( let i = policyPath . length - ( skip * 2 ) ; ( i -= 2 ) >= 0 ; ) { const policyPathElement = policyPath [ i ] ; if ( typeof policyPathElement === 'object' ) { if ( policyPathElement . type === 'Tag' ) { element = policyPathElement . name . toLowerCase ( ) ; break ; } else if ( policyPathElement . type === 'Mixin' && ! policyPathElement . call ) { mixin = policyPathElement . name ; break ; } } } return { element , mixin } ; }
Walk upwards to find the enclosing tag and mixin if any.
Walk upwards to find the enclosing tag and mixin if any .