zeta-icon-name-checker
Version:
A utility used to check the validity of icon and category names in the Zeta Icon Library.
9 lines (8 loc) • 327 B
JavaScript
import { ZetaIconError, ErrorType } from "./types.js";
/// Check the name of a category
export function checkCategoryName(categoryName) {
if (!/^[^\\/:*?"<>|]+$/.test(categoryName)) {
return new ZetaIconError(ErrorType.invalidChar, categoryName);
}
return new ZetaIconError(ErrorType.none, categoryName);
}