code: function fromWireValue(driver, value) {
    if (Array.isArray(value)) {
      value = value.map(v => fromWireValue(driver, v));
    } else if (WebElement.isId(value)) {
      let id = WebElement.extractId(value);
      value = new WebElement(driver, id);
    } else if (value && typeof value === 'object') {
      let result = {};
      for (let key in value) {
        if (value.hasOwnProperty(key)) {
          result[key] = fromWireValue(driver, value[key]);
        }
      }
      value = result;
    }
    return value;
  }
docs: Converts a value from its JSON representation according to the WebDriver wire
  protocol. Any JSON object that defines a WebElement ID will be decoded to a
  {@link WebElement} object. All other values will be passed through as is.
  
  @param {!WebDriver} driver The driver to use as the parent of any unwrapped
  {@link WebElement} values.
  @param {*} value The value to convert.
  @return {*} The converted value.