Socket
Socket
Sign inDemoInstall

@solid-primitives/storage

Package Overview
Dependencies
Maintainers
0
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-primitives/storage - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

16

dist/index/index.js

@@ -104,3 +104,4 @@ import { isServer, getRequestEvent, isDev } from 'solid-js/web';

function deserializeCookieOptions(cookie, key) {
return cookie.match(`(^|;)\\s*${key}\\s*=\\s*([^;]+)`)?.pop() ?? null;
const found = cookie.match(`(^|;)\\s*${key}\\s*=\\s*([^;]+)`)?.pop();
return found != null ? decodeURIComponent(found) : null;
}

@@ -126,3 +127,3 @@ var getRequestHeaders = isServer ? () => getRequestEvent()?.request?.headers || new Headers() : () => new Headers();

const responseHeaders = getResponseHeaders();
const currentCookies = responseHeaders?.get("Set-Cookie")?.split(", ")?.filter((cookie) => cookie && !cookie.startsWith(`${key}=`)) ?? [];
const currentCookies = responseHeaders.get("Set-Cookie")?.split(", ").filter((cookie) => cookie && !cookie.startsWith(`${key}=`)) ?? [];
responseHeaders.set(

@@ -137,6 +138,13 @@ "Set-Cookie",

setItem: (key, value, options) => {
cookieStorage._write(key, value, options);
cookieStorage._write(
key,
value.replace(/[\u00c0-\uffff\&;]/g, (c) => encodeURIComponent(c)),
options
);
},
removeItem: (key, options) => {
cookieStorage._write(key, "deleted", { ...options, expires: /* @__PURE__ */ new Date(0) });
cookieStorage._write(key, "deleted", {
...options,
expires: /* @__PURE__ */ new Date(0)
});
},

@@ -143,0 +151,0 @@ key: (index, options) => {

{
"name": "@solid-primitives/storage",
"version": "4.0.0",
"version": "4.1.0",
"description": "Primitive that provides reactive wrappers for storage access",

@@ -5,0 +5,0 @@ "author": "Alex Lohr <alex.lohr@logmein.com>",

@@ -102,2 +102,6 @@ <p>

> HTTP headers are limited to 32kb, each header itself is limited to 16kb. So depending on your current headers, the space in `cookieStorage` is rather small. If the overall space is exceeded, subsequent requests will fail. We have no mechanism to prevent that, since we cannot infer all headers that the browser will set.
> Browsers do not support most UTF8 and UTF16 characters in Cookies, so `cookieStorage` encodes those characters that are not supported using `encodeURIComponent`. To save space, only those characters not supported by all Browsers will be encoded.
#### LocalForage

@@ -104,0 +108,0 @@

Sorry, the diff of this file is not supported yet

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