text: /*
   * Copyright (c) 2016-2017 VMware, Inc. All Rights Reserved.
   * This software is released under MIT license.
   * The full license information can be found in LICENSE in the root directory of this project.
   */
  /**
   * Generic accessor for deep object properties
   * that can be specified as simple dot-separated strings.
   */
  var NestedProperty = (function () {
      function NestedProperty(prop) {
          this.prop = prop;
          if (prop.indexOf(".") >= 0) {
              this.splitProp = prop.split(".");
          }
      }
      // Safe getter for a deep object property, will not throw an error but return
      // undefined if one of the intermediate properties is null or undefined.
      NestedProperty.prototype.getPropValue = function (item) {
          if (this.splitProp) {
              var value = item;
              for (var _i = 0, _a = this.splitProp; _i < _a.length; _i++) {
                  var nestedProp = _a[_i];
                  if (value == null || typeof value === "undefined" || typeof value[nestedProp] === "undefined") {
                      return undefined;
                  }
                  value = value[nestedProp];
              }
              return value;
          }
          else {
              return item[this.prop];
          }
      };
      return NestedProperty;
  }());
  export { NestedProperty };
  //# sourceMappingURL=nested-property.js.map