text: import "core-js/modules/es.array.map.js";
  import "core-js/modules/es.array.filter.js";
  
  /**
   * @license
   * Copyright (c) 2021 Handsoncode. All rights reserved.
   */
  import { invalidSimpleCellAddress } from './Cell';
  import { NamedExpressionDependency } from './parser';
  import { AbsoluteCellRange } from './AbsoluteCellRange';
  /**
   * Converts dependencies from maybe relative addressing to absolute addressing.
   *
   * @param deps - list of addresses in R0C0 format
   * @param baseAddress - base address with regard to which make a convertion
   */
  
  export var absolutizeDependencies = function absolutizeDependencies(deps, baseAddress) {
    return deps.map(function (dep) {
      return dep.absolutize(baseAddress);
    });
  };
  export var filterDependenciesOutOfScope = function filterDependenciesOutOfScope(deps) {
    return deps.filter(function (dep) {
      if (dep instanceof NamedExpressionDependency) {
        return true;
      }
  
      if (dep instanceof AbsoluteCellRange) {
        return !(invalidSimpleCellAddress(dep.start) || invalidSimpleCellAddress(dep.end));
      } else {
        return !invalidSimpleCellAddress(dep);
      }
    });
  };