code: function _set(obj, key, val) {
      if (arguments.length !== 3 || !is_1.isObject(obj) || (!is_1.isArray(key) && !is_1.isString(key)))
          return null;
      var props = string_1.split(key);
      /* istanbul ignore if */
      // if (!isValue(val))
      //   val = {};
      var prop = props.shift();
      var match = matchIndex(prop);
      var next = obj[prop];
      if (!is_1.isValue(next) && !match)
          next = obj[prop] = {};
      if (match) {
          if (!obj[match.name])
              obj[match.name] = [];
          next = obj[match.name][match.index];
      }
      if (props.length > 0) {
          _set(next, props, val);
      }
      else {
          if (match)
              obj[match.name][match.index] = val;
          else
              obj[prop] = val;
      }
      return obj;
  }
docs: Set
  @private