[utils] Simplify integer conversion in js_to_json