code: private static String parseFormat(List<? extends TargetExpr> args) {
      String numberFormatType = !args.isEmpty() ? args.get(0).getText() : "'" + DEFAULT_FORMAT + "'";
  
      if (!JS_ARGS_TO_ENUM.containsKey(numberFormatType)) {
        String validKeys = Joiner.on("', '").join(JS_ARGS_TO_ENUM.keySet());
        throw new IllegalArgumentException(
            "First argument to formatNum must be constant, and one of: '" + validKeys + "'.");
      }
  
      return numberFormatType;
    }
docs: Validates that the provided format matches a supported format, and returns the value, if not,
  this throws an exception.
  
  @param args The list of provided arguments.
  @return String The number format type.