{"id":24563755,"url":"https://github.com/mildronize/type-safe-design-pattern","last_synced_at":"2025-06-19T08:34:01.629Z","repository":{"id":240223782,"uuid":"802024718","full_name":"mildronize/type-safe-design-pattern","owner":"mildronize","description":"Type-safe Design Pattern in Modern TypeScript","archived":false,"fork":false,"pushed_at":"2024-09-08T07:25:22.000Z","size":2103,"stargazers_count":19,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T20:43:52.416Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://type-safe.thadaw.com","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mildronize.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-17T11:22:31.000Z","updated_at":"2025-02-05T08:26:34.000Z","dependencies_parsed_at":"2024-05-29T16:38:17.309Z","dependency_job_id":null,"html_url":"https://github.com/mildronize/type-safe-design-pattern","commit_stats":null,"previous_names":["mildronize/type-safe-design-pattern"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mildronize/type-safe-design-pattern","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildronize%2Ftype-safe-design-pattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildronize%2Ftype-safe-design-pattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildronize%2Ftype-safe-design-pattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildronize%2Ftype-safe-design-pattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mildronize","download_url":"https://codeload.github.com/mildronize/type-safe-design-pattern/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildronize%2Ftype-safe-design-pattern/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260715913,"owners_count":23051332,"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":"2025-01-23T10:15:41.863Z","updated_at":"2025-06-19T08:33:56.605Z","avatar_url":"https://github.com/mildronize.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Type-safe Design Pattern in Modern TypeScript\n\nThis book provide ready to use design pattern for type-safe approach in modern typescript \nby Thada Wangthammang\n\n## Table of Contents\n\n- TypeScript Config\n  - Use strict\n- Data Structure\n  - Use literal type rathen than string\n  - Use Record object rather than list/array\n  - Use Tuple rather than list/array\n- Design Patterns\n  - Use builder pattern\n  - Use function argument instead of plain object\n  - Use function overload\n\n## Prerequisites\nPlease make sure you have a good understanding of TypeScript before reading this book. If you are new to TypeScript, I recommend reading the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/intro.html) first.\n\nGenerics are a fundamental concept in TypeScript, so make sure you understand them. You can read the [Generics](https://www.typescriptlang.org/docs/handbook/2/generics.html) section of the TypeScript Handbook. \n\nAfter that, make sure you have understand type-level programming. You can read the [Type-Level Programming](https://type-level-typescript.com/) book. \nThere are many free chapters available. However, I recommend buying the book to support the author.\n\n## Disclaimer\n\nI did not create these design patterns. I learned from various modern TypeScript open-source projects, including famous ones like Zod, tRPC, Hono, Elysia, and many others, as well as writing the [Nammtham](https://nammatham.thaitype.dev/) (Azure Functions Framework). This process has helped me distill commonly used patterns. \n\nThe type-safe design patterns is not suitable for every project. It is intended for projects that require high code quality and design. Make sure to evaluate whether these patterns are suitable for your project before using them.\n\n## Contributing\nIf you have any suggestions or feedback, please feel free to open an issue or submit a pull request on [GitHub](https://github.com/mildronize/type-safe-design-pattern)\n\n## License\nThis book is licensed under the [CC BY-NC-ND 4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmildronize%2Ftype-safe-design-pattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmildronize%2Ftype-safe-design-pattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmildronize%2Ftype-safe-design-pattern/lists"}