Convert DSTU2 JSON to STU3 JSON in Javascript

I need to convert the DSTU2 JSON to STU3 JSON as the site wants the incoming DSTU2 data to be converted in STU3 JSON Format. Any suggestions on this if someone already implemented this Javascript ?