web-build-utils
v0.0.6
Published
The utils for web build tools
Readme
web-build-utils
web-build-utils provides small, focused helpers used by the web build tools packages in this repository. You can use it directly if you need filename validation or simple percentage formatting.
Installation
Install the package with your preferred package manager.
pnpm add web-build-utils
# or
npm install web-build-utils
# or
yarn add web-build-utilsUsage
Import the helpers you need and call them in your build tooling code.
import { isSafeFilename } from 'web-build-utils';
const fileName = '[email protected]';
const isSafe = isSafeFilename(fileName, true);Notes
isSafeFilename validates only the basename of a path. It rejects empty values
and names starting with a dot. Allowed characters are letters, numbers,
underscores, dots, hyphens, at signs, and dollar signs.
Changelog
See CHANGELOG.md for release history.
