1.2.0 • Published 10 months ago
@archoleat/validate-font-file-name v1.2.0
Validate Font File Name
Table of Contents
Installation
bun i -D @archoleat/validate-font-file-name
Usage
Naming Convention
The font family and font weight must be in Pascal Case and separated by a hyphen.
Extensions that are allowed: otf
, ttf
, woff
, woff2
.
Example:
OpenSans-SemiBold.woff2
.
It's not necessary to specify the regex
parameter.
import { validateFontFileName } from '@archoleat/validate-font-file-name';
await validateFontFileName({
file: 'path/to/file',
regex: /regex/ | new RegExp() | '',
});
Contributing
Please read CONTRIBUTING to start contributing.
License
This project is licensed under the MIT license.