Skip to content

Commit

Permalink
fix: そのままの文字列も返すようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
hacomono-shigure-onishi committed Jan 18, 2024
1 parent 9b81954 commit eb547cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Output:

```
terraform_string_convert_format = {
"pure" = "hello new world"
"camelcase" = "helloNewWorld"
"kebabcase" = "hello-new-world"
"lower" = "hello new world"
Expand Down Expand Up @@ -59,5 +60,5 @@ No resources.

| Name | Description |
|------|-------------|
| <a name="output_formats"></a> [formats](#output\_formats) | output sample:<br><br>terraform\_string\_convert\_format = {<br> "camelcase" = "helloNewWorld"<br> "kebabcase" = "hello-new-world"<br> "lower" = "hello new world"<br> "pascalcase" = "HelloNewWorld"<br> "snakecase" = "hello\_new\_world"<br> "upper" = "HELLO NEW WORLD"<br> "uppercamelcase" = "HelloNewWorld"<br> "upperkebabcase" = "Hello-New-World"<br>} |
| <a name="output_formats"></a> [formats](#output\_formats) | output sample:<br><br>terraform\_string\_convert\_format = {<br> "pure" = "hello new world"<br> "camelcase" = "helloNewWorld"<br> "kebabcase" = "hello-new-world"<br> "lower" = "hello new world"<br> "pascalcase" = "HelloNewWorld"<br> "snakecase" = "hello\_new\_world"<br> "upper" = "HELLO NEW WORLD"<br> "uppercamelcase" = "HelloNewWorld"<br> "upperkebabcase" = "Hello-New-World"<br>} |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*
* ```
* terraform_string_convert_format = {
* "pure" = "hello new world"
* "camelcase" = "helloNewWorld"
* "kebabcase" = "hello-new-world"
* "lower" = "hello new world"
Expand All @@ -25,6 +26,7 @@

locals {
formats = {
pure = var.str
upper = upper(var.str)
lower = lower(var.str)
camelcase = replace(join("", [substr(var.str, 0, 1), substr(title(var.str), 1, -1)]), " ", "")
Expand Down
1 change: 1 addition & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ output "formats" {
output sample:
terraform_string_convert_format = {
"pure" = "hello new world"
"camelcase" = "helloNewWorld"
"kebabcase" = "hello-new-world"
"lower" = "hello new world"
Expand Down

0 comments on commit eb547cf

Please sign in to comment.