{"id":27916741,"url":"https://github.com/harmos274/record-validator","last_synced_at":"2025-05-06T16:39:32.357Z","repository":{"id":57702285,"uuid":"502190935","full_name":"Harmos274/record-validator","owner":"Harmos274","description":"A simple runtime type validator for JS and TS.","archived":false,"fork":false,"pushed_at":"2022-06-13T12:28:39.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-22T23:51:14.698Z","etag":null,"topics":["data-validation","javascript","nodejs","type-validation","typescript","typescript-library","validator"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/record-validator","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Harmos274.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-10T21:57:25.000Z","updated_at":"2022-08-23T07:48:19.000Z","dependencies_parsed_at":"2022-09-26T21:11:00.190Z","dependency_job_id":null,"html_url":"https://github.com/Harmos274/record-validator","commit_stats":null,"previous_names":["harmos274/type-validator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Harmos274%2Frecord-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Harmos274%2Frecord-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Harmos274%2Frecord-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Harmos274%2Frecord-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Harmos274","download_url":"https://codeload.github.com/Harmos274/record-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252721961,"owners_count":21793934,"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":["data-validation","javascript","nodejs","type-validation","typescript","typescript-library","validator"],"created_at":"2025-05-06T16:39:29.489Z","updated_at":"2025-05-06T16:39:32.349Z","avatar_url":"https://github.com/Harmos274.png","language":"TypeScript","readme":"# Record Validator\n\nRecord validator is a NodeJS package that allows you to do a runtime check of a given Record.\n\n## How to use it\n\n```typescript\nimport { TypeValidator } from \"record-validator\"\n\ninterface ISimpleTest {\n  id: number,\n  name: string,\n}\n\n\nconst validator = new TypeValidator\u003cISimpleTest\u003e({\n  id: {\n    required: true,\n    type: \"number\"\n  },\n  name: {\n    required: true,\n    type: \"string\"\n  }\n})\n\nconst value = {\n  id: 12,\n  name: \"toto\"\n}\n\nvalidator.test(value)\n// Returns null on success and a string explaining the error on failure.\n```\n\n**You should check the [unit tests](https://github.com/Harmos274/type-validator/blob/master/tests/unit.test.ts) \nto know more about this package, including how to implement custom validators for your types and nested fields.**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharmos274%2Frecord-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharmos274%2Frecord-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharmos274%2Frecord-validator/lists"}