@archoleat/validate-font-file-name 1.0.6 → 1.0.8
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/index.d.ts +2 -2
- package/index.js +1 -1
- package/package.json +3 -2
package/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* function is a string that represents the file name of a font file that
|
|
7
7
|
* you want to validate.
|
|
8
8
|
*
|
|
9
|
-
* @param {
|
|
9
|
+
* @param {string | RegExp} pattern - The `pattern` parameter in the
|
|
10
10
|
* `validateFontFileName` function is used to provide a custom regular
|
|
11
11
|
* expression pattern for validating the font file name. If a custom
|
|
12
12
|
* regex pattern is not provided, the function uses a default pattern
|
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
* It returns `true` if the file name matches the specified pattern,
|
|
17
17
|
* and `false` if it does not match.
|
|
18
18
|
*/
|
|
19
|
-
declare const validateFontFileName: (file: string,
|
|
19
|
+
declare const validateFontFileName: (file: string, pattern?: string | RegExp) => Promise<boolean>;
|
|
20
20
|
|
|
21
21
|
export { validateFontFileName };
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parse as N}from"node:path";import
|
|
1
|
+
import{parse as N}from"node:path";import f from"chalk";const _=async(n,t="")=>{const o="[A-Z][a-z]",a=`^${o}+(${o}+)?`,r=["Thin","Hairline","ExtraLight","UltraLight","Light","Regular","Medium","SemiBold","DemiBold","Bold","ExtraBold","UltraBold","Black","Heavy","ExtraBlack","UltraBlack"].join("|"),E=["otf","ttf","woff","woff2"].join("|"),c=`(${a})`,s=`(${r})`,l=`(${E})$`,i=new RegExp(`${c}-${s}\\.${l}`),e=N(n).base,T=typeof t=="string"&&t!==""?new RegExp(t):t||i;return T.test(e)?!0:(console.error(f.red.bold(`'${e}' doesn't match with '${T}'.`)),!1)};export{_ as validateFontFileName};
|
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.0.
|
|
4
|
+
"version": "1.0.8",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"email": "archoleat@gmail.com",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"lint:editorconfig": "editorconfig-checker",
|
|
56
56
|
"lint:formatting": "prettier . --check",
|
|
57
57
|
"lint:md": "remark . --quiet",
|
|
58
|
-
"lint:ts": "eslint index.ts --fix",
|
|
58
|
+
"lint:ts": "eslint src/index.ts --fix",
|
|
59
59
|
"prettify": "prettier . --write",
|
|
60
60
|
"commit": "cz"
|
|
61
61
|
},
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"editorconfig-checker": "^5.1.5",
|
|
80
80
|
"eslint": "^8.57.0",
|
|
81
81
|
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
82
|
+
"eslint-config-prettier": "^9.1.0",
|
|
82
83
|
"eslint-define-config": "^2.1.0",
|
|
83
84
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
84
85
|
"eslint-plugin-import": "^2.29.1",
|