How to use the querystringify.stringify function in querystringify

To help you get started, we’ve selected a few querystringify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GameDistribution / GD-HTML5 / src / components / VideoAd.js View on Github external
if (!regex.test(key)) continue;
        delete cust_params[key];
      }
      delete vast_query.cust_params["$$remove"];
    }

    // transform
    let transformed = this.macros.transform(vast_query, {
      get: (key) => {
        return vast.tnl_keys[key.toLowerCase()];
      }
    });

    query.cust_params = cust_params;
    merge(query, transformed);
    query.cust_params = qs.stringify(query.cust_params);

    return true;
  }
}
github infinitered / ignite / ignite-base / App / Services / HttpClient.js View on Github external
const {
    method,
    parameters,
    headers = {},
    logging = false
  } = options

  let url = options.url

  const fetchOptions = { method, headers }

  // set the JSON body if we have one
  if (parametersForBody(method) && parametersIsObject(parameters)) {
    fetchOptions.body = JSON.stringify(parameters)
  } else if (parametersForQueryString(method) && parametersIsObject(parameters)) {
    url = R.concat(url, QueryString.stringify(parameters, true))
  }

  if (logging) {
    logRequest(url, method, parameters)
  }

  // start the clock
  const timeStart = Date.now()

  // make the call and wait
  return new Promise((resolve, reject) => {
    const clientResponse = {
      ok: false,
      json: null,
      statusCode: null
    }
github coralproject / talk / client / coral-embed-stream / src / actions / stream.js View on Github external
export const viewComment = id => (dispatch, _, { pym }) => {
  const search = queryString.stringify({
    ...queryString.parse(location.search),
    comment_id: id,
  });

  // remove the comment_id url param
  const url = buildUrl({ ...location, search });

  try {
    // "window" here refers to the embedded iframe
    window.history.replaceState({}, document.title, url);

    // also change the parent url
    pym.sendMessage('coral-view-comment', id);
  } catch (e) {
    /* not sure if we're worried about old browsers */
  }
github queicherius / gw2api-client / src / endpoint.js View on Github external
// Only set the API key for authenticated endpoints,
    // when it is required or optional and set on the client
    if (this._usesApiKey()) {
      query['access_token'] = this.apiKey
    }

    // Set the language for localized endpoints
    if (this.isLocalized) {
      query['lang'] = this.lang
    }

    // Merge the parsed query parts out of the url
    query = Object.assign(query, parsedQuery)

    // Build the url with the finished query
    query = qs.stringify(query, true).replace(/%2C/g, ',')
    return parsedUrl[0] + query
  }
github HenrikJoreteg / redux-bundler / src / bundles / create-url-bundle.js View on Github external
export const ensureString = input =>
  isString(input) ? input : qs.stringify(input)
const IPRE = /^[0-9.]+$/
github mbraak / django-mptt-admin / frontend / django_mptt_admin.ts View on Github external
function urlToString(url: any) {
    const { pathname, query } = url;
    const querystring = qs.stringify(query);

    if (!querystring) {
        return pathname;
    } else {
        return `${pathname}?${querystring}`;
    }
}
github coralproject / talk / client / coral-embed / src / Bridge.js View on Github external
function buildStreamIframeUrl(talkBaseUrl, query) {
  let url = talkBaseUrl + 'embed/stream?';

  url += queryString.stringify(query);

  return url;
}
github type-route / type-route / src / buildRouteDefinition.ts View on Github external
const pathParams: Record = {};
    const queryParams: Record = {};

    Object.keys(params).forEach(name => {
      if (pathParameters[name]) {
        pathParams[name] = params[name];
      } else {
        if (params[name] !== undefined) {
          queryParams[name] = params[name];
        }
      }
    });

    return (
      builder.path(pathParams) +
      qs.stringify(queryParams, Object.keys(queryParams).length > 0)
    );
  }
github bradstiff / app-location / src / generateUtils.js View on Github external
.keys(params)
        .filter(key => Object.keys(paramDefs).indexOf(key) > -1)
        .reduce((acc, key) => {
            const value = params[key] === 'undefined' ? undefined
                : params[key] === 'null' ? null
                    : params[key];
            const paramDef = paramDefs[key];
            return paramDef.default() === value
                ? acc //avoid query string clutter: don't serialize values that are the same as the default
                : {
                    [key]: params[key],
                    ...acc
                }
        }, null);

    return qs.stringify(queryStringParams);
}
github moderntribe / events-gutenberg / plugins / events / src / modules / editor / utils / geo-data.js View on Github external
country,
	} = address;

	const query = [ city, street, province, zip, country ]
		.filter( identity )
		.map( trim )
		.join( ', ' );

	const args = {
		f: 'q',
		source: 's_q',
		geocode: '',
		q: query,
	};

	return `https://maps.google.com/maps?${ stringify( args ) }`;
}

querystringify

Querystringify - Small, simple but powerful query string parser.

MIT
Latest version published 4 years ago

Package Health Score

71 / 100
Full package analysis

Popular querystringify functions