Skip to content

Commit

Permalink
release 5.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
saqqdy committed Aug 27, 2024
1 parent 2718b60 commit 81e5ee1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change logs

## 2024.08.27 v5.21.2

1. `pattern` support mac/ip4/ip4_pri

## 2024.08.12 v5.21.1

1. `osVersion` support Harmony
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ declare class Client {

Collection of common regular expressions

> v5.21.2 `pattern` support mac/ip4/ip4_pri
- Since: `1.0.1`

- Arguments: `none`
Expand Down Expand Up @@ -288,6 +290,9 @@ declare const pattern: {
array: RegExp
isjson: RegExp
textarea: RegExp
mac: RegExp
ip4: RegExp
ip4_pri: RegExp
}
```
Expand Down Expand Up @@ -1581,7 +1586,7 @@ declare function parseUrlParam(url: string, covert?: boolean): Record<string, un

Splice URL parameters (single layer only)

> v5.20.0 Breaking change: remove encodeURIComponent
> v5.20.0 Breaking change: remove encodeURIComponent</br>
> v5.21.0 Breaking change: covert support boolean & SpliceUrlParamOptions

- Since: `5.3.0`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "js-cool",
"description": "Collection of common JavaScript / TypeScript utilities",
"version": "5.21.1",
"version": "5.21.2",
"packageManager": "pnpm@9.1.3",
"main": "dist/index.cjs.js",
"module": "dist/index.esm-bundler.js",
Expand Down
6 changes: 5 additions & 1 deletion src/pattern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ const pattern = {
array: /^\[[\s\S]*\]$/,
isjson: /[\s\S]*(\{[\s\S]*\})[\s\S]*/,
textarea:
/[\u4E00-\u9FA5_a-zA-Z0-9\,\.\/\?\;\:\'\"\[\]\-\*\(\)\(\)\%\$\@\\\!\,\《\》\。\、\?\;\:\‘\’\“\”\…\¥\!]/
/[\u4E00-\u9FA5_a-zA-Z0-9\,\.\/\?\;\:\'\"\[\]\-\*\(\)\(\)\%\$\@\\\!\,\《\》\。\、\?\;\:\‘\’\“\”\…\¥\!]/,
mac: /^((([a-f0-9]{2}:){5})|(([a-f0-9]{2}-){5}))[a-f0-9]{2}$/i,
ip4: /^(([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5]).){3}([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])$/,
ip4_pri:
/^1(((0|27)(.(([1-9]?|1[0-9])[0-9]|2([0-4][0-9]|5[0-5])))|(72.(1[6-9]|2[0-9]|3[01])|92.168))(.(([1-9]?|1[0-9])[0-9]|2([0-4][0-9]|5[0-5]))){2})$/
}

export default pattern

0 comments on commit 81e5ee1

Please sign in to comment.