Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-use-cookie

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-use-cookie - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

5

CHANGELOG.md

@@ -6,6 +6,9 @@ # useCookie Changelog

## [1.1.0](https://github.com/tylerwolff/useCookie/compare/7273486214108568046772a6f7c3dc855609d2bd...24ec23bb2f92d3fe3b124cddba49213232583a84) (2020-06-17)
## [v1.2.0](https://github.com/tylerwolff/useCookie/releases/tag/v1.2.0) (2020-10-05)
- Added SSR support [@natterstefan](https://github.com/natterstefan)
## [v1.1.0](https://github.com/tylerwolff/useCookie/compare/7273486214108568046772a6f7c3dc855609d2bd...24ec23bb2f92d3fe3b124cddba49213232583a84) (2020-06-17)
### Features
- Expose the `getCookie` and `setCookie` function

4

dist/index.d.ts

@@ -22,8 +22,8 @@ // Type definitions for react-use-cookie

export function getCookie(name: string, initialValue: string): string;
export function getCookie(name: string, initialValue?: string): string;
export default function(
key: string,
initialValue: string
initialValue?: string
): [string, updateItem];
}

@@ -41,3 +41,4 @@ "use strict";

var getCookie = function getCookie(name, initialValue) {
var getCookie = function getCookie(name) {
var initialValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
return isBrowser && document.cookie.split('; ').reduce(function (r, v) {

@@ -44,0 +45,0 @@ var parts = v.split('=');

@@ -22,8 +22,8 @@ // Type definitions for react-use-cookie

export function getCookie(name: string, initialValue: string): string;
export function getCookie(name: string, initialValue?: string): string;
export default function(
key: string,
initialValue: string
initialValue?: string
): [string, updateItem];
}

@@ -28,3 +28,3 @@ import { useState } from 'react';

export const getCookie = (name, initialValue) => {
export const getCookie = (name, initialValue = '') => {
return (

@@ -31,0 +31,0 @@ (isBrowser &&

{
"name": "react-use-cookie",
"version": "1.2.0",
"version": "1.2.1",
"description": "A React hook for managing cookies with no dependencies.",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc