@archoleat/validate-font-file-name 1.0.6 → 1.0.7

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.
Files changed (3) hide show
  1. package/index.d.ts +2 -2
  2. package/index.js +1 -1
  3. package/package.json +1 -1
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 {RegExp | string} regex - The `regex` parameter in the
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, regex?: string | RegExp) => Promise<boolean>;
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 _ from"chalk";const f=async(n,t="")=>{const o="[A-Z][a-z]",e=`^${o}+(${o}+)?`,E=["Thin","Hairline","ExtraLight","UltraLight","Light","Regular","Medium","SemiBold","DemiBold","Bold","ExtraBold","UltraBold","Black","Heavy","ExtraBlack","UltraBlack"].join("|"),c=["otf","ttf","woff","woff2"].join("|"),r=`(${e})`,l=`(${E})`,s=`(${c})$`,i=new RegExp(`${r}-${l}\\.${s}`),T=N(n).base,a=typeof t=="string"&&t!==""?new RegExp(t):t||i;return a.test(T)?!0:(console.error(_.red.bold(`'${T}' doesn't match with '${a}'.`)),!1)};export{f as validateFontFileName};
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.6",
4
+ "version": "1.0.7",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "email": "archoleat@gmail.com",