function updateVersion(gltf, options) {
  options = options ?? Frozen.EMPTY_OBJECT;
  const targetVersion = options.targetVersion;
  let version = gltf.version;

  gltf.asset = gltf.asset ?? { version: "1.0" };

  gltf.asset.version = gltf.asset.version ?? "1.0";
  version = (version ?? gltf.asset.version).toString();

  // Invalid version
  if (!Object.prototype.hasOwnProperty.call(updateFunctions, version)) {
    // Try truncating trailing version numbers, could be a number as well if it is 0.8
    if (defined(version)) {
      version = version.substring(0, 3);
    }
    // Default to 1.0 if it cannot be determined
    if (!Object.prototype.hasOwnProperty.call(updateFunctions, version)) {
      version = "1.0";
    }
  }

  let updateFunction = updateFunctions[version];

  while (defined(updateFunction)) {
    if (version === targetVersion) {
      break;
    }
    updateFunction(gltf, options);
    version = gltf.asset.version;
    updateFunction = updateFunctions[version];
  }

  if (!options.keepLegacyExtensions) {
    convertTechniquesToPbr(gltf, options);
    convertMaterialsCommonToPbr(gltf);
  }

  return gltf;
}
Update the glTF version to the latest version (2.0), or targetVersion if specified.
Applies changes made to the glTF spec between revisions so that the core library
only has to handle the latest version.

@param {object} gltf A javascript object containing a glTF asset.
@param {object} [options] Options for updating the glTF.
@param {string} [options.targetVersion] The glTF will be upgraded until it hits the specified version.
@param {string[]} [options.baseColorTextureNames] Names of uniforms that indicate base color textures.
@param {string[]} [options.baseColorFactorNames] Names of uniforms that indicate base color factors.
@returns {object} The updated glTF asset.

@private