awx/ui_next/src/util/qs.js
/**
 * Merges existing params of search string with new ones and returns the updated list of params
 * @param {object} qs config object (used for getting defaults, current query params etc.)
 * @param {object} object with params from existing search
 * @param {object} object with new params to add
 * @return {object} query param object
 */
Merges existing params of search string with new ones and returns the updated list of params
@param {object} qs config object (used for getting defaults, current query params etc.)
@param {object} object with params from existing search
@param {object} object with new params to add
@return {object} query param object
Merges existing params of search string with new ones and returns the updated list of params @param { object } qs config object ( used for getting defaults current query params etc . ) @param { object } object with params from existing search @param { object } object with new params to add @return { object } query param object
function addParams(config, oldParams, paramsToAdd) {
  const namespacedOldParams = namespaceParams(config.namespace, oldParams);
  const namespacedParamsToAdd = namespaceParams(config.namespace, paramsToAdd);
  const namespacedDefaultParams = namespaceParams(
    config.namespace,
    config.defaultParams
  );
  const namespacedOldParamsNotDefaults = getNonDefaultParams(
    namespacedOldParams,
    namespacedDefaultParams
  );
  const namespacedMergedParams = getMergedParams(
    namespacedOldParamsNotDefaults,
    namespacedParamsToAdd
  );
  return denamespaceParams(config.namespace, {
    ...getDefaultParams(namespacedOldParams, namespacedDefaultParams),
    ...namespacedMergedParams,
    ...getRemainingNewParams(namespacedMergedParams, namespacedParamsToAdd),
  });
}
function addParams ( config , oldParams , paramsToAdd ) { const namespacedOldParams = namespaceParams ( config . namespace , oldParams ) ; const namespacedParamsToAdd = namespaceParams ( config . namespace , paramsToAdd ) ; const namespacedDefaultParams = namespaceParams ( config . namespace , config . defaultParams ) ; const namespacedOldParamsNotDefaults = getNonDefaultParams ( namespacedOldParams , namespacedDefaultParams ) ; const namespacedMergedParams = getMergedParams ( namespacedOldParamsNotDefaults , namespacedParamsToAdd ) ; return denamespaceParams ( config . namespace , { ... getDefaultParams ( namespacedOldParams , namespacedDefaultParams ) , ... namespacedMergedParams , ... getRemainingNewParams ( namespacedMergedParams , namespacedParamsToAdd ) , } ) ; }
Merges existing params of search string with new ones and returns the updated list of params
 @param {object} qs config object (used for getting defaults, current query params etc.)
Merges existing params of search string with new ones and returns the updated list of params @param { object } qs config object ( used for getting defaults current query params etc . )
// return updated params. // If newParams includes updates to the defaults, they will be replaced, // not concatenated.