Skip to contents

Normalizes various format names to canonical form (t20, odi, test). Handles case insensitivity, whitespace, and common aliases.

Usage

normalize_format(format)

Arguments

format

Character. Format name to normalize

Value

Character. Canonical format: "t20", "odi", or "test"

Details

This is the canonical function for format normalization across the package. See also: normalize_match_type() which is a deprecated alias.

Examples

normalize_format("T20")    # "t20"
#> [1] "t20"
normalize_format("IT20")   # "t20"
#> [1] "t20"
normalize_format("ODI")    # "odi"
#> [1] "odi"
normalize_format("Test")   # "test"
#> [1] "test"
normalize_format("MDM")    # "test" (multi-day matches)
#> [1] "test"