How to use replace-string - 8 common examples

To help you get started, we’ve selected a few replace-string examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo-cli / packages / xdl / src / detach / AndroidShellApp.js View on Github external
function xmlWeirdAndroidEscape(original) {
  let noAmps = replaceString(original, '&', '&');
  let noLt = replaceString(noAmps, '<', '<');
  let noGt = replaceString(noLt, '>', '>');
  let noApos = replaceString(noGt, '"', '\\"');
  return replaceString(noApos, "'", "\\'");
}
github expo / expo-cli / packages / xdl / src / detach / AndroidShellApp.js View on Github external
function xmlWeirdAndroidEscape(original) {
  let noAmps = replaceString(original, '&', '&');
  let noLt = replaceString(noAmps, '<', '<');
  let noGt = replaceString(noLt, '>', '>');
  let noApos = replaceString(noGt, '"', '\\"');
  return replaceString(noApos, "'", "\\'");
}
github expo / expo-cli / packages / xdl / src / detach / AndroidShellApp.js View on Github external
function xmlWeirdAndroidEscape(original) {
  let noAmps = replaceString(original, '&', '&');
  let noLt = replaceString(noAmps, '<', '<');
  let noGt = replaceString(noLt, '>', '>');
  let noApos = replaceString(noGt, '"', '\\"');
  return replaceString(noApos, "'", "\\'");
}
github expo / xdl / src / detach / AndroidShellApp.js View on Github external
function xmlWeirdAndroidEscape(original) {
  let noAmps = replaceString(original, '&', '&');
  let noLt = replaceString(noAmps, '<', '<');
  let noGt = replaceString(noLt, '>', '>');
  let noApos = replaceString(noGt, '"', '\\"');
  return replaceString(noApos, "'", "\\'");
}
github expo / expo-cli / packages / xdl / src / detach / AndroidShellApp.js View on Github external
function xmlWeirdAndroidEscape(original) {
  let noAmps = replaceString(original, '&', '&');
  let noLt = replaceString(noAmps, '<', '<');
  let noGt = replaceString(noLt, '>', '>');
  let noApos = replaceString(noGt, '"', '\\"');
  return replaceString(noApos, "'", "\\'");
}
github shroudedcode / apk-mitm / src / tasks / disable-certificate-pinning.ts View on Github external
(async () => {
      observer.next('Finding smali files...')
      const smaliFiles = await globby(path.join(directoryPath, 'smali*/**/*.smali'))

      let pinningFound = false

      for (const filePath of smaliFiles) {
        observer.next(`Scanning ${path.basename(filePath)}...`)

        const originalContent = await fs.readFile(filePath, 'utf-8')
        let patchedContent = originalContent

        for (const signature of methodSignatures) {
          patchedContent = replaceAll(
            patchedContent,
            signature,
            `${signature}\n    return-void`,
          )
        }

        if (originalContent !== patchedContent) {
          pinningFound = true
          await fs.writeFile(filePath, patchedContent)
        }
      }

      if (!pinningFound) task.skip('No certificate pinning logic found.')
      observer.complete()
    })()
  })
github expo / xdl / src / detach / AndroidShellApp.js View on Github external
function xmlWeirdAndroidEscape(original) {
  let noAmps = replaceString(original, '&', '&');
  let noLt = replaceString(noAmps, '<', '<');
  let noGt = replaceString(noLt, '>', '>');
  let noApos = replaceString(noGt, '"', '\\"');
  return replaceString(noApos, "'", "\\'");
}
github expo / expo-cli / packages / xdl / src / detach / AndroidShellApp.js View on Github external
function xmlWeirdAndroidEscape(original) {
  let noAmps = replaceString(original, '&', '&');
  let noLt = replaceString(noAmps, '<', '<');
  let noGt = replaceString(noLt, '>', '>');
  let noApos = replaceString(noGt, '"', '\\"');
  return replaceString(noApos, "'", "\\'");
}

replace-string

Replace all substring matches in a string

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis

Popular replace-string functions