How to use the serialize-query-params.parseUrl function in serialize-query-params

To help you get started, we’ve selected a few serialize-query-params 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 pbeshai / use-query-params / src / useQueryParam.ts View on Github external
rawQuery = React.useMemo(() => {
      let pathname = {};

      // handle checking SSR (#13)
      if (locationIsObject) {
        // in browser
        if (windowIsDefined) {
          pathname = parseQueryString(location.search);
        } else {
          // not in browser
          let url = location.pathname;
          if (location.search) {
            url += location.search;
          }

          pathname = parseQueryURL(url).query;
        }
      }

      return pathname || {};
    }, [location.search, location.pathname, locationIsObject, windowIsDefined]);
  }

serialize-query-params

A library for simplifying encoding and decoding URL query parameters.

ISC
Latest version published 2 years ago

Package Health Score

61 / 100
Full package analysis