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

next-persist

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-persist - npm Package Compare versions

Comparing version 1.2.1-alpha.1 to 1.2.1-alpha.2

2

lib/esm/getCookieProps.d.ts

@@ -5,3 +5,3 @@ import { NextPageContext } from 'next';

}
export default function getCookieStore(ctx: NextPageContext): LooseObject | string;
export declare function getCookieProps(ctx: NextPageContext): LooseObject | string;
export {};

@@ -12,3 +12,3 @@ /**

import cookie from 'cookie';
export default function getCookieStore(ctx) {
export function getCookieProps(ctx) {
// checking if running on build or request

@@ -15,0 +15,0 @@ if (ctx.req === undefined)

@@ -13,3 +13,3 @@ /**

}
export default function getCookieStore(key: string, state: LooseObject): LooseObject;
export declare function getCookieStore(key: string, state: LooseObject): LooseObject;
export {};

@@ -11,5 +11,5 @@ /**

import jsCookie from 'js-cookie';
export default function getCookieStore(key, state) {
export function getCookieStore(key, state) {
var stateFromCookie = jsCookie.get(key);
return stateFromCookie ? JSON.parse(stateFromCookie) : state;
}

@@ -13,3 +13,3 @@ /**

}
export default function getLocalStore(key: string, state: LooseObject): LooseObject;
export declare function getLocalStore(key: string, state: LooseObject): LooseObject;
export {};

@@ -21,3 +21,3 @@ /**

};
export default function getLocalStore(key, state) {
export function getLocalStore(key, state) {
// if application is running client-side, localStorage is accessible

@@ -24,0 +24,0 @@ if (typeof window !== 'undefined') {

@@ -24,4 +24,3 @@ /**

}
declare type NextPersistWrapper = (props: WrapperProps) => React.ReactNode;
declare const NextPersistWrapper: (props: WrapperProps) => React.ReactNode;
export default NextPersistWrapper;

@@ -14,4 +14,5 @@ /**

import { useSelector } from 'react-redux';
import setCookieStore from './setCookieStore';
import setLocalStore from './setLocalStore';
import { setCookieStore } from './setCookieStore';
import { setLocalStore } from './setLocalStore';
// type NextPersistWrapper = (props: WrapperProps) => React.ReactNode;
var NextPersistWrapper = function (props) {

@@ -18,0 +19,0 @@ var state = useSelector(function (state) { return state; });

@@ -16,3 +16,3 @@ /**

}
export default function setCookieStore(config: AllowListObject, state: LooseObject): void;
export declare function setCookieStore(config: AllowListObject, state: LooseObject): void;
export {};

@@ -11,3 +11,3 @@ /**

import jsCookie from 'js-cookie';
export default function setCookieStore(config, state) {
export function setCookieStore(config, state) {
var key = Object.keys(config)[0];

@@ -14,0 +14,0 @@ var allowList = Object.values(config)[0];

@@ -16,5 +16,5 @@ /**

}
export default function setLocalStore(config: AllowListObject, state: LooseObject): void | {
export declare function setLocalStore(config: AllowListObject, state: LooseObject): void | {
[key: string]: string;
};
export {};

@@ -10,3 +10,3 @@ /**

*/
export default function setLocalStore(config, state) {
export function setLocalStore(config, state) {
var key = Object.keys(config)[0];

@@ -13,0 +13,0 @@ var allowList = Object.values(config)[0];

{
"name": "next-persist",
"version": "1.2.1-alpha.1",
"version": "1.2.1-alpha.2",
"description": "Bridging the gap between client-side persistence and server-side rendering",
"main": "./lib/esm/index.js",
"types": "./types/nextpersist.d.ts",
"scripts": {

@@ -8,0 +7,0 @@ "test": "jest",

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