bun i -D @archoleat/validate-font-file-name
import { validateFontFileName } from '@archoleat/validate-font-file-name';
await validateFontFileName({
file: string,
regex?: string | RegExp,
});
The font family and font weight must be in Pascal Case and separated by a hyphen.
Postfixes that are allowed: Italic
, Variable
.
Extensions that are allowed: woff2
, woff
, otf
, ttf
.
Examples:
FontFamily-Bold.woff2
,FontFamily-SemiBoldItalic.woff
,FontFamily-MediumVariable.otf
,FontFamily-RegularItalicVariable.ttf
.
Please read CONTRIBUTING to start contributing.
This project is licensed under the MIT license.