/* Returns a set of parameters for the given map - escaping the values as needed
552294
private static Iterable<String> getParametersFromMap(final Map<String, String> paramMap, final boolean strict) {
        return Iterables.transform(paramMap.entrySet(), new Function<Map.Entry<String, String>, String>() {
            @Override public String apply(final Map.Entry<String, String> input) {
                return input == null ? null : ENTRY_JOINER.join(UriEscaper.escapeQueryParam(input.getKey(), strict),
                                                                UriEscaper.escapeQueryParam(input.getValue(), strict));
            }
        });
    }
327526
function mapUrlToProps(url, props) {
  return {
    foo: decode(UrlQueryParamTypes.number, url.fooInUrl),
    bar: url.bar,
  };
}
1085231
private static Map<String, String> filterParam(Map<String, String> params) {
        Map<String, String> ret = new HashMap<String, String>();
        if (params == null) {
            return ret;
        }

        for (Map.Entry<String, String> i : params.entrySet()) {
            if (i.getKey().startsWith("x:") && i.getValue() != null && !i.getValue().equals("")) {
                ret.put(i.getKey(), i.getValue());
            }
        }
        return ret;
    }
1215962
public Map<String, List<String>> parameters() {
        if (params == null) {
            params = decodeParams(uri, pathEndIdx(), charset, maxParams);
        }
        return params;
    }
1083194
private String normalizeParameters(MultiValueMap<String, String> collectedParameters) {
		// Normalizes the collected parameters for baseString calculation, per https://tools.ietf.org/html/rfc5849#section-3.4.1.3.2
		MultiValueMap<String, String> sortedEncodedParameters = new TreeMultiValueMap<String, String>();
		for (Iterator<Entry<String, List<String>>> entryIt = collectedParameters.entrySet().iterator(); entryIt.hasNext();) {
			Entry<String, List<String>> entry = entryIt.next();
			String collectedName = entry.getKey();
			List<String> collectedValues = entry.getValue();	
			List<String> encodedValues = new ArrayList<String>(collectedValues.size());
			sortedEncodedParameters.put(oauthEncode(collectedName), encodedValues);
			for (Iterator<String> valueIt = collectedValues.iterator(); valueIt.hasNext();) {
				String value = valueIt.next();
				encodedValues.add(value != null ? oauthEncode(value) : "");
			}
			Collections.sort(encodedValues);
		}
		StringBuilder paramsBuilder = new StringBuilder();
		for (Iterator<Entry<String, List<String>>> entryIt = sortedEncodedParameters.entrySet().iterator(); entryIt.hasNext();) {
			Entry<String, List<String>> entry = entryIt.next();
			String name = entry.getKey();
			List<String> values = entry.getValue();
			for (Iterator<String> valueIt = values.iterator(); valueIt.hasNext();) {
				String value = valueIt.next();
				paramsBuilder.append(name).append('=').append(value);
				if (valueIt.hasNext()) {
					paramsBuilder.append("&");
				}
			}
			if (entryIt.hasNext()) {
				paramsBuilder.append("&");
			}
		}
		return paramsBuilder.toString();
	}
445638
public static Map mapValues(Mapper mapper, Map map) {
        return mapValues(mapper, map, false);
    }
273953
function mapFactory (params) {

    if (typeof params === 'function') {
        return params;
    }

    var regs = [];
    (params || []).forEach(function (params) {
        if (typeof params[0] === 'string') {
            params[0] = new RegExp(params[0]);
        }
        regs.push(params);
    });

    // @param   {String}
    // @param   {String}
    return regs.length ? function map (src) {

        if (!src) {
            return src;
        }

        regs.forEach(function (reg) {
            src = src.replace.apply(src, reg);
        });

        return src;

    } : function (src) {
        return src;
    };
}
458998
function _parseParams(params) {
  return params.map((param) => {
    let result;
    switch (param.type) {
      case 'Identifier':
        result = new Param(param.name);
        break;
      case 'AssignmentPattern':
        result = new Param(param.left.name, true);
        break;
      case 'ObjectPattern': {
        const objParams = param.properties.map((objParam) => objParam.value);
        result = new Param('arguments', false, _parseParams(objParams));
        break;
      }
      default:
    }
    return result;
  });
}
1250436
private String getReqValue(Map<String, String[]> map, String key) {

        return map.get(key) != null ? map.get(key)[0] : null;
    }
1176652
@SuppressWarnings("unchecked")
	@Override
	public T paramMap(final Map<String, ?> paramMap) {
		if (paramMap != null) {
			paramMap.forEach((k, v) -> param(k, v));
		}
		return (T) this;
	}
165620
public void fillParameterValues(Map<String, Object> valuesMap) {
        AssertUtils.assertNotNull(valuesMap, "Value map cannot be null");

        if (this.sqlParameterNames != null) {

            String parameterName = null;
            this.sqlParameterValues = new ArrayList<Object>();

            // using for instead of iterator because this way I control position
            // I am getting.
            for (int i = 0; i < this.sqlParameterNames.size(); i++) {
                parameterName = this.sqlParameterNames.get(i);

                if (valuesMap.containsKey(parameterName) == true) {
                    this.sqlParameterValues.add(valuesMap.get(parameterName));
                } else {
                    throw new IllegalArgumentException(String.format(HandlersConstants.ERROR_PARAMETER_NOT_FOUND, parameterName));
                }
            }
        }
    }
441837
function concatenateAllValuesForExtendeds (map) {
  let res = []
  Object.keys(map).forEach(function (key) {
    res = res.concat(map[key][1])
  })
  return res
}
678268
function _formatParameters(parameters) {
    let options = {},
        formatter, value;
    for (let prop in parameters) {
        if (parameters.hasOwnProperty(prop)) {
            if (parameters[prop].domain) {
                let domain = getDomains()[parameters[prop].domain];
                formatter = domain ? domain.format : undefined;
            } else {
                formatter = undefined;
            }
            value = formatter && formatter.value ? formatter.value(parameters[prop].value) : parameters[prop].value;
            options[prop] = value;
        }
    }
    return options;
}
41245
private byte[] encodeParameters(Map<String, String> params, String paramsEncoding) {
        StringBuilder encodedParams = new StringBuilder();
        try {
            for (Map.Entry<String, String> entry : params.entrySet()) {
                encodedParams.append(URLEncoder.encode(entry.getKey(), paramsEncoding));
                encodedParams.append('=');
                encodedParams.append(URLEncoder.encode(entry.getValue(), paramsEncoding));
                encodedParams.append('&');
            }
            return encodedParams.toString().getBytes(paramsEncoding);
        } catch (UnsupportedEncodingException uee) {
            throw new RuntimeException("Encoding not supported: " + paramsEncoding, uee);
        }
    }
691211
public Parameters getAsParameters(String key) {
		AnyValueMap value = getAsMap(key);
		return new Parameters(value);
	}
1149011
public void addJavaScriptValues(Map<String, String> parameterMap) {
        for (String parameterName : parameterMap.keySet()) {
            this.javascriptExpressions.put(parameterName, parameterMap.get(parameterName));
        }
    }
277144
public static PagingParams fromMap(AnyValueMap map) {
		Long skip = map.getAsNullableLong("skip");
		Long take = map.getAsNullableLong("take");
		boolean total = map.getAsBooleanWithDefault("total", true);
		return new PagingParams(skip, take, total);
	}