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

@clerk/shared

Package Overview
Dependencies
Maintainers
8
Versions
1726
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clerk/shared - npm Package Compare versions

Comparing version 2.8.2-canary.v8ef124e to 2.8.2-canary.vcb32aaf

dist/chunk-I6MTSTOF.mjs

2

dist/apiUrlFromPublishableKey.d.ts

@@ -1,3 +0,3 @@

declare const apiUrlFromPublishableKey: (publishableKey: string) => "https://api.clerk.com" | "https://api.lclclerk.com" | "https://api.clerkstage.dev";
declare const apiUrlFromPublishableKey: (publishableKey: string) => "https://api.lclclerk.com" | "https://api.clerkstage.dev" | "https://api.clerk.com";
export { apiUrlFromPublishableKey };

@@ -9,3 +9,8 @@ declare const LEGACY_DEV_INSTANCE_SUFFIXES: string[];

declare const PROD_API_URL = "https://api.clerk.com";
/**
* Returns the URL for a static image
* using the new img.clerk.com service
*/
declare function iconImageUrl(id: string, format?: 'svg' | 'jpeg'): string;
export { CURRENT_DEV_INSTANCE_SUFFIXES, DEV_OR_STAGING_SUFFIXES, LEGACY_DEV_INSTANCE_SUFFIXES, LOCAL_API_URL, LOCAL_ENV_SUFFIXES, PROD_API_URL, STAGING_API_URL, STAGING_ENV_SUFFIXES };
export { CURRENT_DEV_INSTANCE_SUFFIXES, DEV_OR_STAGING_SUFFIXES, LEGACY_DEV_INSTANCE_SUFFIXES, LOCAL_API_URL, LOCAL_ENV_SUFFIXES, PROD_API_URL, STAGING_API_URL, STAGING_ENV_SUFFIXES, iconImageUrl };

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

STAGING_API_URL: () => STAGING_API_URL,
STAGING_ENV_SUFFIXES: () => STAGING_ENV_SUFFIXES
STAGING_ENV_SUFFIXES: () => STAGING_ENV_SUFFIXES,
iconImageUrl: () => iconImageUrl
});

@@ -52,2 +53,5 @@ module.exports = __toCommonJS(constants_exports);

var PROD_API_URL = "https://api.clerk.com";
function iconImageUrl(id, format = "svg") {
return `https://img.clerk.com/static/${id}.${format}`;
}
// Annotate the CommonJS export names for ESM import in node:

@@ -62,4 +66,5 @@ 0 && (module.exports = {

STAGING_API_URL,
STAGING_ENV_SUFFIXES
STAGING_ENV_SUFFIXES,
iconImageUrl
});
//# sourceMappingURL=constants.js.map

@@ -5,3 +5,3 @@ export { apiUrlFromPublishableKey } from './apiUrlFromPublishableKey.js';

export { colorToSameTypeString, hasAlpha, hexStringToRgbaColor, isHSLColor, isRGBColor, isTransparent, isValidHexString, isValidHslaString, isValidRgbaString, stringToHslaColor, stringToSameTypeColor } from './color.js';
export { CURRENT_DEV_INSTANCE_SUFFIXES, DEV_OR_STAGING_SUFFIXES, LEGACY_DEV_INSTANCE_SUFFIXES, LOCAL_API_URL, LOCAL_ENV_SUFFIXES, PROD_API_URL, STAGING_API_URL, STAGING_ENV_SUFFIXES } from './constants.js';
export { CURRENT_DEV_INSTANCE_SUFFIXES, DEV_OR_STAGING_SUFFIXES, LEGACY_DEV_INSTANCE_SUFFIXES, LOCAL_API_URL, LOCAL_ENV_SUFFIXES, PROD_API_URL, STAGING_API_URL, STAGING_ENV_SUFFIXES, iconImageUrl } from './constants.js';
export { RelativeDateCase, addYears, dateTo12HourTime, differenceInCalendarDays, formatRelative, normalizeDate } from './date.js';

@@ -8,0 +8,0 @@ export { deprecated, deprecatedObjectProperty, deprecatedProperty } from './deprecated.js';

@@ -77,2 +77,3 @@ "use strict";

hexStringToRgbaColor: () => hexStringToRgbaColor,
iconImageUrl: () => iconImageUrl,
inBrowser: () => inBrowser,

@@ -261,2 +262,5 @@ is4xxError: () => is4xxError,

var PROD_API_URL = "https://api.clerk.com";
function iconImageUrl(id, format = "svg") {
return `https://img.clerk.com/static/${id}.${format}`;
}

@@ -1126,3 +1130,3 @@ // src/isomorphicAtob.ts

// src/versionSelector.ts
var versionSelector = (clerkJSVersion, packageVersion = "5.22.4-canary.v8ef124e") => {
var versionSelector = (clerkJSVersion, packageVersion = "5.22.4-canary.vcb32aaf") => {
if (clerkJSVersion) {

@@ -1134,3 +1138,3 @@ return clerkJSVersion;

if (prereleaseTag === "snapshot") {
return "5.22.4-canary.v8ef124e";
return "5.22.4-canary.vcb32aaf";
}

@@ -1643,2 +1647,3 @@ return prereleaseTag;

hexStringToRgbaColor,
iconImageUrl,
inBrowser,

@@ -1645,0 +1650,0 @@ is4xxError,

@@ -228,3 +228,3 @@ "use strict";

// src/versionSelector.ts
var versionSelector = (clerkJSVersion, packageVersion = "5.22.4-canary.v8ef124e") => {
var versionSelector = (clerkJSVersion, packageVersion = "5.22.4-canary.vcb32aaf") => {
if (clerkJSVersion) {

@@ -236,3 +236,3 @@ return clerkJSVersion;

if (prereleaseTag === "snapshot") {
return "5.22.4-canary.v8ef124e";
return "5.22.4-canary.vcb32aaf";
}

@@ -239,0 +239,0 @@ return prereleaseTag;

@@ -0,3 +1,81 @@

interface ParseOptions {
/**
* Set the default delimiter for repeat parameters. (default: `'/'`)
*/
delimiter?: string;
/**
* List of characters to automatically consider prefixes when parsing.
*/
prefixes?: string;
}
interface RegexpToFunctionOptions {
/**
* Function for decoding strings for params.
*/
decode?: (value: string, token: Key) => string;
}
/**
* A match result contains data about the path match.
*/
interface MatchResult<P extends object = object> {
path: string;
index: number;
params: P;
}
/**
* A match is either `false` (no match) or a match result.
*/
type Match<P extends object = object> = false | MatchResult<P>;
/**
* The match function takes a string and returns whether it matched the path.
*/
type MatchFunction<P extends object = object> = (path: string) => Match<P>;
/**
* Metadata about a key.
*/
interface Key {
name: string | number;
prefix: string;
suffix: string;
pattern: string;
modifier: string;
}
interface TokensToRegexpOptions {
/**
* When `true` the regexp will be case sensitive. (default: `false`)
*/
sensitive?: boolean;
/**
* When `true` the regexp won't allow an optional trailing delimiter to match. (default: `false`)
*/
strict?: boolean;
/**
* When `true` the regexp will match to the end of the string. (default: `true`)
*/
end?: boolean;
/**
* When `true` the regexp will match from the beginning of the string. (default: `true`)
*/
start?: boolean;
/**
* Sets the final character for non-ending optimistic matches. (default: `/`)
*/
delimiter?: string;
/**
* List of characters that can also be "end" characters.
*/
endsWith?: string;
/**
* Encode path tokens for use in the `RegExp`.
*/
encode?: (value: string) => string;
}
/**
* Supported `path-to-regexp` input types.
*/
type Path = string | RegExp | Array<string | RegExp>;
declare const pathToRegexp: (path: string) => RegExp;
declare function match<P extends object = object>(str: Path, options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions): MatchFunction<P>;
export { pathToRegexp };
export { type Match, type MatchFunction, match, pathToRegexp };

@@ -23,2 +23,3 @@ "use strict";

__export(pathToRegexp_exports, {
match: () => match,
pathToRegexp: () => pathToRegexp

@@ -31,24 +32,40 @@ });

for (var n = [], e = 0; e < r.length; ) {
var t = r[e];
if (t === "*" || t === "+" || t === "?") {
n.push({ type: "MODIFIER", index: e, value: r[e++] });
var a = r[e];
if (a === "*" || a === "+" || a === "?") {
n.push({
type: "MODIFIER",
index: e,
value: r[e++]
});
continue;
}
if (t === "\\") {
n.push({ type: "ESCAPED_CHAR", index: e++, value: r[e++] });
if (a === "\\") {
n.push({
type: "ESCAPED_CHAR",
index: e++,
value: r[e++]
});
continue;
}
if (t === "{") {
n.push({ type: "OPEN", index: e, value: r[e++] });
if (a === "{") {
n.push({
type: "OPEN",
index: e,
value: r[e++]
});
continue;
}
if (t === "}") {
n.push({ type: "CLOSE", index: e, value: r[e++] });
if (a === "}") {
n.push({
type: "CLOSE",
index: e,
value: r[e++]
});
continue;
}
if (t === ":") {
for (var u = "", a = e + 1; a < r.length; ) {
var f = r.charCodeAt(a);
if (f >= 48 && f <= 57 || f >= 65 && f <= 90 || f >= 97 && f <= 122 || f === 95) {
u += r[a++];
if (a === ":") {
for (var u = "", t = e + 1; t < r.length; ) {
var c = r.charCodeAt(t);
if (c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || c === 95) {
u += r[t++];
continue;

@@ -58,81 +75,99 @@ }

}
if (!u) {
throw new TypeError("Missing parameter name at ".concat(e));
}
n.push({ type: "NAME", index: e, value: u }), e = a;
if (!u) throw new TypeError("Missing parameter name at ".concat(e));
n.push({
type: "NAME",
index: e,
value: u
}), e = t;
continue;
}
if (t === "(") {
var l = 1, d = "", a = e + 1;
if (r[a] === "?") {
throw new TypeError('Pattern cannot start with "?" at '.concat(a));
}
for (; a < r.length; ) {
if (r[a] === "\\") {
d += r[a++] + r[a++];
if (a === "(") {
var o = 1, m = "", t = e + 1;
if (r[t] === "?") throw new TypeError('Pattern cannot start with "?" at '.concat(t));
for (; t < r.length; ) {
if (r[t] === "\\") {
m += r[t++] + r[t++];
continue;
}
if (r[a] === ")") {
if (l--, l === 0) {
a++;
if (r[t] === ")") {
if (o--, o === 0) {
t++;
break;
}
} else if (r[a] === "(" && (l++, r[a + 1] !== "?")) {
throw new TypeError("Capturing groups are not allowed at ".concat(a));
}
d += r[a++];
} else if (r[t] === "(" && (o++, r[t + 1] !== "?"))
throw new TypeError("Capturing groups are not allowed at ".concat(t));
m += r[t++];
}
if (l) {
throw new TypeError("Unbalanced pattern at ".concat(e));
}
if (!d) {
throw new TypeError("Missing pattern at ".concat(e));
}
n.push({ type: "PATTERN", index: e, value: d }), e = a;
if (o) throw new TypeError("Unbalanced pattern at ".concat(e));
if (!m) throw new TypeError("Missing pattern at ".concat(e));
n.push({
type: "PATTERN",
index: e,
value: m
}), e = t;
continue;
}
n.push({ type: "CHAR", index: e, value: r[e++] });
n.push({
type: "CHAR",
index: e,
value: r[e++]
});
}
return n.push({ type: "END", index: e, value: "" }), n;
return n.push({
type: "END",
index: e,
value: ""
}), n;
}
function D(r, n) {
function F(r, n) {
n === void 0 && (n = {});
for (var e = _(r), t = n.prefixes, u = t === void 0 ? "./" : t, a = "[^".concat(y(n.delimiter || "/#?"), "]+?"), f = [], l = 0, d = 0, p = "", c = function(v) {
if (d < e.length && e[d].type === v) {
return e[d++].value;
for (var e = _(r), a = n.prefixes, u = a === void 0 ? "./" : a, t = n.delimiter, c = t === void 0 ? "/#?" : t, o = [], m = 0, h = 0, p = "", f = function(l) {
if (h < e.length && e[h].type === l) return e[h++].value;
}, w = function(l) {
var v = f(l);
if (v !== void 0) return v;
var E = e[h], N = E.type, S = E.index;
throw new TypeError("Unexpected ".concat(N, " at ").concat(S, ", expected ").concat(l));
}, d = function() {
for (var l = "", v; v = f("CHAR") || f("ESCAPED_CHAR"); ) l += v;
return l;
}, M = function(l) {
for (var v = 0, E = c; v < E.length; v++) {
var N = E[v];
if (l.indexOf(N) > -1) return true;
}
}, w = function(v) {
var g = c(v);
if (g !== void 0) {
return g;
}
var h = e[d], b = h.type, N = h.index;
throw new TypeError("Unexpected ".concat(b, " at ").concat(N, ", expected ").concat(v));
}, A = function() {
for (var v = "", g; g = c("CHAR") || c("ESCAPED_CHAR"); ) {
v += g;
}
return v;
}; d < e.length; ) {
var s = c("CHAR"), C = c("NAME"), E = c("PATTERN");
if (C || E) {
var x = s || "";
u.indexOf(x) === -1 && (p += x, x = ""), p && (f.push(p), p = ""), f.push({ name: C || l++, prefix: x, suffix: "", pattern: E || a, modifier: c("MODIFIER") || "" });
return false;
}, A = function(l) {
var v = o[o.length - 1], E = l || (v && typeof v == "string" ? v : "");
if (v && !E)
throw new TypeError('Must have text between two parameters, missing text after "'.concat(v.name, '"'));
return !E || M(E) ? "[^".concat(s(c), "]+?") : "(?:(?!".concat(s(E), ")[^").concat(s(c), "])+?");
}; h < e.length; ) {
var T = f("CHAR"), x = f("NAME"), C = f("PATTERN");
if (x || C) {
var g = T || "";
u.indexOf(g) === -1 && (p += g, g = ""), p && (o.push(p), p = ""), o.push({
name: x || m++,
prefix: g,
suffix: "",
pattern: C || A(g),
modifier: f("MODIFIER") || ""
});
continue;
}
var o = s || c("ESCAPED_CHAR");
if (o) {
p += o;
var i = T || f("ESCAPED_CHAR");
if (i) {
p += i;
continue;
}
p && (f.push(p), p = "");
var R = c("OPEN");
p && (o.push(p), p = "");
var R = f("OPEN");
if (R) {
var x = A(), T = c("NAME") || "", i = c("PATTERN") || "", m = A();
w("CLOSE"), f.push({
name: T || (i ? l++ : ""),
pattern: T && !i ? a : i,
prefix: x,
suffix: m,
modifier: c("MODIFIER") || ""
var g = d(), y = f("NAME") || "", O = f("PATTERN") || "", b = d();
w("CLOSE"), o.push({
name: y || (O ? m++ : ""),
pattern: y && !O ? A(g) : O,
prefix: g,
suffix: b,
modifier: f("MODIFIER") || ""
});

@@ -143,64 +178,90 @@ continue;

}
return f;
return o;
}
function y(r) {
function H(r, n) {
var e = [], a = P(r, e, n);
return I(a, e, n);
}
function I(r, n, e) {
e === void 0 && (e = {});
var a = e.decode, u = a === void 0 ? function(t) {
return t;
} : a;
return function(t) {
var c = r.exec(t);
if (!c) return false;
for (var o = c[0], m = c.index, h = /* @__PURE__ */ Object.create(null), p = function(w) {
if (c[w] === void 0) return "continue";
var d = n[w - 1];
d.modifier === "*" || d.modifier === "+" ? h[d.name] = c[w].split(d.prefix + d.suffix).map(function(M) {
return u(M, d);
}) : h[d.name] = u(c[w], d);
}, f = 1; f < c.length; f++)
p(f);
return {
path: o,
index: m,
params: h
};
};
}
function s(r) {
return r.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
}
function O(r) {
function D(r) {
return r && r.sensitive ? "" : "i";
}
function M(r, n) {
if (!n) {
return r;
}
for (var e = /\((?:\?<(.*?)>)?(?!\?)/g, t = 0, u = e.exec(r.source); u; ) {
n.push({ name: u[1] || t++, prefix: "", suffix: "", modifier: "", pattern: "" }), u = e.exec(r.source);
}
function $(r, n) {
if (!n) return r;
for (var e = /\((?:\?<(.*?)>)?(?!\?)/g, a = 0, u = e.exec(r.source); u; )
n.push({
name: u[1] || a++,
prefix: "",
suffix: "",
modifier: "",
pattern: ""
}), u = e.exec(r.source);
return r;
}
function S(r, n, e) {
var t = r.map(function(u) {
function W(r, n, e) {
var a = r.map(function(u) {
return P(u, n, e).source;
});
return new RegExp("(?:".concat(t.join("|"), ")"), O(e));
return new RegExp("(?:".concat(a.join("|"), ")"), D(e));
}
function F(r, n, e) {
return H(D(r, e), n, e);
function L(r, n, e) {
return U(F(r, e), n, e);
}
function H(r, n, e) {
function U(r, n, e) {
e === void 0 && (e = {});
for (var t = e.strict, u = t === void 0 ? false : t, a = e.start, f = a === void 0 ? true : a, l = e.end, d = l === void 0 ? true : l, p = e.encode, c = p === void 0 ? function(N) {
return N;
} : p, w = e.delimiter, A = w === void 0 ? "/#?" : w, s = e.endsWith, C = s === void 0 ? "" : s, E = "[".concat(y(C), "]|$"), x = "[".concat(y(A), "]"), o = f ? "^" : "", R = 0, T = r; R < T.length; R++) {
var i = T[R];
if (typeof i == "string") {
o += y(c(i));
} else {
var m = y(c(i.prefix)), v = y(c(i.suffix));
if (i.pattern) {
if (n && n.push(i), m || v) {
for (var a = e.strict, u = a === void 0 ? false : a, t = e.start, c = t === void 0 ? true : t, o = e.end, m = o === void 0 ? true : o, h = e.encode, p = h === void 0 ? function(v) {
return v;
} : h, f = e.delimiter, w = f === void 0 ? "/#?" : f, d = e.endsWith, M = d === void 0 ? "" : d, A = "[".concat(s(M), "]|$"), T = "[".concat(s(w), "]"), x = c ? "^" : "", C = 0, g = r; C < g.length; C++) {
var i = g[C];
if (typeof i == "string") x += s(p(i));
else {
var R = s(p(i.prefix)), y = s(p(i.suffix));
if (i.pattern)
if (n && n.push(i), R || y)
if (i.modifier === "+" || i.modifier === "*") {
var g = i.modifier === "*" ? "?" : "";
o += "(?:".concat(m, "((?:").concat(i.pattern, ")(?:").concat(v).concat(m, "(?:").concat(i.pattern, "))*)").concat(v, ")").concat(g);
} else {
o += "(?:".concat(m, "(").concat(i.pattern, ")").concat(v, ")").concat(i.modifier);
}
} else {
i.modifier === "+" || i.modifier === "*" ? o += "((?:".concat(i.pattern, ")").concat(i.modifier, ")") : o += "(".concat(i.pattern, ")").concat(i.modifier);
var O = i.modifier === "*" ? "?" : "";
x += "(?:".concat(R, "((?:").concat(i.pattern, ")(?:").concat(y).concat(R, "(?:").concat(i.pattern, "))*)").concat(y, ")").concat(O);
} else x += "(?:".concat(R, "(").concat(i.pattern, ")").concat(y, ")").concat(i.modifier);
else {
if (i.modifier === "+" || i.modifier === "*")
throw new TypeError('Can not repeat "'.concat(i.name, '" without a prefix and suffix'));
x += "(".concat(i.pattern, ")").concat(i.modifier);
}
} else {
o += "(?:".concat(m).concat(v, ")").concat(i.modifier);
}
else x += "(?:".concat(R).concat(y, ")").concat(i.modifier);
}
}
if (d) {
u || (o += "".concat(x, "?")), o += e.endsWith ? "(?=".concat(E, ")") : "$";
} else {
var h = r[r.length - 1], b = typeof h == "string" ? x.indexOf(h[h.length - 1]) > -1 : h === void 0;
u || (o += "(?:".concat(x, "(?=").concat(E, "))?")), b || (o += "(?=".concat(x, "|").concat(E, ")"));
if (m) u || (x += "".concat(T, "?")), x += e.endsWith ? "(?=".concat(A, ")") : "$";
else {
var b = r[r.length - 1], l = typeof b == "string" ? T.indexOf(b[b.length - 1]) > -1 : b === void 0;
u || (x += "(?:".concat(T, "(?=").concat(A, "))?")), l || (x += "(?=".concat(T, "|").concat(A, ")"));
}
return new RegExp(o, O(e));
return new RegExp(x, D(e));
}
function P(r, n, e) {
return r instanceof RegExp ? M(r, n) : Array.isArray(r) ? S(r, n, e) : F(r, n, e);
return r instanceof RegExp ? $(r, n) : Array.isArray(r) ? W(r, n, e) : L(r, n, e);
}

@@ -215,3 +276,3 @@

`Invalid path: ${path}.
Consult the documentation of path-to-regexp here: https://github.com/pillarjs/path-to-regexp
Consult the documentation of path-to-regexp here: https://github.com/pillarjs/path-to-regexp/tree/6.x
${e.message}`

@@ -221,6 +282,17 @@ );

};
function match(str, options) {
try {
return H(str, options);
} catch (e) {
throw new Error(
`Invalid path and options: Consult the documentation of path-to-regexp here: https://github.com/pillarjs/path-to-regexp/tree/6.x
${e.message}`
);
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
match,
pathToRegexp
});
//# sourceMappingURL=pathToRegexp.js.map

@@ -27,3 +27,3 @@ "use strict";

module.exports = __toCommonJS(versionSelector_exports);
var versionSelector = (clerkJSVersion, packageVersion = "5.22.4-canary.v8ef124e") => {
var versionSelector = (clerkJSVersion, packageVersion = "5.22.4-canary.vcb32aaf") => {
if (clerkJSVersion) {

@@ -35,3 +35,3 @@ return clerkJSVersion;

if (prereleaseTag === "snapshot") {
return "5.22.4-canary.v8ef124e";
return "5.22.4-canary.vcb32aaf";
}

@@ -38,0 +38,0 @@ return prereleaseTag;

{
"name": "@clerk/shared",
"version": "2.8.2-canary.v8ef124e",
"version": "2.8.2-canary.vcb32aaf",
"description": "Internal package utils used by the Clerk SDKs",

@@ -98,3 +98,3 @@ "repository": {

"dependencies": {
"@clerk/types": "4.21.1-canary.v8ef124e",
"@clerk/types": "4.21.1-canary.vcb32aaf",
"glob-to-regexp": "0.4.1",

@@ -101,0 +101,0 @@ "js-cookie": "3.0.5",

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

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

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

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

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

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

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

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