{"id":15836963,"url":"https://github.com/afeiship/next-defaults-validate","last_synced_at":"2026-05-18T15:09:18.050Z","repository":{"id":96088539,"uuid":"125141065","full_name":"afeiship/next-defaults-validate","owner":"afeiship","description":"Get defaults by validate function.","archived":false,"fork":false,"pushed_at":"2024-07-29T05:34:15.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-04T07:31:23.557Z","etag":null,"topics":["defaults","next","validate","validator"],"latest_commit_sha":null,"homepage":"","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/afeiship.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-03-14T02:06:55.000Z","updated_at":"2024-07-29T05:34:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"1c5277df-4d5f-4c32-9f51-792f0775061d","html_url":"https://github.com/afeiship/next-defaults-validate","commit_stats":null,"previous_names":["afeiship/next-defaults-validate"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/afeiship/next-defaults-validate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-defaults-validate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-defaults-validate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-defaults-validate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-defaults-validate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/next-defaults-validate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-defaults-validate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33181877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["defaults","next","validate","validator"],"created_at":"2024-10-05T15:20:19.849Z","updated_at":"2026-05-18T15:09:18.034Z","avatar_url":"https://github.com/afeiship.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# next-defaults-validate\n\u003e Get defaults by validate function.\n\n[![version][version-image]][version-url]\n[![license][license-image]][license-url]\n[![size][size-image]][size-url]\n[![download][download-image]][download-url]\n\n## installation\n```bash\nyarn add @jswork/next-defaults-validate\n```\n\n## usage\n```js\nimport '@jswork/next-defaults-validate';\n\nconst target = {\n  username: 'xiaoming',\n  email: 'abc',\n  other: 'value',\n  nested: {\n    company: {\n      address: null\n    }\n  }\n};\n\nnx.defaultsValidate(target, {\n  username: (value) =\u003e value.length \u003e 3 ? null : 'anonymous',\n  email: (value) =\u003e value.includes('@') ? null : 'example@email.com',\n  'nested.company.address': (value) =\u003e value ? null : 'unknown'\n});\n\n// output: \n/*\n{\n  username: 'xiaoming',\n  email: 'example@email.com',\n  other: 'value',\n  nested: {\n    company: {\n      address: 'unknown'\n    }\n  }\n}\n*/\n```\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/next-defaults-validate/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/next-defaults-validate\n[version-url]: https://npmjs.org/package/@jswork/next-defaults-validate\n\n[license-image]: https://img.shields.io/npm/l/@jswork/next-defaults-validate\n[license-url]: https://github.com/afeiship/next-defaults-validate/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-defaults-validate\n[size-url]: https://github.com/afeiship/next-defaults-validate/blob/master/dist/next-defaults-validate.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/next-defaults-validate\n[download-url]: https://www.npmjs.com/package/@jswork/next-defaults-validate\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-defaults-validate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Fnext-defaults-validate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-defaults-validate/lists"}