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

@supabase/ssr

Package Overview
Dependencies
Maintainers
7
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@supabase/ssr - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

13

dist/index.d.ts

@@ -32,2 +32,13 @@ import * as _supabase_supabase_js from '@supabase/supabase-js';

export { CookieMethods, CookieOptions, CookieOptionsWithName, DEFAULT_COOKIE_OPTIONS, createBrowserClient, createServerClient, isBrowser };
interface Chunk {
name: string;
value: string;
}
/**
* create chunks from a string and return an array of object
*/
declare function createChunks(key: string, value: string, chunkSize?: number): Chunk[];
declare function combineChunks(key: string, retrieveChunk?: (name: string) => string | null | undefined): string | null;
declare function deleteChunks(key: string, retrieveChunk?: (name: string) => string | null | undefined, removeChunk?: (name: string) => void): void;
export { CookieMethods, CookieOptions, CookieOptionsWithName, DEFAULT_COOKIE_OPTIONS, combineChunks, createBrowserClient, createChunks, createServerClient, deleteChunks, isBrowser };

@@ -24,4 +24,7 @@ "use strict";

DEFAULT_COOKIE_OPTIONS: () => DEFAULT_COOKIE_OPTIONS,
combineChunks: () => combineChunks,
createBrowserClient: () => createBrowserClient,
createChunks: () => createChunks,
createServerClient: () => createServerClient,
deleteChunks: () => deleteChunks,
isBrowser: () => isBrowser,

@@ -50,2 +53,62 @@ parse: () => import_cookie.parse,

// src/utils/chunker.ts
function createChunkRegExp(chunkSize) {
return new RegExp(".{1," + chunkSize + "}", "g");
}
var MAX_CHUNK_SIZE = 3600;
var MAX_CHUNK_REGEXP = createChunkRegExp(MAX_CHUNK_SIZE);
function createChunks(key, value, chunkSize) {
const re = chunkSize !== void 0 ? createChunkRegExp(chunkSize) : MAX_CHUNK_REGEXP;
const chunkCount = Math.ceil(value.length / (chunkSize ?? MAX_CHUNK_SIZE));
if (chunkCount === 1) {
return [{ name: key, value }];
}
const chunks = [];
const values = value.match(re);
values == null ? void 0 : values.forEach((value2, i) => {
const name = `${key}.${i}`;
chunks.push({ name, value: value2 });
});
return chunks;
}
function combineChunks(key, retrieveChunk = () => {
return null;
}) {
const value = retrieveChunk(key);
if (key.endsWith("-code-verifier") && value) {
return value;
}
if (value) {
return value;
}
let values = [];
for (let i = 0; ; i++) {
const chunkName = `${key}.${i}`;
const chunk = retrieveChunk(chunkName);
if (!chunk) {
break;
}
values.push(chunk);
}
return values.length ? values.join("") : null;
}
function deleteChunks(key, retrieveChunk = () => {
return null;
}, removeChunk = () => {
}) {
const value = retrieveChunk(key);
if (value) {
removeChunk(key);
return;
}
for (let i = 0; ; i++) {
const chunkName = `${key}.${i}`;
const chunk = retrieveChunk(chunkName);
if (!chunk) {
break;
}
removeChunk(chunkName);
}
}
// src/createBrowserClient.ts

@@ -74,3 +137,3 @@ var import_cookie2 = require("cookie");

headers: {
"X-Client-Info": `${"@supabase/ssr"}@${"0.0.4"}`
"X-Client-Info": `${"@supabase/ssr"}@${"0.0.5"}`
}

@@ -167,3 +230,3 @@ },

headers: {
"X-Client-Info": `${"@supabase/ssr"}@${"0.0.4"}`
"X-Client-Info": `${"@supabase/ssr"}@${"0.0.5"}`
}

@@ -208,4 +271,7 @@ },

DEFAULT_COOKIE_OPTIONS,
combineChunks,
createBrowserClient,
createChunks,
createServerClient,
deleteChunks,
isBrowser,

@@ -212,0 +278,0 @@ parse,

7

package.json
{
"name": "@supabase/ssr",
"version": "0.0.4",
"version": "0.0.5",
"main": "dist/index.js",

@@ -40,2 +40,3 @@ "module": "dist/index.mjs",

"tsup": "^6.7.0",
"vitest": "^0.34.6",
"tsconfig": "0.1.1"

@@ -48,4 +49,6 @@ },

"lint": "tsc",
"build": "tsup"
"build": "tsup",
"test": "vitest run",
"test:watch": "vitest"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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