{"id":22733210,"url":"https://github.com/fantasywind/chainable-validator","last_synced_at":"2025-03-30T01:44:56.243Z","repository":{"id":57196695,"uuid":"60252439","full_name":"fantasywind/chainable-validator","owner":"fantasywind","description":"Chainable Object Types Validator","archived":false,"fork":false,"pushed_at":"2016-06-04T06:40:07.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T04:09:38.807Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/fantasywind.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-06-02T09:51:16.000Z","updated_at":"2016-06-02T14:28:20.000Z","dependencies_parsed_at":"2022-09-01T23:41:45.078Z","dependency_job_id":null,"html_url":"https://github.com/fantasywind/chainable-validator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasywind%2Fchainable-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasywind%2Fchainable-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasywind%2Fchainable-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasywind%2Fchainable-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fantasywind","download_url":"https://codeload.github.com/fantasywind/chainable-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246266251,"owners_count":20749754,"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-12-10T20:13:17.017Z","updated_at":"2025-03-30T01:44:56.229Z","avatar_url":"https://github.com/fantasywind.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chain-validator\nChainable Object Types Validator\n\n## Usage\n\n```javascript\n// ES6\nimport ChainableValidator, {\n  Types as T,\n} from 'chainable-validator';\n\nconst validator = new ChainableValidator({\n  name: T.string.maxLen(10).minLen(4).isRequired,\n  age: T.integer.len(2).isRequired,\n  birthday: T.date,\n  callback: T.function,\n  info: T.object,\n  liked: T.array,\n  test: T.regex,\n  brand: T.symbol,\n  latitude: T.float.decimal(5).greedy,\n  longitude: T.double.decimal(5), // alias of float\n});\n\nconst data = {\n  name: 'Chia Yu Pai',\n  age: 26,\n  birthday: new Date('1990/02/08'),\n  info: {\n    bio: 'hello world',\n  },\n  liked: [\n    'apple',\n    'linux',\n  ],\n  test: /t/i,\n  brand: Symbol('Apple Inc.'),\n  latitude: '22.19009',\n  longitude: 122.457\n};\n\nvalidator.on('error', (err) =\u003e {\n  // invalid rule triggered\n});\n\nif (validator.validate(data)) {\n  // Pass\n} else {\n  // Invalid\n}\n```\n\n## To-Do\n\n* shape check\n* unit test case\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffantasywind%2Fchainable-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffantasywind%2Fchainable-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffantasywind%2Fchainable-validator/lists"}