{"id":40604151,"url":"https://github.com/stetsd/univalid-strategy-default","last_synced_at":"2026-01-21T04:38:40.140Z","repository":{"id":57386520,"uuid":"123386960","full_name":"stetsd/univalid-strategy-default","owner":"stetsd","description":"Default strategy implementation for univalid module (extends 'univalid-strategy')","archived":false,"fork":false,"pushed_at":"2018-07-04T03:40:51.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-16T09:44:31.852Z","etag":null,"topics":["univalid","univalid-strategy","univalid-strategy-default","validation"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/stetsd.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":"2018-03-01T05:32:55.000Z","updated_at":"2018-07-04T03:40:52.000Z","dependencies_parsed_at":"2022-09-26T16:31:19.784Z","dependency_job_id":null,"html_url":"https://github.com/stetsd/univalid-strategy-default","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stetsd/univalid-strategy-default","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetsd%2Funivalid-strategy-default","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetsd%2Funivalid-strategy-default/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetsd%2Funivalid-strategy-default/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetsd%2Funivalid-strategy-default/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stetsd","download_url":"https://codeload.github.com/stetsd/univalid-strategy-default/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stetsd%2Funivalid-strategy-default/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28626553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T02:47:06.670Z","status":"ssl_error","status_checked_at":"2026-01-21T02:45:44.886Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["univalid","univalid-strategy","univalid-strategy-default","validation"],"created_at":"2026-01-21T04:37:58.318Z","updated_at":"2026-01-21T04:38:37.182Z","avatar_url":"https://github.com/stetsd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# univalid-strategy-default\n\nDefault strategy for [univalid](https://github.com/StetsD/univalid) module.\n\nExtends [univalid-strategy](https://github.com/StetsD/univalid-strategy) class\n\n\n## Install\n\n```sh\nnpm i univalid-strategy-default\n```\n\n\n## Usage\n\n```js\nconst UnivalidStrategyDefault = require('univalid-strategy-default');\nconst usd = new UnivalidStrategyDefault();\n```\n\n\n## API\n\n\n### applyFilter(filter, val)\n\nTests the pattern matching of symbols (by event)\n\n**filter** - Type `string`\n\nIn current moment available patterns:\n* oL - only latin symbols\n* oC - only cyrillic symbols\n* oN - only numbers\n* oP - only numbers and latin symbols\n\n**val** - Type `string`\n\n\n### check(pack, core)\n\nValidating the pack\n\n**pack** - Type `object`\n\nStructure of pack must be strict. Like that:\n\nname, val, type - required fields\n```js\n//name, val, type - required fields\n\n[\n    {\n        name: 'username',\n        val: 'Uriy',\n        type: 'required',\n        filter: 'oL',\n        msg: {\n            empty: 'You shall not pass',\n            invalid: 'Validation error',\n            filter: 'Filter error',\n            success: 'All right'\n        }\n    },\n    {\n        name: 'email',\n        val: 'Uriy@mzf.com',\n        type: 'email',\n        filter: /[a-z]|\\s/gi,\n        msg: {\n            empty: 'You shall not pass',\n            invalid: 'Bad email',\n            filter: 'Only lat/numbers/specials symbols',\n            success: 'All right'\n        }\n    },\n]\n```\n\n**core** - Type `object`\n\nThe instance of 'univalid' module\n\n\n\n### getValidationHandlers()\n\nGet validation handlers.\n\nBy default defined in [univalid-strategy](https://github.com/StetsD/univalid-strategy) abstract class\n\n\n### set(option, val)\n\nSet the option in instance\n\n**option** - Type `string`\n\n```js\nusd.set('passConfig', {min: 10, analysis: ['hasLowercase', 'hasDigits', 'hasSpecials']});\n```\n\n\n## OPTIONS\n\n\n### passConfig\n\nPassword config\n\n**By default**\n\n{min: 6, analysis: ['hasUppercase', 'hasLowercase', 'hasDigits', 'hasSpecials']}\n\n```js\nconst usd = new UnivalidStrategyDefault({\n    passConfig: {min: 10, analysis: ['hasLowercase', 'hasDigits', 'hasSpecials']}\n});\n```\n\n## License\nISC©\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstetsd%2Funivalid-strategy-default","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstetsd%2Funivalid-strategy-default","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstetsd%2Funivalid-strategy-default/lists"}