{"id":13564639,"url":"https://github.com/ByeongUkChoi/transformer","last_synced_at":"2025-04-03T21:31:17.624Z","repository":{"id":57673789,"uuid":"482266288","full_name":"ByeongUkChoi/transformer","owner":"ByeongUkChoi","description":"Flexible type conversion lightweight library","archived":false,"fork":false,"pushed_at":"2022-06-18T11:50:47.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T01:11:13.937Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/transformer","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ByeongUkChoi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-16T13:49:53.000Z","updated_at":"2022-04-16T14:22:49.000Z","dependencies_parsed_at":"2022-08-31T13:11:04.911Z","dependency_job_id":null,"html_url":"https://github.com/ByeongUkChoi/transformer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByeongUkChoi%2Ftransformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByeongUkChoi%2Ftransformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByeongUkChoi%2Ftransformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByeongUkChoi%2Ftransformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ByeongUkChoi","download_url":"https://codeload.github.com/ByeongUkChoi/transformer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247083201,"owners_count":20880794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:01:33.940Z","updated_at":"2025-04-03T21:31:16.442Z","avatar_url":"https://github.com/ByeongUkChoi.png","language":"Elixir","funding_links":[],"categories":["Text and Numbers"],"sub_categories":[],"readme":"# Transformer\nTransformer is lightweight library that helps with flexible type conversion.\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `transformer` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:transformer, \"~\u003e 0.0.1\"}\n  ]\nend\n```\n\n## Usage\n\nConvert to integer without error.  \nIf it cannot be converted, it returns a substitute.  \n```elixir\niex\u003e Transformer.to_integer_or(1)\n1\n\niex\u003e Transformer.to_integer_or(\"2\")\n2\n\niex\u003e Transformer.to_integer_or(\"a\")\n\"a\"\n\niex\u003e Transformer.to_integer_or(\"a\", nil)\nnil\n\niex\u003e Transformer.to_integer_or(\"a\", \u0026 \u00261 \u003c\u003e \u00261)\n\"aa\"\n```\n\nDivides a string and convert to integer list without error.  \nIf it cannot be converted, it returns a substitute.  \n```elixir\niex\u003e Transformer.to_integer_list_or(\"1\")\n[1]\n\niex\u003e Transformer.to_integer_list_or(\"1,2\")\n[1, 2]\n\niex\u003e Transformer.to_integer_list_or(\"1,a\")\n[1, \"a\"]\n\niex\u003e Transformer.to_integer_list_or(\"1,a\", nil)\n[1, nil]\n\niex\u003e Transformer.to_integer_list_or([1, 2])\n[1, 2]\n\niex\u003e Transformer.to_integer_list_or([\"a\", 2], nil)\n[nil, 2]\n```\n\n## Documentation\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at \u003chttps://hexdocs.pm/transformer\u003e.\n\n## License\n\nCopyright 2022 ByeongUk Choi\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FByeongUkChoi%2Ftransformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FByeongUkChoi%2Ftransformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FByeongUkChoi%2Ftransformer/lists"}