processUnit function

String? processUnit([
  1. String? unit
])

Implementation

String? processUnit([String? unit]) {
  if (unit == null) return null;
  if (unitMap.containsKey(unit)) {
    return unitMap[unit];
  }

  return unit.trim().toLowerCase().replaceFirst(RegExp(r's$'), "");
}