src/process-streams.js
function parseString (string, tmpIn, tmpOut) {
    var resultIn = null
    var resultOut = null
    var resultString = string.replace(placeHolderRegex, function (match) {
      switch (match) {
        case IN:
          resultIn = resultIn || tmpIn
          return resultIn
        case OUT:
          resultOut = resultOut || tmpOut
          return resultOut
        /* istanbul ignore next */
        default:
          throw new Error("Found '" + match + "'. Placeholder regex not consistent: " + JSON.stringify({
            IN: IN,
            OUT: OUT,
            match: match
          }))
      }
    })

    return {
      in: resultIn,
      out: resultOut,
      string: resultString
    }
  }
function parseString (string, tmpIn, tmpOut) {
    var resultIn = null
    var resultOut = null
    var resultString = string.replace(placeHolderRegex, function (match) {
      switch (match) {
        case IN:
          resultIn = resultIn || tmpIn
          return resultIn
        case OUT:
          resultOut = resultOut || tmpOut
          return resultOut
        /* istanbul ignore next */
        default:
          throw new Error("Found '" + match + "'. Placeholder regex not consistent: " + JSON.stringify({
            IN: IN,
            OUT: OUT,
            match: match
          }))
      }
    })

    return {
      in: resultIn,
      out: resultOut,
      string: resultString
    }
  }
function parseString ( string , tmpIn , tmpOut ) { var resultIn = null var resultOut = null var resultString = string . replace ( placeHolderRegex , function ( match ) { switch ( match ) { case IN : resultIn = resultIn || tmpIn return resultIn case OUT : resultOut = resultOut || tmpOut return resultOut /* istanbul ignore next */ default : throw new Error ( "Found '" + match + "'. Placeholder regex not consistent: " + JSON . stringify ( { IN : IN , OUT : OUT , match : match } ) ) } } ) return { in : resultIn , out : resultOut , string : resultString } }
Replace placeholders in a string
@param string
@param tmpIn
@param tmpOut
@returns {{in: *, out: *, string: (XML|string|void|*)}}
Replace placeholders in a string