{"id":16887028,"url":"https://github.com/d-fischer/ts-runtime-check","last_synced_at":"2025-03-20T06:23:42.169Z","repository":{"id":57381173,"uuid":"148544493","full_name":"d-fischer/ts-runtime-check","owner":"d-fischer","description":"Check the types of your external objects with (mostly) just TypeScript types.","archived":false,"fork":false,"pushed_at":"2018-09-14T20:36:15.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T06:33:37.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d-fischer.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":"2018-09-12T21:30:37.000Z","updated_at":"2018-09-14T20:36:16.000Z","dependencies_parsed_at":"2022-09-26T16:50:27.818Z","dependency_job_id":null,"html_url":"https://github.com/d-fischer/ts-runtime-check","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-fischer%2Fts-runtime-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-fischer%2Fts-runtime-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-fischer%2Fts-runtime-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-fischer%2Fts-runtime-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d-fischer","download_url":"https://codeload.github.com/d-fischer/ts-runtime-check/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244561789,"owners_count":20472517,"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-10-13T16:42:28.227Z","updated_at":"2025-03-20T06:23:42.148Z","avatar_url":"https://github.com/d-fischer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Example\n\n```ts\nimport 'reflect-metadata';\nimport { BaseValidator, Check, CheckedObject, Type, Validator } from 'ts-runtime-check';\n\nconst ColorValidator: Validator = (value, options) =\u003e\n\t(typeof value === 'string' \u0026\u0026 /^#(?:[0-9a-f]{3}){1,2}$/i.test(value)) || BaseValidator(value, options);\n\nexport default class User extends CheckedObject\u003cUser\u003e {\n\t@Check() id: number;\n\t@Check() name: string;\n\t@Check(Type.Array.of(ColorValidator)) colors: string[];\n}\n\nconsole.log(User.fromPlainObject({ id: 1, name: 'foo', colors: ['#ff0000'] }));\nconsole.log(User.fromPlainObject({ id: 2, name: 1337 }));  // TypeError\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-fischer%2Fts-runtime-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-fischer%2Fts-runtime-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-fischer%2Fts-runtime-check/lists"}