Move getTypeEquivalent function into the common library