Skip to content

Commit

Permalink
refactor: regex
Browse files Browse the repository at this point in the history
  • Loading branch information
jukbot committed Sep 21, 2023
1 parent fec1860 commit 5c6290b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ bash <(curl -Ls https://coverage.codacy.com/get.sh)

Supports all major browsers and IE11+

| [<img src="https://cdn.rawgit.com/alrra/browser-logos/f50d4cc8/src/edge/edge.png" alt="IE / Edge" width="64px" height="64px"/>](http://caniuse.com/#feat=fetch)</br>IE / Edge | [<img src="https://cdn.rawgit.com/alrra/browser-logos/f50d4cc8/src/firefox/firefox.png" alt="Firefox" width="64px" height="64px" />](http://caniuse.com/#feat=fetch)</br>Firefox | [<img src="https://cdn.rawgit.com/alrra/browser-logos/f50d4cc8/src/chrome/chrome.png" alt="Chrome" width="64px" height="64px" />](http://caniuse.com/#feat=fetch)</br>Chrome | [<img src="https://cdn.rawgit.com/alrra/browser-logos/f50d4cc8/src/safari/safari.png" alt="Safari" width="64px" height="64px" />](http://caniuse.com/#feat=fetch)</br>Safari | [<img src="https://cdn.rawgit.com/alrra/browser-logos/f50d4cc8/src/opera/opera.png" alt="Opera" width="64px" height="64px" />](http://caniuse.com/#feat=fetch)</br>Opera |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| 11+ | 44+ | 45+ | 11+ | 32+ |
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge.png" alt="Edge" width="64px" height="64px"/>](http://caniuse.com/#feat=fetch)</br>Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox.png" alt="Firefox" width="64px" height="64px" />](http://caniuse.com/#feat=fetch)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome.png" alt="Chrome" width="64px" height="64px" />](http://caniuse.com/#feat=fetch)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari.png" alt="Safari" width="64px" height="64px" />](http://caniuse.com/#feat=fetch)</br>Safari | [<img src="https://cdn.jsdelivr.net/alrra/browser-logos/f50d4cc8/src/opera/opera.png" alt="Opera" width="64px" height="64px" />](http://caniuse.com/#feat=fetch)</br>Opera |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| | + | 45+ | 11+ | 32+ |

## Issues

Expand Down
2 changes: 1 addition & 1 deletion dist/validator.min.js.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function c(t) {
if (!/^[0-9]{13}$/.test(t))
if (!/^\d{13}$/.test(t))
return !1;
let u = 0;
for (let e = 0; e < 12; e++)
Expand Down
2 changes: 1 addition & 1 deletion dist/validator.min.js.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
function isValidThaiID(id) {
// Check if the ID is a valid string of 13 digits.
if (!/^[0-9]{13}$/.test(id)) {
if (!/^\d{13}$/.test(id)) {
return false;
}

Expand Down

0 comments on commit 5c6290b

Please sign in to comment.