The CharacterMapping type is used to define how characters should be transformed. It can be implemented as either a Map<string, string> or a Record<string, string>.
Important Logic Rule: The mapping is inverted compared to a standard replacement dictionary. The key of the map/object must be the target (transformed) character, and the value must be a collection of characters (as a string) that should be mapped to that target character.
// Example of a CharacterMapping where 'a' is the target
// and 'á', 'à', 'â' are the source characters mapping to it.
const mapping: CharacterMapping = {
'a': 'áàâ'
};
// Or using a Map
const mappingMap: CharacterMapping = new Map<string, string>([
['a', 'áàâ']
]);