private getActivatedValues()

in projects/libs/flex-layout/core/media-marshaller/media-marshaller.ts [330:350]


  private getActivatedValues(bpMap: BreakpointMap, key?: string): ValueMap | undefined {
    for (let i = 0; i < this.activatedBreakpoints.length; i++) {
      const activatedBp = this.activatedBreakpoints[i];
      const valueMap = bpMap.get(activatedBp.alias);

      if (valueMap) {
        if (key === undefined || (valueMap.has(key) && valueMap.get(key) != null)) {
          return valueMap;
        }
      }
    }

    // On the server, we explicitly have an "all" section filled in to begin with.
    // So we don't need to aggressively find a fallback if no explicit value exists.
    if (!this._useFallbacks) {
      return undefined;
    }

    const lastHope = bpMap.get('');
    return (key === undefined || lastHope && lastHope.has(key)) ? lastHope : undefined;
  }