@evlt/apix
    Preparing search index...

    Interface UrlQueryParameterValidator

    An interface for a validator of a URL query parameter.

    // validates a search keywords parameter.
    class KeywordsUrlQueryParameterValidator implements UrlQueryParameterValidator {
    isValid(name: string, value: string): boolean {
    // keyword are only alphanumeric with limited punctuation. Example only.
    const regex = /^[a-zA-Z0-9.,'" ]+$/;
    return regex.test(value);
    }
    }
    interface UrlQueryParameterValidator {
        isValid(name: string, value: string): boolean;
    }
    Index

    Methods

    Methods

    • Determines whether the value for the parameter is valid.

      Parameters

      • name: string

        The name of the parameter to validate.

      • value: string

        The value of the parameter to validate.

      Returns boolean

      true if the parameter is valid and false otherwise.