"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isValidSlug = isValidSlug;
exports.toSlug = toSlug;
function isValidSlug(slug) {
    if (!slug || typeof slug !== 'string') {
        return false;
    }
    const slugRegex = /^[a-z0-9_-]+$/;
    return slugRegex.test(slug);
}
function toSlug(input) {
    if (!input || typeof input !== 'string') {
        return '';
    }
    return input
        .toLowerCase()
        .trim()
        .replace(/\s+/g, '-')
        .replace(/[^a-z0-9_-]/g, '')
        .replace(/-+/g, '-')
        .replace(/^-|-$/g, '');
}
//# sourceMappingURL=slug.util.js.map