function isTemplateCompatible(generator, apiVersion) {
  const generatorVersion = getGeneratorVersion();
  if (typeof generator === 'string' && !semver.satisfies(generatorVersion, generator, {includePrerelease: true})) {
    throw new Error(`This template is not compatible with the current version of the generator (${generatorVersion}). This template is compatible with the following version range: ${generator}.`);
  }

  if (typeof apiVersion === 'string' && !supportedParserAPIMajorVersions.includes(apiVersion)) {
    throw new Error(`The version specified in apiVersion is not supported by this Generator version. Supported versions are: ${supportedParserAPIMajorVersions.join(', ')}`);
  }
}
Checks if template is compatible with the version of the generator that is used
@private
@param {String} generator Information about supported generator version that is part of the template configuration
@param {String} generator Information about supported Parser-API version that is part of the template configuration