MVFv3 API Documentation
    Preparing search index...
    validateFlags: (
        flags: number[],
        maxFlag: MaxFlag,
        path: string,
    ) => Result<boolean, NavigationFlagIntegrityError>

    Validates a flags array against the maximum allowed values. Ensures that:

    1. The array length matches the expected length based on maxFlag
    2. No flag value exceeds the maximum allowed value for its position

    Type declaration

      • (
            flags: number[],
            maxFlag: MaxFlag,
            path: string,
        ): Result<boolean, NavigationFlagIntegrityError>
      • Parameters

        • flags: number[]

          The array of flag values to validate

        • maxFlag: MaxFlag

          The maximum allowed index and flag values

        • path: string

          Path to the flags being validated (for error reporting)

        Returns Result<boolean, NavigationFlagIntegrityError>

        Success (true) or an error describing the validation failure

    const flags = [1, 2];
    const maxFlag = { index: 1, flag: 3 };
    const result = validateFlags(flags, maxFlag, "myFlags");
    if (result.ok) {
    console.log("Flags are valid");
    }