add exports.compare to TS