@archoleat/reglib 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -0
- package/README.md +27 -0
- package/index.js +1 -0
- package/package.json +101 -0
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 Archoleat
|
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.
|
package/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Regex Library
|
2
|
+
|
3
|
+
![NPM Version](https://img.shields.io/npm/v/%40archoleat%2Freglib)
|
4
|
+
![NPM Downloads](https://img.shields.io/npm/dm/%40archoleat%2Freglib)
|
5
|
+
![ESM](https://img.shields.io/badge/ESM-fe0)
|
6
|
+
![Provenance](https://img.shields.io/badge/Provenance-fo0)
|
7
|
+
![CodeQL](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/codeql.yaml?label=CodeQL)
|
8
|
+
![Specs](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/spec.yaml?label=Specs)
|
9
|
+
![Commitlint](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/commitlint.yaml?label=Commitlint)
|
10
|
+
![Editorconfig](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/editorconfig.yaml?label=Editorconfig)
|
11
|
+
![Prettier](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/prettier.yaml?label=Prettier)
|
12
|
+
![ESLint](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/eslint.yaml?label=ESLint)
|
13
|
+
![Markdown](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/markdown.yaml?label=Markdown)
|
14
|
+
|
15
|
+
## Table of Contents
|
16
|
+
|
17
|
+
- [Contributing](#contributing)
|
18
|
+
- [License](#license)
|
19
|
+
|
20
|
+
## Contributing
|
21
|
+
|
22
|
+
Please read [**CONTRIBUTING**](https://github.com/archoleat/.github/blob/main/CONTRIBUTING.md)
|
23
|
+
to start contributing.
|
24
|
+
|
25
|
+
## License
|
26
|
+
|
27
|
+
This project is licensed under the [**MIT license**](LICENSE).
|
package/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
const n="[A-Z][a-z]",S=`^${n}+(${n}+)?`,s=["Thin","Hairline","ExtraLight","UltraLight","Light","Regular","Medium","SemiBold","DemiBold","Bold","ExtraBold","UltraBold","Black","Heavy","ExtraBlack","UltraBlack"].join("|"),G=["otf","ttf","woff","woff2"].join("|"),r=`(${S})`,T=`(${s})`,c=`(${G})$`,w=new RegExp(`${r}-${T}\\.${c}`),_=String.raw`(?:_|__|-|\s)`,$=new RegExp(`${_}?(italic)`,"i"),a=new RegExp(`${_}?(var)`,"i"),g=new RegExp(String.raw`^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$`),i=new RegExp(String.raw`^[\sA-Za-zЁА-яё]+$`),L=new RegExp(String.raw`^\+[\d-]+$`),N=new RegExp(String.raw`^\S+$`,"i"),I=".html",R=".pug",O={HTML_EXTENSION_REGEX:I,PUG_EXTENSION_REGEX:R,FILE_EXTENSION_REGEX:new RegExp(String.raw`\.[^.]+$`),JS_EXTENSION_REGEX:new RegExp(String.raw`\.js$`),PUG_EXTENSION_REGEX_REGEX:new RegExp(`${R}$`),SCSS_EXTENSION_REGEX:new RegExp(String.raw`\.s[ac]ss$`),NODE_MODULES_REGEX:new RegExp("node_modules")},A={ALL_REGEX:new RegExp(String.raw`^\d+$`)},x={RU_REGEX:new RegExp(String.raw`^\+7 \((9\d{2,3})\) \d{3}-\d{2}-\d{2}$`)},E="[a-z0-9]",t=String.raw`?\[(.*)\]`,e=String.raw`?\.(.*)`,X="--",o="__",l={bem:{BLOCK_REGEX:`[a-z]${E}*(-${E}+)`,ELEMENT_REGEX:`(${o}${E}+(-${E}+)*)`,MODIFIER_REGEX:`(${X}${E}+(-${E}+)*)`},nested:{ATTRIBUTE_REGEX:t,CLASS_REGEX:e,ELEMENT_REGEX:o,MODIFIER_REGEX:X},child:{ATTRIBUTE_REGEX:`${t} &`,CLASS_REGEX:`${e} &`}};export{g as EMAIL_REGEX,w as FONT_FILE_NAME_REGEX,$ as ITALIC_REGEX,i as LETTERS_WITH_SPACES_REGEX,L as NOT_SEPARATE_REGEX,N as NOT_SPACE_REGEX,a as VARIABLE_FONT_REGEX,O as extensions,A as numbers,x as phones,l as selectors};
|
package/package.json
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
{
|
2
|
+
"name": "@archoleat/reglib",
|
3
|
+
"description": "Library with ready-to-use regex",
|
4
|
+
"version": "1.0.2",
|
5
|
+
"license": "MIT",
|
6
|
+
"author": {
|
7
|
+
"email": "archoleat@gmail.com",
|
8
|
+
"name": "Archoleat",
|
9
|
+
"url": "https://github.com/archoleat"
|
10
|
+
},
|
11
|
+
"homepage": "https://github.com/archoleat/reglib#readme",
|
12
|
+
"repository": {
|
13
|
+
"type": "git",
|
14
|
+
"url": "git+https://github.com/archoleat/reglib.git"
|
15
|
+
},
|
16
|
+
"bugs": {
|
17
|
+
"url": "https://github.com/archoleat/reglib/issues"
|
18
|
+
},
|
19
|
+
"keywords": [
|
20
|
+
"archoleat-reglib",
|
21
|
+
"archoleat",
|
22
|
+
"library",
|
23
|
+
"ready-to-use",
|
24
|
+
"regex",
|
25
|
+
"reglib",
|
26
|
+
"regular-expression",
|
27
|
+
"regular-expressions"
|
28
|
+
],
|
29
|
+
"packageManager": "pnpm@9.4.0",
|
30
|
+
"engines": {
|
31
|
+
"node": ">=20.0.0",
|
32
|
+
"pnpm": ">=9.0.0"
|
33
|
+
},
|
34
|
+
"volta": {
|
35
|
+
"node": "20.16.0",
|
36
|
+
"pnpm": "9.4.0"
|
37
|
+
},
|
38
|
+
"type": "module",
|
39
|
+
"imports": {
|
40
|
+
"#font": "./src/regex/font/index.ts",
|
41
|
+
"#regex": "./src/regex/index.ts",
|
42
|
+
"#shared": "./src/shared/index.ts"
|
43
|
+
},
|
44
|
+
"exports": {
|
45
|
+
".": "./index.js"
|
46
|
+
},
|
47
|
+
"files": [
|
48
|
+
"index.js"
|
49
|
+
],
|
50
|
+
"scripts": {
|
51
|
+
"init": "pnpm i && husky",
|
52
|
+
"spec": "vitest",
|
53
|
+
"spec:coverage": "vitest run --coverage",
|
54
|
+
"build": "rollup -c rollup.config.ts --configPlugin typescript",
|
55
|
+
"release": "semantic-release",
|
56
|
+
"lint:editorconfig": "editorconfig-checker",
|
57
|
+
"lint:formatting": "prettier . --check",
|
58
|
+
"lint:md": "remark . --quiet --frail",
|
59
|
+
"lint:ts": "eslint src/**/*.ts --fix",
|
60
|
+
"prettify": "prettier . --write",
|
61
|
+
"commit": "cz"
|
62
|
+
},
|
63
|
+
"devDependencies": {
|
64
|
+
"@archoleat/commitlint-define-config": "^1.0.7",
|
65
|
+
"@archoleat/eslint-flat-compatibility": "^1.1.6",
|
66
|
+
"@archoleat/semantic-release-define-config": "^1.1.7",
|
67
|
+
"@commitlint/cli": "^19.3.0",
|
68
|
+
"@commitlint/config-conventional": "^19.2.2",
|
69
|
+
"@commitlint/types": "^19.0.3",
|
70
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
71
|
+
"@semantic-release/changelog": "^6.0.3",
|
72
|
+
"@semantic-release/git": "^10.0.1",
|
73
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
74
|
+
"@typescript-eslint/parser": "^7.18.0",
|
75
|
+
"@vitest/coverage-v8": "^2.0.4",
|
76
|
+
"conventional-changelog-conventionalcommits": "^8.0.0",
|
77
|
+
"cz-conventional-changelog": "^3.3.0",
|
78
|
+
"editorconfig-checker": "^5.1.8",
|
79
|
+
"eslint": "^8.57.0",
|
80
|
+
"eslint-config-airbnb-typescript": "^18.0.0",
|
81
|
+
"eslint-config-prettier": "^9.1.0",
|
82
|
+
"eslint-define-config": "^2.1.0",
|
83
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
84
|
+
"eslint-plugin-import": "^2.29.1",
|
85
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
86
|
+
"globals": "^15.8.0",
|
87
|
+
"husky": "^9.1.4",
|
88
|
+
"lint-staged": "^15.2.7",
|
89
|
+
"prettier": "^3.3.3",
|
90
|
+
"remark": "15.0.1",
|
91
|
+
"remark-cli": "^12.0.1",
|
92
|
+
"remark-preset-lint-consistent": "^6.0.0",
|
93
|
+
"remark-preset-lint-markdown-style-guide": "^6.0.0",
|
94
|
+
"remark-preset-lint-recommended": "^7.0.0",
|
95
|
+
"rollup": "^4.19.1",
|
96
|
+
"rollup-plugin-esbuild": "^6.1.1",
|
97
|
+
"semantic-release": "^24.0.0",
|
98
|
+
"typescript": "^5.5.4",
|
99
|
+
"vitest": "^2.0.4"
|
100
|
+
}
|
101
|
+
}
|