analytics.js
function map(str, props, fn) {
  var re = /\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g;
  return str.replace(re, function(_){
    if ('(' == _[_.length - 1]) return fn(_);
    if (!~props.indexOf(_)) return _;
    return fn(_);
  });
}
function map(str, props, fn) {
  var re = /\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g;
  return str.replace(re, function(_){
    if ('(' == _[_.length - 1]) return fn(_);
    if (!~props.indexOf(_)) return _;
    return fn(_);
  });
}
function map ( str , props , fn ) { var re = / \.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w* / g ; return str . replace ( re , function ( _ ) { if ( '(' == _ [ _ . length - 1 ] ) return fn ( _ ) ; if ( ! ~ props . indexOf ( _ ) ) return _ ; return fn ( _ ) ; } ) ; }
Return `str` with `props` mapped with `fn`.

@param {String} str
@param {Array} props
@param {Function} fn
@return {String}
@api private
Return str with props mapped with fn .