@archoleat/validate-font-file-name 1.1.0 → 1.1.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 +13 -38
- package/package.json +10 -22
package/README.md
CHANGED
|
@@ -23,53 +23,22 @@
|
|
|
23
23
|
## Installation
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
|
-
# bun
|
|
27
26
|
bun i -D @archoleat/validate-font-file-name
|
|
28
27
|
```
|
|
29
28
|
|
|
30
|
-
```shell
|
|
31
|
-
# pnpm
|
|
32
|
-
pnpm i -D @archoleat/validate-font-file-name
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
```shell
|
|
36
|
-
# npm
|
|
37
|
-
npm i -D @archoleat/validate-font-file-name
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
```shell
|
|
41
|
-
# yarn
|
|
42
|
-
yarn add -D @archoleat/validate-font-file-name
|
|
43
|
-
```
|
|
44
|
-
|
|
45
29
|
## Usage
|
|
46
30
|
|
|
47
31
|
```js
|
|
48
32
|
import { validateFontFileName } from '@archoleat/validate-font-file-name';
|
|
49
33
|
|
|
50
|
-
const validFontFileName = 'src/fonts/OpenSans-Regular.woff2';
|
|
51
|
-
const invalidFontFileName = 'src/fonts/OpenSans.woff2';
|
|
52
|
-
|
|
53
|
-
// returns: true
|
|
54
|
-
console.log(await validateFontFileName(validFontFileName));
|
|
55
|
-
|
|
56
|
-
// returns: 'OpenSans.woff2' doesn't match with '/(^[A-Z][a-z]+([A-Z][a-z]+)?)-(Thin|Hairline|ExtraLight|UltraLight|Light|Regular|Medium|SemiBold|DemiBold|Bold|ExtraBold|UltraBold|Black|Heavy|ExtraBlack|UltraBlack)\.(otf|ttf|woff|woff2)$/'.
|
|
57
|
-
console.log(await validateFontFileName(invalidFontFileName));
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
or
|
|
61
|
-
|
|
62
|
-
```js
|
|
63
|
-
import { validateFontFileName } from '@archoleat/validate-font-file-name';
|
|
64
|
-
|
|
65
34
|
const validFontFileName = 'OpenSans-Regular.woff2';
|
|
66
35
|
const invalidFontFileName = 'OpenSans.woff2';
|
|
67
36
|
|
|
68
37
|
// returns: true
|
|
69
|
-
console.log(await validateFontFileName(validFontFileName));
|
|
38
|
+
console.log(await validateFontFileName({ file: validFontFileName }));
|
|
70
39
|
|
|
71
|
-
// returns: 'OpenSans.woff2' doesn't match with '/(^[A-Z][a-z]+([A-Z][a-z]+)?)-(Thin|Hairline|ExtraLight|UltraLight|Light|Regular|Medium|SemiBold|DemiBold|Bold|ExtraBold|UltraBold|Black|Heavy|ExtraBlack|UltraBlack)\.(otf|ttf|woff|woff2)$/'.
|
|
72
|
-
console.log(await validateFontFileName(invalidFontFileName));
|
|
40
|
+
// returns: {current time} [ERROR] 'OpenSans.woff2' doesn't match with '/(^[A-Z][a-z]+([A-Z][a-z]+)?)-(Thin|Hairline|ExtraLight|UltraLight|Light|Regular|Medium|SemiBold|DemiBold|Bold|ExtraBold|UltraBold|Black|Heavy|ExtraBlack|UltraBlack)\.(otf|ttf|woff|woff2)$/'.
|
|
41
|
+
console.log(await validateFontFileName({ file: invalidFontFileName }));
|
|
73
42
|
```
|
|
74
43
|
|
|
75
44
|
### Your Regex
|
|
@@ -86,10 +55,16 @@ const validFontFileName = 'OpenSans-regular';
|
|
|
86
55
|
const invalidFontFileName = 'OpenSans.woff2';
|
|
87
56
|
|
|
88
57
|
// returns: true
|
|
89
|
-
console.log(await validateFontFileName(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
58
|
+
console.log(await validateFontFileName({
|
|
59
|
+
file: validFontFileName,
|
|
60
|
+
regex: yourRegex,
|
|
61
|
+
}));
|
|
62
|
+
|
|
63
|
+
// returns: {current time} [ERROR] 'OpenSans.woff2' doesn't match with '/OpenSans-regular/'.
|
|
64
|
+
console.log(await validateFontFileName({
|
|
65
|
+
file: invalidFontFileName,
|
|
66
|
+
regex: yourRegex,
|
|
67
|
+
}));
|
|
93
68
|
```
|
|
94
69
|
|
|
95
70
|
## Naming Convention
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archoleat/validate-font-file-name",
|
|
3
3
|
"description": "Checking font file names for standardization",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"email": "archoleat@gmail.com",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"homepage": "https://github.com/archoleat/validate-font-file-name#readme",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "
|
|
14
|
+
"url": "https://github.com/archoleat/validate-font-file-name.git"
|
|
15
15
|
},
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/archoleat/validate-font-file-name/issues"
|
|
@@ -29,15 +29,11 @@
|
|
|
29
29
|
"validate",
|
|
30
30
|
"validator"
|
|
31
31
|
],
|
|
32
|
-
"packageManager": "pnpm@9.
|
|
32
|
+
"packageManager": "pnpm@9.7.0",
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=20.0.0",
|
|
35
35
|
"pnpm": ">=9.0.0"
|
|
36
36
|
},
|
|
37
|
-
"volta": {
|
|
38
|
-
"node": "20.16.0",
|
|
39
|
-
"pnpm": "9.4.0"
|
|
40
|
-
},
|
|
41
37
|
"type": "module",
|
|
42
38
|
"types": "index.d.ts",
|
|
43
39
|
"imports": {
|
|
@@ -52,23 +48,15 @@
|
|
|
52
48
|
],
|
|
53
49
|
"scripts": {
|
|
54
50
|
"init": "pnpm i && husky",
|
|
55
|
-
"
|
|
56
|
-
"spec:coverage": "vitest run --coverage",
|
|
57
|
-
"build": "rollup -c rollup.config.ts --configPlugin typescript",
|
|
58
|
-
"release": "semantic-release",
|
|
59
|
-
"lint:editorconfig": "editorconfig-checker",
|
|
60
|
-
"lint:formatting": "prettier . --check",
|
|
61
|
-
"lint:md": "remark . --quiet --frail",
|
|
62
|
-
"lint:ts": "eslint src/index.ts --fix",
|
|
63
|
-
"prettify": "prettier . --write"
|
|
51
|
+
"build": "rollup -c rollup.config.ts --configPlugin typescript"
|
|
64
52
|
},
|
|
65
53
|
"dependencies": {
|
|
66
54
|
"@archoleat/notifier": "^1.0.0",
|
|
67
55
|
"@archoleat/reglib": "^1.1.0"
|
|
68
56
|
},
|
|
69
57
|
"devDependencies": {
|
|
70
|
-
"@archoleat/commitlint-define-config": "^1.0.
|
|
71
|
-
"@archoleat/eslint-flat-compatibility": "^1.1.
|
|
58
|
+
"@archoleat/commitlint-define-config": "^1.0.10",
|
|
59
|
+
"@archoleat/eslint-flat-compatibility": "^1.1.7",
|
|
72
60
|
"@archoleat/prettier-define-config": "^1.0.1",
|
|
73
61
|
"@archoleat/semantic-release-define-config": "^1.1.14",
|
|
74
62
|
"@commitlint/cli": "^19.4.0",
|
|
@@ -77,7 +65,7 @@
|
|
|
77
65
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
78
66
|
"@semantic-release/changelog": "^6.0.3",
|
|
79
67
|
"@semantic-release/git": "^10.0.1",
|
|
80
|
-
"@types/node": "^22.
|
|
68
|
+
"@types/node": "^22.4.1",
|
|
81
69
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
82
70
|
"@typescript-eslint/parser": "^7.18.0",
|
|
83
71
|
"@vitest/coverage-v8": "^2.0.5",
|
|
@@ -89,7 +77,7 @@
|
|
|
89
77
|
"eslint-define-config": "^2.1.0",
|
|
90
78
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
91
79
|
"eslint-plugin-import": "^2.29.1",
|
|
92
|
-
"eslint-plugin-unicorn": "^
|
|
80
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
93
81
|
"git-pull-run": "^1.4.0",
|
|
94
82
|
"globals": "^15.9.0",
|
|
95
83
|
"husky": "^9.1.4",
|
|
@@ -100,10 +88,10 @@
|
|
|
100
88
|
"remark-preset-lint-consistent": "^6.0.0",
|
|
101
89
|
"remark-preset-lint-markdown-style-guide": "^6.0.0",
|
|
102
90
|
"remark-preset-lint-recommended": "^7.0.0",
|
|
103
|
-
"rollup": "^4.
|
|
91
|
+
"rollup": "^4.21.0",
|
|
104
92
|
"rollup-plugin-dts": "^6.1.1",
|
|
105
93
|
"rollup-plugin-esbuild": "^6.1.1",
|
|
106
|
-
"semantic-release": "^24.
|
|
94
|
+
"semantic-release": "^24.1.0",
|
|
107
95
|
"typescript": "^5.5.4",
|
|
108
96
|
"vitest": "^2.0.5"
|
|
109
97
|
}
|