Socket
Socket
Sign inDemoInstall

use-query-params

Package Overview
Dependencies
10
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.7 to 1.1.8

8

esm/LocationProvider.js
import * as React from 'react';
import { updateUrlQuery, createLocationWithChanges } from './updateUrlQuery';
export var LocationContext = React.createContext({
var providerlessContextValue = {
location: {},
getLocation: function () { return ({}); },
setLocation: function () { },
});
};
export var LocationContext = React.createContext(providerlessContextValue);
export function useLocationContext() {
var context = React.useContext(LocationContext);
if (process.env.NODE_ENV === 'development' && context === undefined) {
if (process.env.NODE_ENV !== 'production' &&
(context === undefined || context === providerlessContextValue)) {
throw new Error('useQueryParams must be used within a QueryParamProvider');

@@ -12,0 +14,0 @@ }

@@ -5,10 +5,12 @@ "use strict";

var updateUrlQuery_1 = require("./updateUrlQuery");
exports.LocationContext = React.createContext({
var providerlessContextValue = {
location: {},
getLocation: function () { return ({}); },
setLocation: function () { },
});
};
exports.LocationContext = React.createContext(providerlessContextValue);
function useLocationContext() {
var context = React.useContext(exports.LocationContext);
if (process.env.NODE_ENV === 'development' && context === undefined) {
if (process.env.NODE_ENV !== 'production' &&
(context === undefined || context === providerlessContextValue)) {
throw new Error('useQueryParams must be used within a QueryParamProvider');

@@ -15,0 +17,0 @@ }

{
"name": "use-query-params",
"version": "1.1.7",
"version": "1.1.8",
"description": "React Hook for managing state in URL query parameters with easy serialization.",

@@ -83,3 +83,3 @@ "main": "lib/index.js",

"dependencies": {
"serialize-query-params": "^1.2.1"
"serialize-query-params": "^1.2.3"
},

@@ -86,0 +86,0 @@ "husky": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc