REGEX-Escape for: if (!platform.is('cordova') || platform.is('ios')) {

Your Input:
Result, the escaped string:
if \(\!platform\.is\('cordova'\) \|\| platform\.is\('ios'\)\) \{

What must the escaping look like for:
if (!platform.is('cordova') || platform.is('ios')) {

The excaped text for use in a regex is:
if \(\!platform\.is\('cordova'\) \|\| platform\.is\('ios'\)\) \{