- String str
Often it is desirable to define equivalences between Key strings, for example for case insensitivity.
This is achieved via the surjection:
- m : S↠ K ⊆ S
- S is set of all strings
- K is set of Keys
m(m(x)) = m(x), i.e. m must be idempotent, repeated applications do not change the result.
- m(x) = lowercase(x).
KeyMapping is optionally specified during construction and applied to keys during all operations.
If no KeyMapping is supplied then the default identity function is used.
- m(x) = x.
Predefined mappings include:
str is null then the name of the keymapping is returned.
typedef KeyMapping = String Function(String str);