helper recursive prop search+replace
359112
function propReplace(obj, prop, value) {
    var o = {};
    for (var p in obj) {
        if (o.hasOwnProperty.call(obj, p)) {
            if (typeof obj[p] == 'object' && !Array.isArray(obj[p])) {
                propReplace(obj[p], prop, value);
            } else if (p == prop) {
                obj[p] = value;
            }
        }
    }
}
775307
protected Properties replacePlaceHolders(Properties props){
		if (replacePlaceHolders){
			Properties result = new Properties();
			for (Object keyObj: props.keySet()){
				String key = (String) keyObj;
				String value = props.getProperty(key);
				key = PlaceHolderReplacer.replaceWithProperties(key);
				value = PlaceHolderReplacer.replaceWithProperties(value);
				result.put(key, value);
			}
			return result;
		}else{
			return props;
		}
	}
428148
function replaceArguments(ast, nested) {
        if (!examine(ast).isFunction) 
            throw new Error("Can only replace 'arguments' in functions");
        if (!('$usesArguments' in ast)) {
            treeWalk(ast, function (node, descend, path) {
                if (node.type === 'Identifier' && node.name === 'arguments') {
                    // Fix up shorthand properties
                    if (path[0].parent.shorthand) {
                        path[0].parent.shorthand = false;
                        path[0].parent.key = ident('arguments');
                        ast.$usesArguments = true;
                    }
                    // Replace identifiers that are not keys
                    if (path[0].field !== 'key' && path[0].field !== 'property') {
                        node.name = opts.$arguments;
                        ast.$usesArguments = true;
                    }
                } else if (node === ast || !examine(node).isFunction) {
                    descend();
                } else if (node.type === 'ArrowFunctionExpression') {
                    replaceArguments(node);
                    ast.$usesArguments = ast.$usesArguments || node.$usesArguments;
                }
            });
            ast.$usesArguments = ast.$usesArguments || false;
        }
        return ast.$usesArguments && ast.type !== 'ArrowFunctionExpression';
    }
757656
function replacePlaceholder(str, value, _state) {
	if (typeof str === 'string') {
		const ranges = findUnescapedTokens(str, placeholder);
		if (ranges.length) {
			if (_state) {
				_state.replaced = true;
			}

			str = replaceRanges(str, ranges, value);
		}
	}

	return str;
}
243197
function stringDotToObj(result, prop, name, value) {
        if (!result[prop]) {
            result[prop] = {};
        }
        name = name.substring((prop + '.').length, name.length);
        result[prop][name] = value;
    }
1194470
function searchAndReplace( $search, $replace, $limit, $offset, $orderby, $save = false ) {
		// escape potential backreferences when not in regex mode
		if ( ! $this->regex ) {
			$replace = str_replace( '\\', '\\\\', $replace );
			$replace = str_replace( '$', '\\$', $replace );
		}
		$this->replace = $replace;
		$results = $this->searchForPattern( $search, $limit, $offset, $orderby );
		if ( is_array( $results ) && $save ) {
			$this->replace( $results );
		}
		return $results;
	}
1367066
function replace(subject, pattern, replacement, options = []) {
  const opt_global = proplists.get_value(Symbol.for('global'), options);

  let regex;
  if (opt_global !== Symbol.for('undefined')) {
    regex = new RegExp(pattern, 'g');
  } else {
    regex = new RegExp(pattern, '');
  }

  return subject.replace(regex, replacement);
}
771504
function replaceKeyDeep(obj, keyMap) {
  return Object.keys(obj).reduce((memo, key)=> {

    // determine which key we are going to use
    let targetKey = keyMap[key] ? keyMap[key] : key;

    if (Array.isArray(obj[key])) {
      // recurse if an array
      memo[targetKey] = obj[key].map((val) => {
        if (Object.prototype.toString.call(val) === '[object Object]') {
          return replaceKeyDeep(val, keyMap);
        }
        return val;
      });
    } else if (Object.prototype.toString.call(obj[key]) === '[object Object]') {
      // recurse if Object
      memo[targetKey] = replaceKeyDeep(obj[key], keyMap);
    } else {
      // assign the new value
      memo[targetKey] = obj[key];
    }

    // return the modified object
    return memo;
  }, {});
}
904823
function replaceParams(ast, keys) {
  Object.keys(ast)
    .filter(key => {
      const value = ast[key]
      return Array.isArray(value) || (typeof value === 'object' && value !== null)
    })
    .forEach(key => {
      const expr = ast[key]

      if (!(typeof expr === 'object' && expr.type === 'param')) return replaceParams(expr, keys)

      if (typeof keys[expr.value] === 'undefined') throw new Error(`no value for parameter :${expr.value} found`)
      ast[key] = createValueExpr(keys[expr.value])
      return null
    })

  return ast
}
680860
function (elm, properties) {
        for (var prop in properties) {
            if (properties.hasOwnProperty(prop)) {
                try {
                    var name = prop.replace(/\-([a-z])/ig, innerReplaceRule);
                    var value = properties[prop];
                    elm.style[name] = (typeof value == 'number' && name != 'zIndex') ? (value + 'px') : value;
                } catch (ex) {}
            }
        }
    }
62823
function replace (obj, key, val) {
  if (obj.hasOwnProperty(key)) obj[key] = val;
  return obj;
}
1285530
function replaceValue(obj, key, value) {
  if (!obj) return;
  if (obj instanceof Array) {
    for (const i in obj) {
      replaceValue(obj[i], key, value);
    }
  }
  if (obj[key]) obj[key] = value;
  if (typeof obj === 'object' && obj !== null) {
    const children = Object.keys(obj);
    for (let childIndex = 0; childIndex < children.length; childIndex++) {
      replaceValue(obj[children[childIndex]], key, value);
    }
  }
  return obj;
}
1014198
function findAttribute(attrs, propName) {
    var index = Object.keys(attrs).filter(function (attr) {
      return attr.toLowerCase() === propName.toLowerCase();
    })[0];
    return attrs[index];
  }
285844
function replaceRequired(fns, brstars, replacer) {
    var keys = Object.keys(fns)
    if (!keys.length) return

    keys.forEach(function(name) {
      var source = fns[name]

      source = resolve.sync(source, {
        basedir: dirname
      })

      if (!source) return
      var index = brstars.indexOf(source)
      if (index === -1) return

      replacer([name], function(node) {
        if (!node.arguments.length) return
        var value = evaluate(node.arguments[0])
        if (!value) return

        value = require(source)(value)
        debug('replacing for: %s = %s', name, source)
        replaceCount += 1
        hijack(node, value)
      })
    })
  }
952564
function replaceWithSpacer(style) {
    const lines = style.content.split('\n').length;
    const spacer = new Array(lines).join('\n');
    _.set(style, 'content', spacer);
}
1231704
function includeProperty (key, value, replacer) {
  return typeof value !== 'undefined'
      && typeof value !== 'function'
      && (!Array.isArray(replacer) || contains(replacer, key));
}
574232
function patch(prop) {
  return (key, value) => {
    const { schema, table } = findSchemaAndTable(key);

    return raw('UPDATE ?? SET ?? = ?? || ? WHERE id = ?', [`${schema ? `${schema}.` : ''}${table}`, prop, prop, JSON.stringify(value), key]);
  };
}