{"id":15893729,"url":"https://github.com/chinanf-boy/validate-switch","last_synced_at":"2025-04-02T18:15:56.986Z","repository":{"id":57390259,"uuid":"131674822","full_name":"chinanf-boy/Validate-switch","owner":"chinanf-boy","description":"全局验证开关 global Validate data Switch , a thing","archived":false,"fork":false,"pushed_at":"2018-05-27T14:41:37.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T09:40:33.271Z","etag":null,"topics":["global","switch","validata"],"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/chinanf-boy.png","metadata":{"files":{"readme":"readme.en.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-05-01T04:04:39.000Z","updated_at":"2018-05-27T14:41:26.000Z","dependencies_parsed_at":"2022-09-12T19:21:12.206Z","dependency_job_id":null,"html_url":"https://github.com/chinanf-boy/Validate-switch","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2FValidate-switch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2FValidate-switch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2FValidate-switch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2FValidate-switch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinanf-boy","download_url":"https://codeload.github.com/chinanf-boy/Validate-switch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246866100,"owners_count":20846496,"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":["global","switch","validata"],"created_at":"2024-10-06T08:13:02.773Z","updated_at":"2025-04-02T18:15:56.962Z","avatar_url":"https://github.com/chinanf-boy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Validate-switch[![Build Status](https://travis-ci.org/chinanf-boy/validate-switch.svg?branch=master)](https://travis-ci.org/chinanf-boy/validate-switch) [![codecov](https://codecov.io/gh/chinanf-boy/validate-switch/badge.svg?branch=master)](https://codecov.io/gh/chinanf-boy/validate-switch?branch=master)\n\n\u003e Global verification switch\n\n[Chinese](./readme.md)Ɯ[English](./readme.en.md)\n\nAs a command line - the most important and only validation from the user`Uncertain input`\n\nOnce we determine that the value given by the user is`correct`\n\nWell, located in a large cli, underneath`Function function`You can be sure that the parameters given to them are correct\n\nLet's filter out the function-validation section, so sooner sooner?\n\nWhy ????\n\nBecause we can already control 吖\n\n* * *\n\n## Ideas\n\n`Function function` is divided into two operations\n\n1.  As a base for cli`No need to verify data`\n\n2.  Self function - verification project`Need to verify the data`\n\nSay it, that is related`verify the data`- Operation is filtered out, so one`switch`, born\n\nSimple adoption`Validate-switch`\n\n```js\nif(getValidate().state){ // default: true\n  // includes📦\n  // validate data etc ...\n}\n```\n\n\u003e `Validate-switch`Is nothing to do, just global val return\n\u003e\n\u003e The most important thing is that you, who control the change of data, regardless of the success or failure of the process, should be controllable.\n\u003e\n\u003e I think this is the idea that this project wants to transmit\n\n* * *\n\n## Install\n\n    npm install validate-switch\n\n    yarn add validate-switch\n\n## Usage\n\n```js\nconst validateSwitch = require('validate-switch');\n```\n\n## Api\n\n### 1. superstruct\n\nFrom[Https://github.com/ianstormtaylor/superstruct](https://github.com/ianstormtaylor/superstruct)\n\n\u003e A simple and combinable way to validate data in javascript.\n\n### 2. setvalidate(input)\n\n#### Input\n\nType:`Boolean`\n\n### 3. getvalidate : return {state}\n\n#### State\n\nType:`Boolean`\n\n### 4. togglevalidate : return {state}\n\n#### State\n\nType:`Boolean`\n\n* * *\n\n## License\n\nMit ©[Chinanf-boy](http://llever.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fvalidate-switch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinanf-boy%2Fvalidate-switch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fvalidate-switch/lists"}