docs: function generateTSConfig(options, fileNames) {
          var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
          var configurations = {
              compilerOptions: serializeCompilerOptions(compilerOptions)
          };
          if (fileNames && fileNames.length) {
              // only set the files property if we have at least one file
              configurations.files = fileNames;
          }
          return configurations;
          function getCustomTypeMapOfCommandLineOption(optionDefinition) {
              if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") {
                  // this is of a type CommandLineOptionOfPrimitiveType
                  return undefined;
              }
              else if (optionDefinition.type === "list") {
                  return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
              }
              else {
                  return optionDefinition.type;
              }
          }
          function getNameOfCompilerOptionValue(value, customTypeMap) {
              // There is a typeMap associated with this command-line option so use it to map value back to its name
              for (var key in customTypeMap) {
                  if (customTypeMap[key] === value) {
                      return key;
                  }
              }
              return undefined;
          }
          function serializeCompilerOptions(options) {
              var result = ts.createMap();
              var optionsNameMap = getOptionNameMap().optionNameMap;
              for (var name_35 in options) {
                  if (ts.hasProperty(options, name_35)) {
                      // tsconfig only options cannot be specified via command line,
                      // so we can assume that only types that can appear here string | number | boolean
                      switch (name_35) {
                          case "init":
                          case "watch":
                          case "version":
                          case "help":
                          case "project":
                              break;
                          default:
                              var value = options[name_35];
                              var optionDefinition = optionsNameMap[name_35.toLowerCase()];
                              if (optionDefinition) {
                                  var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition);
                                  if (!customTypeMap) {
                                      // There is no map associated with this compiler option then use the value as-is
                                      // This is the case if the value is expect to be string, number, boolean or list of string
                                      result[name_35] = value;
                                  }
                                  else {
                                      if (optionDefinition.type === "list") {
                                          var convertedValue = [];
                                          for (var _i = 0, _a = value; _i < _a.length; _i++) {
                                              var element = _a[_i];
                                              convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap));
                                          }
                                          result[name_35] = convertedValue;
                                      }
                                      else {
                                          // There is a typeMap associated with this command-line option so use it to map value back to its name
                                          result[name_35] = getNameOfCompilerOptionValue(value, customTypeMap);
                                      }
                                  }
                              }
                              break;
                      }
                  }
              }
              return result;
          }
      }