Created
November 3, 2016 11:32
-
-
Save pranavrajs/f4433a3bc4d8e39fb9a31020473344e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function escapeCharAndroid(promise) { | |
return promise.then(response => response.text()) | |
.then((text) => { | |
if (Platform.OS === 'android') { | |
text = text.replace(/\r?\n/g, '').replace(/[\u0080-\uFFFF]/g, ''); | |
} | |
return text; | |
}) | |
.then(response => JSON.parse(response)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment