@archoleat/reglib 1.9.3 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -135,6 +135,15 @@ bun i -D @archoleat/reglib
135
135
  - Description: Matches a nested class selector.
136
136
  - Example: Matches `&.class`, `&.my-class`.
137
137
 
138
+ - EMAIL_REGEX
139
+
140
+ - Pattern: `^[^\s@]+@[^\s@]+\.[^\s@]+$`.
141
+
142
+ - Description: Matches email addresses with basic validation.
143
+
144
+ - Example: Matches `user@example.com`, `test.email@domain.co.uk`,
145
+ but not `invalid@`, `@domain.com`, or `user@domain`.
146
+
138
147
  - FONT_FILE_NAME_REGEX
139
148
 
140
149
  - Pattern: A complex regex for matching font file names.
@@ -145,6 +154,25 @@ bun i -D @archoleat/reglib
145
154
  - Example: Matches `Roboto-Bold.woff2`, `OpenSans-Italic-Variable.ttf`.
146
155
  > More info [validate-font-file-name](https://github.com/archoleat/validate-font-file-name)
147
156
 
157
+ - IS_MOBILE_REGEX
158
+
159
+ - Pattern: `Mobi|iP(hone|od|ad)|Android|BlackBerry`.
160
+
161
+ - Description: Detects mobile devices based on user agent strings.
162
+
163
+ - Example: Matches `iPhone`, `iPad`, `Android`, `BlackBerry`,
164
+ `Mobile Safari`, but not `Windows`, `Macintosh`.
165
+
166
+ - NAME_REGEX
167
+
168
+ - Pattern: `^(?!-)[A-Za-z\u00C0-\u017FА-Яа-яЁё\s\-\u3000\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF\u3400-\u4DBF]+(?<!-)$`.
169
+
170
+ - Description: Matches names with support for Latin, Cyrillic,
171
+ Japanese, and Chinese scripts. Cannot start or end with a hyphen.
172
+
173
+ - Example: Matches `John Doe`, `Jean-Paul`, `Иван Петров`,
174
+ `田中太郎`, but not `-John`, `Name-`, or `123`.
175
+
148
176
  ## Contributing
149
177
 
150
178
  Please read [**CONTRIBUTING**](https://github.com/archoleat/.github/blob/main/CONTRIBUTING.md)
package/index.d.ts CHANGED
@@ -1,8 +1,14 @@
1
+ declare const EMAIL_REGEX: RegExp;
2
+
1
3
  declare const FONT_FILE_NAME_REGEX: RegExp;
2
4
 
3
5
  declare const HYPHEN_REGEX: RegExp;
4
6
  declare const HYPHENS_REGEX: RegExp;
5
7
 
8
+ declare const IS_MOBILE_REGEX: RegExp;
9
+
10
+ declare const NAME_REGEX: RegExp;
11
+
6
12
  declare const ATTRIBUTE_REGEX: string;
7
13
  declare const CLASS_REGEX: string;
8
14
  declare const BLOCK_REGEX = '[a-z][a-z0-9]*(-[a-z0-9]+)*';
@@ -33,10 +39,13 @@ export {
33
39
  CLASS_REGEX,
34
40
  CLASS_SIBLING_REGEX,
35
41
  ELEMENT_REGEX,
42
+ EMAIL_REGEX,
36
43
  FONT_FILE_NAME_REGEX,
37
44
  HYPHENS_REGEX,
38
45
  HYPHEN_REGEX,
46
+ IS_MOBILE_REGEX,
39
47
  MODIFIER_REGEX,
48
+ NAME_REGEX,
40
49
  NESTED_ATTRIBUTE_CHILD_REGEX,
41
50
  NESTED_ATTRIBUTE_REGEX,
42
51
  NESTED_ATTRIBUTE_SIBLING_REGEX,
package/index.js CHANGED
@@ -1 +1 @@
1
- const G="(Italic)",s="(Variable)",o="[A-Z][a-z]",c=`^${o}+(${o}+)?`,I=["Thin","Hairline","ExtraLight","UltraLight","Light","Regular","Medium","SemiBold","DemiBold","Bold","ExtraBold","UltraBold","Black","Heavy","ExtraBlack","UltraBlack"].join("|"),X=["otf","ttf","woff","woff2"].join("|"),L=`(${c})`,A=`(${I})`,N=`(${X})$`,a=[`${L}-${A}`,`(${G}?)(${s}?)`,`\\.${N}`].join(""),B=new RegExp(a),r=/-+/,i=/(^-|-$)/,_="[a-z0-9]",E="[^ ,{}]+",R=String.raw`\[[^\]]+\]`,t=String.raw`\.[a-z0-9_-]+`,S="--",T="__",$=String.raw`\s*\+\s*`,n=String.raw`\s*>\s*`,D=`[a-z]${_}*(-${_}+)*`,O=`(${T}${_}+(-${_}+)*)`,l=`(${S}${_}+(-${_}+)*)`,C=String.raw`(?:${E}\s*)?${$}${E}`,H=String.raw`(?:${E}\s*)?${n}${E}`,M=`${R}${$}${E}`,g=`${R}${n}${E}`,e=`${t}${$}${E}`,F=`${t}${n}${E}`,w=`&${R}${$}${E}`,U=`&${R}${n}${E}`,P=`&${t}${$}${E}`,Y=`&${t}${n}${E}`,d=`&${R}`,f=`&${t}`,x=`&${S}.+`,h=`&${T}.+`;export{g as ATTRIBUTE_CHILD_REGEX,R as ATTRIBUTE_REGEX,M as ATTRIBUTE_SIBLING_REGEX,D as BLOCK_REGEX,H as CHILD_REGEX,F as CLASS_CHILD_REGEX,t as CLASS_REGEX,e as CLASS_SIBLING_REGEX,O as ELEMENT_REGEX,B as FONT_FILE_NAME_REGEX,i as HYPHENS_REGEX,r as HYPHEN_REGEX,l as MODIFIER_REGEX,U as NESTED_ATTRIBUTE_CHILD_REGEX,d as NESTED_ATTRIBUTE_REGEX,w as NESTED_ATTRIBUTE_SIBLING_REGEX,Y as NESTED_CLASS_CHILD_REGEX,f as NESTED_CLASS_REGEX,P as NESTED_CLASS_SIBLING_REGEX,h as NESTED_ELEMENT_REGEX,x as NESTED_MODIFIER_REGEX,C as SIBLING_REGEX};
1
+ const S=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,T="(Italic)",c="(Variable)",n="[A-Z][a-z]",I=`^${n}+(${n}+)?`,X=["Thin","Hairline","ExtraLight","UltraLight","Light","Regular","Medium","SemiBold","DemiBold","Bold","ExtraBold","UltraBold","Black","Heavy","ExtraBlack","UltraBlack"].join("|"),L=["otf","ttf","woff","woff2"].join("|"),A=`(${I})`,N=`(${X})`,a=`(${L})$`,B=[`${A}-${N}`,`(${T}?)(${c}?)`,`\\.${a}`].join(""),r=new RegExp(B),i=/-+/,D=/(^-|-$)/,O=/Mobi|iP(hone|od|ad)|Android|BlackBerry/i,F=/^(?!-)[A-Za-z\u00C0-\u017FА-Яа-яЁё\s\-\u3000\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF\u3400-\u4DBF]+(?<!-)$/,_="[a-z0-9]",E="[^ ,{}]+",R=String.raw`\[[^\]]+\]`,t=String.raw`\.[a-z0-9_-]+`,s="--",G="__",o=String.raw`\s*\+\s*`,$=String.raw`\s*>\s*`,M=`[a-z]${_}*(-${_}+)*`,l=`(${G}${_}+(-${_}+)*)`,C=`(${s}${_}+(-${_}+)*)`,H=String.raw`(?:${E}\s*)?${o}${E}`,u=String.raw`(?:${E}\s*)?${$}${E}`,e=`${R}${o}${E}`,g=`${R}${$}${E}`,d=`${t}${o}${E}`,w=`${t}${$}${E}`,U=`&${R}${o}${E}`,P=`&${R}${$}${E}`,Y=`&${t}${o}${E}`,f=`&${t}${$}${E}`,h=`&${R}`,x=`&${t}`,z=`&${s}.+`,k=`&${G}.+`;export{g as ATTRIBUTE_CHILD_REGEX,R as ATTRIBUTE_REGEX,e as ATTRIBUTE_SIBLING_REGEX,M as BLOCK_REGEX,u as CHILD_REGEX,w as CLASS_CHILD_REGEX,t as CLASS_REGEX,d as CLASS_SIBLING_REGEX,l as ELEMENT_REGEX,S as EMAIL_REGEX,r as FONT_FILE_NAME_REGEX,D as HYPHENS_REGEX,i as HYPHEN_REGEX,O as IS_MOBILE_REGEX,C as MODIFIER_REGEX,F as NAME_REGEX,P as NESTED_ATTRIBUTE_CHILD_REGEX,h as NESTED_ATTRIBUTE_REGEX,U as NESTED_ATTRIBUTE_SIBLING_REGEX,f as NESTED_CLASS_CHILD_REGEX,x as NESTED_CLASS_REGEX,Y as NESTED_CLASS_SIBLING_REGEX,k as NESTED_ELEMENT_REGEX,z as NESTED_MODIFIER_REGEX,H as SIBLING_REGEX};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@archoleat/reglib",
3
3
  "description": "Library with ready-to-use regex",
4
- "version": "1.9.3",
4
+ "version": "1.10.1",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "email": "nikkeyl.me@gmail.com",
@@ -48,30 +48,27 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@archoleat/commitlint-define-config": "^1.1.1",
51
- "@archoleat/eslint-flat-compatibility": "^1.2.1",
52
51
  "@archoleat/prettier-define-config": "^1.2.1",
53
52
  "@archoleat/semantic-release-define-config": "^1.3.1",
54
- "@commitlint/cli": "^19.8.1",
55
- "@commitlint/config-conventional": "^19.8.1",
56
- "@commitlint/types": "^19.8.1",
57
- "@rollup/plugin-alias": "^5.1.1",
53
+ "@commitlint/cli": "^20.1.0",
54
+ "@commitlint/config-conventional": "^20.2.0",
55
+ "@commitlint/types": "^20.2.0",
56
+ "@rollup/plugin-alias": "^6.0.0",
58
57
  "@rollup/plugin-typescript": "^12.1.4",
59
58
  "@semantic-release/changelog": "^6.0.3",
60
59
  "@semantic-release/git": "^10.0.1",
61
- "@types/bun": "^1.2.21",
62
- "@typescript-eslint/eslint-plugin": "^7.18.0",
63
- "@typescript-eslint/parser": "^7.18.0",
60
+ "@types/bun": "^1.3.5",
61
+ "@typescript-eslint/eslint-plugin": "^8.52.0",
62
+ "@typescript-eslint/parser": "^8.48.0",
64
63
  "conventional-changelog-conventionalcommits": "^9.1.0",
65
64
  "editorconfig-checker": "^6.1.0",
66
- "eslint": "^8.57.1",
67
- "eslint-config-airbnb": "^19.0.4",
68
- "eslint-config-airbnb-typescript": "^18.0.0",
65
+ "eslint": "^9.39.1",
69
66
  "eslint-config-prettier": "^10.1.8",
70
67
  "eslint-define-config": "^2.1.0",
71
68
  "eslint-import-resolver-typescript": "^4.4.4",
72
69
  "eslint-plugin-import": "^2.32.0",
73
70
  "eslint-plugin-simple-import-sort": "^12.1.1",
74
- "eslint-plugin-unicorn": "^61.0.1",
71
+ "eslint-plugin-unicorn": "^62.0.0",
75
72
  "git-pull-run": "^1.6.2",
76
73
  "globals": "^16.3.0",
77
74
  "husky": "^9.1.7",
@@ -83,9 +80,9 @@
83
80
  "remark-preset-lint-markdown-style-guide": "^6.0.1",
84
81
  "remark-preset-lint-recommended": "^7.0.1",
85
82
  "rollup": "^4.50.0",
86
- "rollup-plugin-dts": "^6.2.3",
83
+ "rollup-plugin-dts": "^6.3.0",
87
84
  "rollup-plugin-esbuild": "^6.2.1",
88
- "semantic-release": "^24.2.7",
85
+ "semantic-release": "^25.0.2",
89
86
  "tslib": "^2.8.1"
90
87
  }
91
88
  }