├── .eslintrc ├── .github └── workflows │ ├── deploy.yml │ └── verify.yml ├── .gitignore ├── .husky ├── .gitignore └── pre-commit ├── .prettierrc ├── CHANGELOG.md ├── LICENSE ├── README.md ├── build.config.ts ├── misc ├── code-examples │ └── react.md └── intro.jpg ├── package.json ├── playground ├── index.html ├── main.ts └── vite.config.ts ├── renovate.json ├── src ├── facile-validator.ts ├── index.ts ├── locales │ ├── cs.ts │ ├── de.ts │ ├── en.ts │ ├── fa.ts │ ├── fr.ts │ ├── index.ts │ ├── it.ts │ ├── nl.ts │ └── zh.ts ├── modules │ ├── events.ts │ ├── language.ts │ ├── rule-adapter.ts │ ├── rule-error.ts │ └── validator-error.ts ├── rules │ ├── accepted.ts │ ├── alpha-num-dash.ts │ ├── alpha-num.ts │ ├── alpha.ts │ ├── between.ts │ ├── digits.ts │ ├── email.ts │ ├── ends-with.ts │ ├── index.ts │ ├── int.ts │ ├── max.ts │ ├── min.ts │ ├── num-dash.ts │ ├── number.ts │ ├── regex.ts │ ├── required-if.ts │ ├── required.ts │ ├── size.ts │ ├── starts-with.ts │ └── within.ts ├── types │ ├── elements.ts │ ├── error-dev.ts │ ├── index.ts │ └── rules.ts └── utils │ ├── helpers.ts │ └── regex.ts ├── tests ├── rules │ ├── accepted.test.ts │ ├── alpha-num-dash.test.ts │ ├── alpha-num.test.ts │ ├── alpha.test.ts │ ├── between.test.ts │ ├── digits.test.ts │ ├── email.test.ts │ ├── ends-with.test.ts │ ├── int.test.ts │ ├── max.test.ts │ ├── min.test.ts │ ├── num-dash.test.ts │ ├── number.test.ts │ ├── regex.test.ts │ ├── required.test.ts │ ├── size.test.ts │ ├── starts-with.test.ts │ └── within.test.ts └── utils │ ├── process-args.test.ts │ ├── process-rule.test.ts │ └── to-camel-case.test.ts ├── tsconfig.json ├── vitest.config.ts └── yarn.lock /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "browser": true, 5 | "es2021": true 6 | }, 7 | "parser": "@typescript-eslint/parser", 8 | "parserOptions": { 9 | "ecmaVersion": 12, 10 | "sourceType": "module" 11 | }, 12 | "plugins": ["@typescript-eslint"], 13 | "extends": [ 14 | "eslint:recommended", 15 | "plugin:prettier/recommended", 16 | "plugin:@typescript-eslint/recommended" 17 | ], 18 | "rules": {} 19 | } -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Build and Deploy 2 | on: 3 | push: 4 | branches: 5 | - main 6 | jobs: 7 | build-and-deploy: 8 | concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout 🛎️ 12 | uses: actions/checkout@v4 13 | 14 | - name: Install dependencies 15 | run: yarn 16 | 17 | - name: Generate Demo 18 | run: yarn deploy 19 | 20 | - name: Deploy 🚀 21 | uses: JamesIves/github-pages-deploy-action@v4.7.3 22 | with: 23 | branch: gh-pages # The branch the action should deploy to. 24 | folder: playground/dist # The folder the action should deploy. 25 | -------------------------------------------------------------------------------- /.github/workflows/verify.yml: -------------------------------------------------------------------------------- 1 | name: verify 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | verify: 13 | runs-on: ${{ matrix.os }} 14 | 15 | strategy: 16 | matrix: 17 | os: [ubuntu-latest, windows-latest] 18 | node: [18, 20] 19 | 20 | steps: 21 | - uses: actions/setup-node@v4 22 | with: 23 | node-version: ${{ matrix.node }} 24 | 25 | - name: checkout 26 | uses: actions/checkout@master 27 | 28 | - name: Install dependencies 29 | run: yarn 30 | 31 | - name: Lint 32 | run: yarn lint 33 | 34 | - name: Test 35 | run: yarn test 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | coverage 12 | dist 13 | dist-ssr 14 | *.local 15 | 16 | # Editor directories and files 17 | .vscode/* 18 | !.vscode/extensions.json 19 | .idea 20 | .DS_Store 21 | *.suo 22 | *.ntvs* 23 | *.njsproj 24 | *.sln 25 | *.sw? 26 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "singleQuote": true, 4 | "semi": true, 5 | "endOfLine": "auto" 6 | } 7 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | ### [1.12.3](https://github.com/upjs/facile-validator/compare/v1.12.2...v1.12.3) (2023-11-28) 6 | 7 | ### [1.12.2](https://github.com/upjs/facile-validator/compare/v1.12.1...v1.12.2) (2023-11-28) 8 | 9 | ### [1.12.1](https://github.com/upjs/facile-validator/compare/v1.12.0...v1.12.1) (2023-11-28) 10 | 11 | ## [1.12.0](https://github.com/upjs/facile-validator/compare/v1.11.9...v1.12.0) (2023-11-28) 12 | 13 | ### Features 14 | 15 | - add possibility to use functions for custom error message ([025b42e](https://github.com/upjs/facile-validator/commit/025b42e30b8fbc4f201bf96e4a7c99516b63c0e5)) 16 | 17 | ### [1.11.9](https://github.com/upjs/facile-validator/compare/v1.11.8...v1.11.9) (2023-10-14) 18 | 19 | ### [1.11.8](https://github.com/upjs/facile-validator/compare/v1.11.7...v1.11.8) (2023-10-14) 20 | 21 | ### [1.11.7](https://github.com/upjs/facile-validator/compare/v1.11.6...v1.11.7) (2023-10-14) 22 | 23 | ### [1.11.6](https://github.com/upjs/facile-validator/compare/v1.11.5...v1.11.6) (2023-10-14) 24 | 25 | ### [1.11.5](https://github.com/upjs/facile-validator/compare/v1.11.4...v1.11.5) (2023-10-14) 26 | 27 | ### [1.11.4](https://github.com/upjs/facile-validator/compare/v1.11.3...v1.11.4) (2023-10-14) 28 | 29 | ### [1.11.3](https://github.com/upjs/facile-validator/compare/v1.11.2...v1.11.3) (2023-09-30) 30 | 31 | ### [1.11.2](https://github.com/upjs/facile-validator/compare/v1.11.1...v1.11.2) (2023-09-30) 32 | 33 | ### [1.11.1](https://github.com/upjs/facile-validator/compare/v1.11.0...v1.11.1) (2023-09-30) 34 | 35 | ## [1.11.0](https://github.com/upjs/facile-validator/compare/v1.10.0...v1.11.0) (2023-09-30) 36 | 37 | ### Features 38 | 39 | - add CS and NL languages ([bf88c1c](https://github.com/upjs/facile-validator/commit/bf88c1c01cbf3b34b02dc7ee25e52550e68df38e)) 40 | 41 | ## [1.10.0](https://github.com/upjs/facile-validator/compare/v1.9.0...v1.10.0) (2022-08-20) 42 | 43 | ### Features 44 | 45 | - add nl language ([18746ee](https://github.com/upjs/facile-validator/commit/18746eee9b1b907af8edd41edca9868793ad047c)) 46 | 47 | ## [1.9.0](https://github.com/upjs/facile-validator/compare/v1.8.0...v1.9.0) (2022-08-17) 48 | 49 | ### Features 50 | 51 | - add cs lang ([f171b46](https://github.com/upjs/facile-validator/commit/f171b4610de4d61c9952a3d79c6de7bd2e194a95)) 52 | 53 | ## [1.8.0](https://github.com/upjs/facile-validator/compare/v1.7.0...v1.8.0) (2022-08-11) 54 | 55 | ### Features 56 | 57 | - Add new locales. ([c60add0](https://github.com/upjs/facile-validator/commit/c60add0c22cacba4228a72129f093e6d5d6e913e)) 58 | 59 | ## [1.7.0](https://github.com/upjs/facile-validator/compare/v1.6.0...v1.7.0) (2022-08-09) 60 | 61 | ### Features 62 | 63 | - change language on runtime ([ee25529](https://github.com/upjs/facile-validator/commit/ee2552948e895ffe015e48522a44b9203cbd1997)) 64 | 65 | ## [1.6.0](https://github.com/upjs/facile-validator/compare/v1.4.0...v1.6.0) (2022-08-09) 66 | 67 | ### Features 68 | 69 | - add support for textarea validation ([76482eb](https://github.com/upjs/facile-validator/commit/76482eb8fe4dab0372b27a82f6765277eaec93fb)) 70 | 71 | ### Bug Fixes 72 | 73 | - use `unknown` instead of `any` ([41baeb5](https://github.com/upjs/facile-validator/commit/41baeb505a32c3b09b02c133080a5bdc8fa71b97)) 74 | 75 | ## [1.5.0](https://github.com/upjs/facile-validator/compare/v1.4.0...v1.5.0) (2022-08-09) 76 | 77 | ### Features 78 | 79 | - add support for textarea validation ([76482eb](https://github.com/upjs/facile-validator/commit/76482eb8fe4dab0372b27a82f6765277eaec93fb)) 80 | 81 | ### Bug Fixes 82 | 83 | - use `unknown` instead of `any` ([41baeb5](https://github.com/upjs/facile-validator/commit/41baeb505a32c3b09b02c133080a5bdc8fa71b97)) 84 | 85 | ## [1.4.0](https://github.com/upjs/facile-validator/compare/v1.2.0...v1.4.0) (2022-07-31) 86 | 87 | ### Features 88 | 89 | - add support for validate per field ([3f508ff](https://github.com/upjs/facile-validator/commit/3f508ff2ce29475f23951051bf11aa284253facf)) 90 | - before release refactor ([7a9ef8a](https://github.com/upjs/facile-validator/commit/7a9ef8a7f0163053b108c5d6070f7229b04043f0)) 91 | - fix events trigger order ([c5536ab](https://github.com/upjs/facile-validator/commit/c5536abe999b1e6b33bf046a1d44e92745445b86)) 92 | - refactor project ([7bad2f5](https://github.com/upjs/facile-validator/commit/7bad2f5e9c4da35251f55d5b3eaa07ec75f26eb0)) 93 | - rename function ([a65c223](https://github.com/upjs/facile-validator/commit/a65c223a8e1758e16f72bd34eac2d545eb26a923)) 94 | - update renovate configs ([618a80b](https://github.com/upjs/facile-validator/commit/618a80bb4dcea9b41c9759c06dccea8b254c00dd)) 95 | - update version ([38ba534](https://github.com/upjs/facile-validator/commit/38ba5341a2346dda756fc9c4c758769273302edf)) 96 | - use name `container` for parent element ([570d6ff](https://github.com/upjs/facile-validator/commit/570d6ff475d85e78973b1bcdfb5171f7bce3d2cc)) 97 | 98 | ## [1.2.0](https://github.com/upjs/facile-validator/compare/v1.1.1...v1.2.0) (2022-05-26) 99 | 100 | ### Features 101 | 102 | - add lang for regex rule ([c6e2183](https://github.com/upjs/facile-validator/commit/c6e2183e17611ace4e7d9f5dbeae37369da8626d)) 103 | 104 | ### [1.1.1](https://github.com/upjs/facile-validator/compare/v1.1.0...v1.1.1) (2022-05-26) 105 | 106 | ## [1.1.0](https://github.com/upjs/facile-validator/compare/v1.0.0...v1.1.0) (2022-05-25) 107 | 108 | ### Features 109 | 110 | - add support for `regex` rule ([0390a52](https://github.com/upjs/facile-validator/commit/0390a52ca7bfa79dfc3993d148abec79abe0b71a)) 111 | - add UnoCSS to playground ([44769b9](https://github.com/upjs/facile-validator/commit/44769b997b12348fb73bab9a8bff301fc4c1afaf)) 112 | - add validator test ([c56495f](https://github.com/upjs/facile-validator/commit/c56495f9fb17964b4efb1f3f813c96d5244adc5b)) 113 | - enahnce x-rules feature ([8a40071](https://github.com/upjs/facile-validator/commit/8a400713121c9a9cb04cb41deb7fe4d373a82d53)) 114 | - improve `regex-rule` rule ([68f2990](https://github.com/upjs/facile-validator/commit/68f2990466174913ceabadb1ff3e63c17529293b)) 115 | 116 | ## [1.0.0](https://github.com/upjs/facile-validator/compare/v0.2.0...v1.0.0) (2022-04-07) 117 | 118 | ### Features 119 | 120 | - add `nullable` to readme.md ([c789615](https://github.com/upjs/facile-validator/commit/c789615c00038e2630145265ee7199534fa08676)) 121 | - add intro image ([79299e1](https://github.com/upjs/facile-validator/commit/79299e1ababd2cf798e181cb47dad5df328778cf)) 122 | - add nullable rule ([843926e](https://github.com/upjs/facile-validator/commit/843926e1f60e7f7ea87e079eed107c330223ba4a)) 123 | 124 | ### Bug Fixes 125 | 126 | - `nullable` now is a virtual rule ([1efa241](https://github.com/upjs/facile-validator/commit/1efa24137dd7b187c09d558deea8cad2333657ab)) 127 | - emit errors on build ([a29ff55](https://github.com/upjs/facile-validator/commit/a29ff5596aee192711a259beb5ba1ecaca375f8e)) 128 | - fix `nullable` behavior ([7a1d2a2](https://github.com/upjs/facile-validator/commit/7a1d2a2285ffe4772649f9b9220c3a0a5653b8fe)) 129 | - fix readme ([d7a84d3](https://github.com/upjs/facile-validator/commit/d7a84d3e6ad0a6da224209224387fa820443d89e)) 130 | - fix readme ([631e147](https://github.com/upjs/facile-validator/commit/631e1470e7ef788d493b6dcd8ec5a160c4041e54)) 131 | - fix typos in the readme ([c8ec46b](https://github.com/upjs/facile-validator/commit/c8ec46b6c6c3f44d1994106dd6ee1c6563b18e4e)) 132 | - ignore non-required and empty inputs ([c75ed73](https://github.com/upjs/facile-validator/commit/c75ed736eeb6231e89afd2018e1e78de52ed1ff3)) 133 | - remove `throwErrorWhen` helper function ([7d9b7a6](https://github.com/upjs/facile-validator/commit/7d9b7a6dca013dbc5e420219424f891bad07410c)) 134 | - remove unused functions ([d9ab937](https://github.com/upjs/facile-validator/commit/d9ab9373deb3e27f600ee1562efc1924d2c1f51b)) 135 | - replace intro image ([b6b6389](https://github.com/upjs/facile-validator/commit/b6b6389999791d63e77cb26a948ac1db70542d2f)) 136 | - undo code for non-required empty inputs ([a56eb6d](https://github.com/upjs/facile-validator/commit/a56eb6dfcd8991d045d589832d3698116cb064dc)) 137 | - undo code for non-required empty inputs ([60eb9c0](https://github.com/upjs/facile-validator/commit/60eb9c090540d9f1f4a11b128379b6ca568e16d0)) 138 | 139 | ## [0.2.0](https://github.com/upjs/facile-validator/compare/v0.1.2...v0.2.0) (2022-03-13) 140 | 141 | ### ⚠ BREAKING CHANGES 142 | 143 | - By this commit, an `HTMLElement` should be passed to the validator instead of a string 144 | 145 | ### Features 146 | 147 | - allow `HTMLElement` to be passed to the Validator ([c89b844](https://github.com/upjs/facile-validator/commit/c89b8443c94fc3158c8c19e9184f1234f09c5f7f)) 148 | - improve `within` to support array ([3168b46](https://github.com/upjs/facile-validator/commit/3168b462bdce3315267b5c5730ed847486175d30)) 149 | 150 | ### Bug Fixes 151 | 152 | - fix conflicts ([62ee440](https://github.com/upjs/facile-validator/commit/62ee44098255dcf1fd46b6d7779899643ca53246)) 153 | - fix conflicts ([d20892b](https://github.com/upjs/facile-validator/commit/d20892b9d3be906fac42573167694c3c362519a0)) 154 | - fix email rule ([61ec63a](https://github.com/upjs/facile-validator/commit/61ec63a4aa6fafe5b24e1bd1c2fc1e68fdde813d)) 155 | - fix optional events ([a34e2fe](https://github.com/upjs/facile-validator/commit/a34e2feb8f664e36026953721149716841c895f2)) 156 | - make `Events` fields optional ([062f9d1](https://github.com/upjs/facile-validator/commit/062f9d1ac3c3a87d5d02266a93e16329b606aa83)) 157 | - revert rules for national code ([dac6b55](https://github.com/upjs/facile-validator/commit/dac6b5564693a27ca5a957cc61e33be776ebc30e)) 158 | - use `HTMLElement` interface insteadof `HTMLInputElement` ([d6a23c2](https://github.com/upjs/facile-validator/commit/d6a23c27d5c81df41483f48c69e40d4b2e124929)) 159 | 160 | ### [0.1.2](https://github.com/upjs/facile-validator/compare/v0.1.1...v0.1.2) (2022-03-07) 161 | 162 | ### Bug Fixes 163 | 164 | - fix package entry ([a882e39](https://github.com/upjs/facile-validator/commit/a882e3943d922c8aef2a9531f990d441667674ce)) 165 | 166 | ### [0.1.1](https://github.com/upjs/facile-validator/compare/v0.1.0...v0.1.1) (2022-03-05) 167 | 168 | ## 0.1.0 (2022-03-05) 169 | 170 | ### ⚠ BREAKING CHANGES 171 | 172 | - use `data-rules` instead of `v-rules` 173 | 174 | ### Features 175 | 176 | - add `accepted` rule ([165ad31](https://github.com/upjs/facile-validator/commit/165ad311400c4c267c0394929a51e9499818ea9a)) 177 | - add `alpha-num-dash` rule ([e475ef5](https://github.com/upjs/facile-validator/commit/e475ef5fdcc3dd591b72eef09eaba598620dcfa7)) 178 | - add `alpha-num` and `num-dash` rules ([f3f1cb3](https://github.com/upjs/facile-validator/commit/f3f1cb3b58e867aff4eb33a4e6a27cda3b5be5eb)) 179 | - add `alpha` rule ([857b1a0](https://github.com/upjs/facile-validator/commit/857b1a00d4af8660a8430c33f55211650fcf637e)) 180 | - add `alpha` rule ([58fdb6b](https://github.com/upjs/facile-validator/commit/58fdb6b6746b429b86e8d6b3407e1cf3b9db60ac)) 181 | - add `createLang` function to support ts in custom langs ([f896802](https://github.com/upjs/facile-validator/commit/f89680274a4159d8552f5b2bb390af601128d421)) 182 | - add `createLang` function to support ts in custom langs ([11bacdb](https://github.com/upjs/facile-validator/commit/11bacdb78e688ff87950ce04c67353020e61125b)) 183 | - add `digits` rule ([4421af3](https://github.com/upjs/facile-validator/commit/4421af3a843b999c8cfa17dba0600dc0af88ebb6)) 184 | - add `endsWith` rule ([7fb1ecc](https://github.com/upjs/facile-validator/commit/7fb1ecc540f462d84da1d16449f0f5e9f0de1f2a)) 185 | - add `events` support ([5056dfc](https://github.com/upjs/facile-validator/commit/5056dfc0f90d599c792c9762dc35e78ee330ee66)) 186 | - add `gt` rule ([15b4ec6](https://github.com/upjs/facile-validator/commit/15b4ec6c49ae49d5e3a6cd8036e90f4b87c398ed)) 187 | - add `gte` rule ([dd96349](https://github.com/upjs/facile-validator/commit/dd9634923cdac34257d8d587aefdc492666b1135)) 188 | - add `integer` alias for int ([e630e8e](https://github.com/upjs/facile-validator/commit/e630e8e4baaf4caac43a6f59fdbf98971c0b94b6)) 189 | - add `Lang` type ([f7bb99e](https://github.com/upjs/facile-validator/commit/f7bb99e642c4b1cc04002c176a83c4eb97eba2be)) 190 | - add `length` rule ([8384bb2](https://github.com/upjs/facile-validator/commit/8384bb226b665b8a34fddf54eb9aa0e2021d3aee)) 191 | - add `lt` rule ([6ce701a](https://github.com/upjs/facile-validator/commit/6ce701acb30bf312defbc6159eac64e5811d5448)) 192 | - add `lte` rule ([2b21cf6](https://github.com/upjs/facile-validator/commit/2b21cf60f63591294c018d575f186bc36d4d1ff9)) 193 | - add `maxlen` & `minlen` & `len` alias ([8da8ac5](https://github.com/upjs/facile-validator/commit/8da8ac535ddb67a0a9c663c53274502608ad97fe)) 194 | - add `required-if` rule (without test) ([7497e71](https://github.com/upjs/facile-validator/commit/7497e71f75e6118de1a61b272c2c731f4b03d4e3)) 195 | - add `REQUIRED` RuleError to `between` rule ([284167d](https://github.com/upjs/facile-validator/commit/284167d0c32e86b0821febc9cc91e08d38e5762c)) 196 | - add `startsWith` rule ([1300995](https://github.com/upjs/facile-validator/commit/1300995365c8f7d2cc12f276718aac66086c09a4)) 197 | - add `validate:failed` event ([8d08aba](https://github.com/upjs/facile-validator/commit/8d08abaf21ee1d1ae1f55c9582f48055bf8aca27)) 198 | - add `within` rule ([b3eddaf](https://github.com/upjs/facile-validator/commit/b3eddaf984f314f04075768d7917ef189281ac49)) 199 | - add two `min` & `max` alias ([830eef6](https://github.com/upjs/facile-validator/commit/830eef619331d94be2043e816853241b69512c06)) 200 | - pass form as first argument of events ([cce6275](https://github.com/upjs/facile-validator/commit/cce6275b7ccb443f98c23cf9ac31d7659b23d4af)) 201 | - pass status to `validate:end` hook ([9f87f4c](https://github.com/upjs/facile-validator/commit/9f87f4ce916077386d07e35d55e680960f8d18dd)) 202 | - replace `throwErrorWhen` with `when` ([a18be2c](https://github.com/upjs/facile-validator/commit/a18be2c7323340f4d07c49b4c2c32eea58d095ad)) 203 | - support `async` validation ([b4ad388](https://github.com/upjs/facile-validator/commit/b4ad388a1aeb101418a40bb82b9f8d9235d06966)) 204 | - support `defaultOption` ([26611e7](https://github.com/upjs/facile-validator/commit/26611e74106adc8d718aca7013fd56e5a0c14340)) 205 | - support `events` with options ([2579900](https://github.com/upjs/facile-validator/commit/2579900676213a48c940a5e969d6b4489223aa25)) 206 | - support dependency in rules ([db8e620](https://github.com/upjs/facile-validator/commit/db8e62045cd9a16fa020709613f6a36e46198584)) 207 | - support for optional language ([f793c69](https://github.com/upjs/facile-validator/commit/f793c696b2ad39fc818fcc60196d9d89017fdc12)) 208 | - support for optional language ([f7d320e](https://github.com/upjs/facile-validator/commit/f7d320e3c533a6b909285074e1cea5b832109f5b)) 209 | - support multiple naming for rules ([bcac47a](https://github.com/upjs/facile-validator/commit/bcac47a540040a9f6393fe0b58b4f37976362187)) 210 | 211 | ### Bug Fixes 212 | 213 | - `throw error` must stop validating ([8e532f4](https://github.com/upjs/facile-validator/commit/8e532f4f015ecc85f567d84fe05b789f39f934eb)) 214 | - add more check on between argument ([6f501db](https://github.com/upjs/facile-validator/commit/6f501dbf3fef6ac0679318efb4122f96022dcbc9)) 215 | - add more tests for `alpha-num-dash` ([6369897](https://github.com/upjs/facile-validator/commit/6369897c61e8052499d5c760e0f61e1bcd9f4b89)) 216 | - edit error message ([92afda0](https://github.com/upjs/facile-validator/commit/92afda08e41ca72fcde913ed6f7b83eab6209e4b)) 217 | - edit incorrect texts ([c21f2f3](https://github.com/upjs/facile-validator/commit/c21f2f30a738afab6afc1e5d9a50f8aba868d47a)) 218 | - edit incorrect texts ([b14b2e7](https://github.com/upjs/facile-validator/commit/b14b2e7ee7d1874c37d68fd117d3fb7192b3dbd2)) 219 | - fix `max` rule bug ([76602ac](https://github.com/upjs/facile-validator/commit/76602ac523bff33bd8f3f2a51039414786fc5338)) 220 | - fix error orders ([caeb77a](https://github.com/upjs/facile-validator/commit/caeb77ac73634dc051afcc9cf05a0ba2d4667bca)) 221 | - fix incorrect error texts ([0389509](https://github.com/upjs/facile-validator/commit/03895090fd77d262851e66c1aca65a080ed2f4ee)) 222 | - fix lang function ([918a1e8](https://github.com/upjs/facile-validator/commit/918a1e8281094901a4322276493745eb7f6b55c7)) 223 | - fix playground `lang` imports bug ([952f7f7](https://github.com/upjs/facile-validator/commit/952f7f74923d8c3288dad476679758063bd83b13)) 224 | - fix type check for `langs` ([58864a6](https://github.com/upjs/facile-validator/commit/58864a684537d2a71ba3bde0c58956d23dab4983)) 225 | - minor core improvement ([c7455ea](https://github.com/upjs/facile-validator/commit/c7455ea160ef408f1e3368b641faf16ac3a4453c)) 226 | - remove `value` hardcode ([19ab1fa](https://github.com/upjs/facile-validator/commit/19ab1faeee0e3058c8a851c35b93ce7445bd147a)) 227 | - remove unused `REQUIRED_IF` error cause ([a9f8ec9](https://github.com/upjs/facile-validator/commit/a9f8ec942a1ff997c56c47fd9ff052663e625c58)) 228 | - rename `error-dev` constants ([64c1937](https://github.com/upjs/facile-validator/commit/64c193736c39840b5284c54f3674a25027e78f14)) 229 | - rename `Language.ts` ([94686a1](https://github.com/upjs/facile-validator/commit/94686a1cb3d6f136a4719a9db91dfcafd6ca2a90)) 230 | - rename Locale to Language ([fbb1668](https://github.com/upjs/facile-validator/commit/fbb16687500146f7298f6a0eb92fa1c1f836fab8)) 231 | - rename regexes ([90a876c](https://github.com/upjs/facile-validator/commit/90a876cb5280cf8bfd6cd02726762d4d2754b23a)) 232 | - rewrite `gte` to remove `between` dep ([03602dc](https://github.com/upjs/facile-validator/commit/03602dca89d626e3cac46d5ab5487779ffd3d719)) 233 | - rewrite `lte` to remove `between` dep ([436aae6](https://github.com/upjs/facile-validator/commit/436aae6f363f9c5a4e90d762856c5c94b9a4eee0)) 234 | - show right rule name ([dc3379c](https://github.com/upjs/facile-validator/commit/dc3379c781588af8fa8a9e1cc35a3fa6a36d7670)) 235 | - support args index ([8ae632f](https://github.com/upjs/facile-validator/commit/8ae632fd586ce87db9a91ff693fc5fc0a2e18824)) 236 | - support negative values for int ([b187270](https://github.com/upjs/facile-validator/commit/b187270c069466f244d89b22e159cec3140675f0)) 237 | - use `in` instead of `hasOwnProperty` ([8713e20](https://github.com/upjs/facile-validator/commit/8713e20c8849b06151b93cec3c4ef27a9571efda)) 238 | 239 | - rename `v-rules` to `data-rules` ([8917fc0](https://github.com/upjs/facile-validator/commit/8917fc009120e415645c3a5281b215386561636d)) 240 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Ali Nazari 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Facile Validator 2 | 3 | [![npm version][npm-version-src]][npm-version-href] 4 | [![npm downloads][npm-downloads-src]][npm-downloads-href] 5 | [](https://github.com/upjs/facile-validator/actions/workflows/verify.yml) 6 | [![License][license-src]][license-href] 7 | 8 | Robust Frontend Form Validation, inspired by Laravel Validation, Built for Simplicity of Use 😋 9 | 10 |
11 |
12 |