Creation:2026-01-21Last update:2026-01-21

    validatePrefix Function Documentation

    The validatePrefix function checks if a given prefix is a valid locale prefix according to the configuration.

    Usage

    import { validatePrefix } from "intlayer";
    
    const isValid = validatePrefix("/fr");
    
    // Output: true

    Parameters

    Parameter Type Description
    prefix string The prefix to validate.

    Returns

    true if the prefix is valid, false otherwise.