docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:27:07 +08:00
1 parent fa9c73363d
commit 2a69b23b47
18210 files changed
+5101211 -16

No files matched your search

@@ -0,0 +1 @@
{"version":3,"file":"scale-correction.mjs","sources":["../../../../src/projection/styles/scale-correction.ts"],"sourcesContent":["import { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport { correctBorderRadius } from \"./scale-border-radius\"\nimport { correctBoxShadow } from \"./scale-box-shadow\"\nimport type { ScaleCorrectorMap } from \"./types\"\n\nexport const scaleCorrectors: ScaleCorrectorMap = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n}\n\nexport function addScaleCorrector(correctors: ScaleCorrectorMap) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key]\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true\n }\n }\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,eAAe,GAAsB;AAC9C,IAAA,YAAY,EAAE;AACV,QAAA,GAAG,mBAAmB;AACtB,QAAA,OAAO,EAAE;YACL,qBAAqB;YACrB,sBAAsB;YACtB,wBAAwB;YACxB,yBAAyB;AAC5B,SAAA;AACJ,KAAA;AACD,IAAA,mBAAmB,EAAE,mBAAmB;AACxC,IAAA,oBAAoB,EAAE,mBAAmB;AACzC,IAAA,sBAAsB,EAAE,mBAAmB;AAC3C,IAAA,uBAAuB,EAAE,mBAAmB;AAC5C,IAAA,SAAS,EAAE,gBAAgB;;AAGzB,SAAU,iBAAiB,CAAC,UAA6B,EAAA;AAC3D,IAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;QAC1B,eAAe,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC;AACtC,QAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE;AACxB,YAAA,eAAe,CAAC,GAAG,CAAC,CAAC,aAAa,GAAG,IAAI;QAC7C;IACJ;AACJ;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"timer-off.js","sources":["../../../src/icons/timer-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TimerOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgMmg0IiAvPgogIDxwYXRoIGQ9Ik00LjYgMTFhOCA4IDAgMCAwIDEuNyA4LjcgOCA4IDAgMCAwIDguNyAxLjciIC8+CiAgPHBhdGggZD0iTTcuNCA3LjRhOCA4IDAgMCAxIDEwLjMgMSA4IDggMCAwIDEgLjkgMTAuMiIgLz4KICA8cGF0aCBkPSJtMiAyIDIwIDIwIiAvPgogIDxwYXRoIGQ9Ik0xMiAxMnYtMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/timer-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst TimerOff = createLucideIcon('TimerOff', [\n ['path', { d: 'M10 2h4', key: 'n1abiw' }],\n ['path', { d: 'M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7', key: '10he05' }],\n ['path', { d: 'M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2', key: '15f7sh' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n ['path', { d: 'M12 12v-2', key: 'fwoke6' }],\n]);\n\nexport default TimerOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,42 @@
/**
* This module was automatically generated by `ts-interface-builder`
*/
import * as t from "ts-interface-checker";
// tslint:disable:object-literal-key-quotes
export const Transform = t.union(
t.lit("jsx"),
t.lit("typescript"),
t.lit("flow"),
t.lit("imports"),
t.lit("react-hot-loader"),
t.lit("jest"),
);
export const SourceMapOptions = t.iface([], {
compiledFilename: "string",
});
export const Options = t.iface([], {
transforms: t.array("Transform"),
disableESTransforms: t.opt("boolean"),
jsxRuntime: t.opt(t.union(t.lit("classic"), t.lit("automatic"), t.lit("preserve"))),
production: t.opt("boolean"),
jsxImportSource: t.opt("string"),
jsxPragma: t.opt("string"),
jsxFragmentPragma: t.opt("string"),
keepUnusedImports: t.opt("boolean"),
preserveDynamicImport: t.opt("boolean"),
injectCreateRequireForImportRequire: t.opt("boolean"),
enableLegacyTypeScriptModuleInterop: t.opt("boolean"),
enableLegacyBabel5ModuleInterop: t.opt("boolean"),
sourceMapOptions: t.opt("SourceMapOptions"),
filePath: t.opt("string"),
});
const exportedTypeSuite = {
Transform,
SourceMapOptions,
Options,
};
export default exportedTypeSuite;
@@ -0,0 +1,958 @@
import { expect, expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
import type { util } from "zod/v4/core";
test("z.boolean", () => {
const a = z.boolean();
expect(z.parse(a, true)).toEqual(true);
expect(z.parse(a, false)).toEqual(false);
expect(() => z.parse(a, 123)).toThrow();
expect(() => z.parse(a, "true")).toThrow();
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<boolean>();
});
test("z.bigint", () => {
const a = z.bigint();
expect(z.parse(a, BigInt(123))).toEqual(BigInt(123));
expect(() => z.parse(a, 123)).toThrow();
expect(() => z.parse(a, "123")).toThrow();
});
test("z.symbol", () => {
const a = z.symbol();
const sym = Symbol();
expect(z.parse(a, sym)).toEqual(sym);
expect(() => z.parse(a, "symbol")).toThrow();
});
test("z.date", () => {
const a = z.date();
const date = new Date();
expect(z.parse(a, date)).toEqual(date);
expect(() => z.parse(a, "date")).toThrow();
});
test("z.coerce.string", () => {
const a = z.coerce.string();
expect(z.parse(a, 123)).toEqual("123");
expect(z.parse(a, true)).toEqual("true");
expect(z.parse(a, null)).toEqual("null");
expect(z.parse(a, undefined)).toEqual("undefined");
});
test("z.coerce.number", () => {
const a = z.coerce.number();
expect(z.parse(a, "123")).toEqual(123);
expect(z.parse(a, "123.45")).toEqual(123.45);
expect(z.parse(a, true)).toEqual(1);
expect(z.parse(a, false)).toEqual(0);
expect(() => z.parse(a, "abc")).toThrow();
});
test("z.coerce.boolean", () => {
const a = z.coerce.boolean();
// test booleans
expect(z.parse(a, true)).toEqual(true);
expect(z.parse(a, false)).toEqual(false);
expect(z.parse(a, "true")).toEqual(true);
expect(z.parse(a, "false")).toEqual(true);
expect(z.parse(a, 1)).toEqual(true);
expect(z.parse(a, 0)).toEqual(false);
expect(z.parse(a, {})).toEqual(true);
expect(z.parse(a, [])).toEqual(true);
expect(z.parse(a, undefined)).toEqual(false);
expect(z.parse(a, null)).toEqual(false);
expect(z.parse(a, "")).toEqual(false);
});
test("z.coerce.bigint", () => {
const a = z.coerce.bigint();
expect(z.parse(a, "123")).toEqual(BigInt(123));
expect(z.parse(a, 123)).toEqual(BigInt(123));
expect(() => z.parse(a, "abc")).toThrow();
});
test("z.coerce.date", () => {
const a = z.coerce.date();
const date = new Date();
expect(z.parse(a, date.toISOString())).toEqual(date);
expect(z.parse(a, date.getTime())).toEqual(date);
expect(() => z.parse(a, "invalid date")).toThrow();
});
test("z.iso.datetime", () => {
const d1 = "2021-01-01T00:00:00Z";
const d2 = "2021-01-01T00:00:00.123Z";
const d3 = "2021-01-01T00:00:00";
const d4 = "2021-01-01T00:00:00+07:00";
const d5 = "bad data";
// local: false, offset: false, precision: null
const a = z.iso.datetime();
expect(z.safeParse(a, d1).success).toEqual(true);
expect(z.safeParse(a, d2).success).toEqual(true);
expect(z.safeParse(a, d3).success).toEqual(false);
expect(z.safeParse(a, d4).success).toEqual(false);
expect(z.safeParse(a, d5).success).toEqual(false);
const b = z.iso.datetime({ local: true });
expect(z.safeParse(b, d1).success).toEqual(true);
expect(z.safeParse(b, d2).success).toEqual(true);
expect(z.safeParse(b, d3).success).toEqual(true);
expect(z.safeParse(b, d4).success).toEqual(false);
expect(z.safeParse(b, d5).success).toEqual(false);
const c = z.iso.datetime({ offset: true });
expect(z.safeParse(c, d1).success).toEqual(true);
expect(z.safeParse(c, d2).success).toEqual(true);
expect(z.safeParse(c, d3).success).toEqual(false);
expect(z.safeParse(c, d4).success).toEqual(true);
expect(z.safeParse(c, d5).success).toEqual(false);
const d = z.iso.datetime({ precision: 3 });
expect(z.safeParse(d, d1).success).toEqual(false);
expect(z.safeParse(d, d2).success).toEqual(true);
expect(z.safeParse(d, d3).success).toEqual(false);
expect(z.safeParse(d, d4).success).toEqual(false);
expect(z.safeParse(d, d5).success).toEqual(false);
});
test("z.iso.date", () => {
const d1 = "2021-01-01";
const d2 = "bad data";
const a = z.iso.date();
expect(z.safeParse(a, d1).success).toEqual(true);
expect(z.safeParse(a, d2).success).toEqual(false);
const b = z.string().check(z.iso.date());
expect(z.safeParse(b, d1).success).toEqual(true);
expect(z.safeParse(b, d2).success).toEqual(false);
});
test("z.iso.time", () => {
const d1 = "00:00:00";
const d2 = "00:00:00.123";
const d3 = "bad data";
const a = z.iso.time();
expect(z.safeParse(a, d1).success).toEqual(true);
expect(z.safeParse(a, d2).success).toEqual(true);
expect(z.safeParse(a, d3).success).toEqual(false);
const b = z.iso.time({ precision: 3 });
expect(z.safeParse(b, d1).success).toEqual(false);
expect(z.safeParse(b, d2).success).toEqual(true);
expect(z.safeParse(b, d3).success).toEqual(false);
const c = z.string().check(z.iso.time());
expect(z.safeParse(c, d1).success).toEqual(true);
expect(z.safeParse(c, d2).success).toEqual(true);
expect(z.safeParse(c, d3).success).toEqual(false);
});
test("z.iso.duration", () => {
const d1 = "P3Y6M4DT12H30M5S";
const d2 = "bad data";
const a = z.iso.duration();
expect(z.safeParse(a, d1).success).toEqual(true);
expect(z.safeParse(a, d2).success).toEqual(false);
const b = z.string().check(z.iso.duration());
expect(z.safeParse(b, d1).success).toEqual(true);
expect(z.safeParse(b, d2).success).toEqual(false);
});
test("z.undefined", () => {
const a = z.undefined();
expect(z.parse(a, undefined)).toEqual(undefined);
expect(() => z.parse(a, "undefined")).toThrow();
});
test("z.null", () => {
const a = z.null();
expect(z.parse(a, null)).toEqual(null);
expect(() => z.parse(a, "null")).toThrow();
});
test("z.any", () => {
const a = z.any();
expect(z.parse(a, "hello")).toEqual("hello");
expect(z.parse(a, 123)).toEqual(123);
expect(z.parse(a, true)).toEqual(true);
expect(z.parse(a, null)).toEqual(null);
expect(z.parse(a, undefined)).toEqual(undefined);
z.parse(a, {});
z.parse(a, []);
z.parse(a, Symbol());
z.parse(a, new Date());
});
test("z.unknown", () => {
const a = z.unknown();
expect(z.parse(a, "hello")).toEqual("hello");
expect(z.parse(a, 123)).toEqual(123);
expect(z.parse(a, true)).toEqual(true);
expect(z.parse(a, null)).toEqual(null);
expect(z.parse(a, undefined)).toEqual(undefined);
z.parse(a, {});
z.parse(a, []);
z.parse(a, Symbol());
z.parse(a, new Date());
});
test("z.never", () => {
const a = z.never();
expect(() => z.parse(a, "hello")).toThrow();
});
test("z.void", () => {
const a = z.void();
expect(z.parse(a, undefined)).toEqual(undefined);
expect(() => z.parse(a, null)).toThrow();
});
test("z.array", () => {
const a = z.array(z.string());
expect(z.parse(a, ["hello", "world"])).toEqual(["hello", "world"]);
expect(() => z.parse(a, [123])).toThrow();
expect(() => z.parse(a, "hello")).toThrow();
});
test("z.union", () => {
const a = z.union([z.string(), z.number()]);
expect(z.parse(a, "hello")).toEqual("hello");
expect(z.parse(a, 123)).toEqual(123);
expect(() => z.parse(a, true)).toThrow();
});
test("z.intersection", () => {
const a = z.intersection(z.object({ a: z.string() }), z.object({ b: z.number() }));
expect(z.parse(a, { a: "hello", b: 123 })).toEqual({ a: "hello", b: 123 });
expect(() => z.parse(a, { a: "hello" })).toThrow();
expect(() => z.parse(a, { b: 123 })).toThrow();
expect(() => z.parse(a, "hello")).toThrow();
});
test("z.tuple", () => {
const a = z.tuple([z.string(), z.number()]);
expect(z.parse(a, ["hello", 123])).toEqual(["hello", 123]);
expect(() => z.parse(a, ["hello", "world"])).toThrow();
expect(() => z.parse(a, [123, 456])).toThrow();
expect(() => z.parse(a, "hello")).toThrow();
// tuple with rest
const b = z.tuple([z.string(), z.number(), z.optional(z.string())], z.boolean());
type b = z.output<typeof b>;
expectTypeOf<b>().toEqualTypeOf<[string, number, (string | undefined)?, ...boolean[]]>();
const datas = [
["hello", 123],
["hello", 123, "world"],
["hello", 123, "world", true],
["hello", 123, "world", true, false, true],
];
for (const data of datas) {
expect(z.parse(b, data)).toEqual(data);
}
expect(() => z.parse(b, ["hello", 123, 123])).toThrow();
expect(() => z.parse(b, ["hello", 123, "world", 123])).toThrow();
// tuple with readonly args
const cArgs = [z.string(), z.number(), z.optional(z.string())] as const;
const c = z.tuple(cArgs, z.boolean());
type c = z.output<typeof c>;
expectTypeOf<c>().toEqualTypeOf<[string, number, (string | undefined)?, ...boolean[]]>();
// type c = z.output<typeof c>;
});
test("z.record", () => {
// record schema with enum keys
const a = z.record(z.string(), z.string());
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<Record<string, string>>();
const b = z.record(z.union([z.string(), z.number(), z.symbol()]), z.string());
type b = z.output<typeof b>;
expectTypeOf<b>().toEqualTypeOf<Record<string | number | symbol, string>>();
expect(z.parse(b, { a: "hello", 1: "world", [Symbol.for("asdf")]: "symbol" })).toEqual({
a: "hello",
1: "world",
[Symbol.for("asdf")]: "symbol",
});
// enum keys
const c = z.record(z.enum(["a", "b", "c"]), z.string());
type c = z.output<typeof c>;
expectTypeOf<c>().toEqualTypeOf<Record<"a" | "b" | "c", string>>();
expect(z.parse(c, { a: "hello", b: "world", c: "world" })).toEqual({
a: "hello",
b: "world",
c: "world",
});
// missing keys
expect(() => z.parse(c, { a: "hello", b: "world" })).toThrow();
// extra keys
expect(() => z.parse(c, { a: "hello", b: "world", c: "world", d: "world" })).toThrow();
// partial enum
const d = z.record(z.enum(["a", "b"]).or(z.never()), z.string());
type d = z.output<typeof d>;
expectTypeOf<d>().toEqualTypeOf<Record<"a" | "b", string>>();
// literal union keys
const e = z.record(z.union([z.literal("a"), z.literal(0)]), z.string());
type e = z.output<typeof e>;
expectTypeOf<e>().toEqualTypeOf<Record<"a" | 0, string>>();
expect(z.parse(e, { a: "hello", 0: "world" })).toEqual({
a: "hello",
0: "world",
});
// TypeScript enum keys
enum Enum {
A = 0,
B = "hi",
}
const f = z.record(z.enum(Enum), z.string());
type f = z.output<typeof f>;
expectTypeOf<f>().toEqualTypeOf<Record<Enum, string>>();
expect(z.parse(f, { [Enum.A]: "hello", [Enum.B]: "world" })).toEqual({
[Enum.A]: "hello",
[Enum.B]: "world",
});
});
test("z.map", () => {
const a = z.map(z.string(), z.number());
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<Map<string, number>>();
expect(z.parse(a, new Map([["hello", 123]]))).toEqual(new Map([["hello", 123]]));
expect(() => z.parse(a, new Map([["hello", "world"]]))).toThrow();
expect(() => z.parse(a, new Map([[1243, "world"]]))).toThrow();
expect(() => z.parse(a, "hello")).toThrow();
const r1 = z.safeParse(a, new Map([[123, 123]]));
expect(r1.error?.issues[0].code).toEqual("invalid_type");
expect(r1.error?.issues[0].path).toEqual([123]);
const r2: any = z.safeParse(a, new Map([[BigInt(123), 123]]));
expect(r2.error!.issues[0].code).toEqual("invalid_key");
expect(r2.error!.issues[0].path).toEqual([]);
const r3: any = z.safeParse(a, new Map([["hello", "world"]]));
expect(r3.error!.issues[0].code).toEqual("invalid_type");
expect(r3.error!.issues[0].path).toEqual(["hello"]);
});
test("z.map invalid_element", () => {
const a = z.map(z.bigint(), z.number());
const r1 = z.safeParse(a, new Map([[BigInt(123), BigInt(123)]]));
expect(r1.error!.issues[0].code).toEqual("invalid_element");
expect(r1.error!.issues[0].path).toEqual([]);
});
test("z.map async", async () => {
const a = z.map(z.string().check(z.refine(async () => true)), z.number().check(z.refine(async () => true)));
const d1 = new Map([["hello", 123]]);
expect(await z.parseAsync(a, d1)).toEqual(d1);
await expect(z.parseAsync(a, new Map([[123, 123]]))).rejects.toThrow();
await expect(z.parseAsync(a, new Map([["hi", "world"]]))).rejects.toThrow();
await expect(z.parseAsync(a, new Map([[1243, "world"]]))).rejects.toThrow();
await expect(z.parseAsync(a, "hello")).rejects.toThrow();
const r = await z.safeParseAsync(a, new Map([[123, 123]]));
expect(r.success).toEqual(false);
expect(r.error!.issues[0].code).toEqual("invalid_type");
expect(r.error!.issues[0].path).toEqual([123]);
});
test("z.set", () => {
const a = z.set(z.string());
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<Set<string>>();
expect(z.parse(a, new Set(["hello", "world"]))).toEqual(new Set(["hello", "world"]));
expect(() => z.parse(a, new Set([123]))).toThrow();
expect(() => z.parse(a, ["hello", "world"])).toThrow();
expect(() => z.parse(a, "hello")).toThrow();
const b = z.set(z.number());
expect(z.parse(b, new Set([1, 2, 3]))).toEqual(new Set([1, 2, 3]));
expect(() => z.parse(b, new Set(["hello"]))).toThrow();
expect(() => z.parse(b, [1, 2, 3])).toThrow();
expect(() => z.parse(b, 123)).toThrow();
});
test("z.enum", () => {
const a = z.enum(["A", "B", "C"]);
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<"A" | "B" | "C">();
expect(z.parse(a, "A")).toEqual("A");
expect(z.parse(a, "B")).toEqual("B");
expect(z.parse(a, "C")).toEqual("C");
expect(() => z.parse(a, "D")).toThrow();
expect(() => z.parse(a, 123)).toThrow();
expect(a.enum.A).toEqual("A");
expect(a.enum.B).toEqual("B");
expect(a.enum.C).toEqual("C");
expect((a.enum as any).D).toEqual(undefined);
});
test("z.enum - native", () => {
enum NativeEnum {
A = "A",
B = "B",
C = "C",
}
const a = z.enum(NativeEnum);
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<NativeEnum>();
expect(z.parse(a, NativeEnum.A)).toEqual(NativeEnum.A);
expect(z.parse(a, NativeEnum.B)).toEqual(NativeEnum.B);
expect(z.parse(a, NativeEnum.C)).toEqual(NativeEnum.C);
expect(() => z.parse(a, "D")).toThrow();
expect(() => z.parse(a, 123)).toThrow();
// test a.enum
a;
expect(a.enum.A).toEqual(NativeEnum.A);
expect(a.enum.B).toEqual(NativeEnum.B);
expect(a.enum.C).toEqual(NativeEnum.C);
});
test("z.nativeEnum", () => {
enum NativeEnum {
A = "A",
B = "B",
C = "C",
}
const a = z.nativeEnum(NativeEnum);
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<NativeEnum>();
expect(z.parse(a, NativeEnum.A)).toEqual(NativeEnum.A);
expect(z.parse(a, NativeEnum.B)).toEqual(NativeEnum.B);
expect(z.parse(a, NativeEnum.C)).toEqual(NativeEnum.C);
expect(() => z.parse(a, "D")).toThrow();
expect(() => z.parse(a, 123)).toThrow();
// test a.enum
a;
expect(a.enum.A).toEqual(NativeEnum.A);
expect(a.enum.B).toEqual(NativeEnum.B);
expect(a.enum.C).toEqual(NativeEnum.C);
});
test("z.literal", () => {
const a = z.literal("hello");
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<"hello">();
expect(z.parse(a, "hello")).toEqual("hello");
expect(() => z.parse(a, "world")).toThrow();
expect(() => z.parse(a, 123)).toThrow();
});
test("z.file", () => {
const a = z.file();
const file = new File(["content"], "filename.txt", { type: "text/plain" });
expect(z.parse(a, file)).toEqual(file);
expect(() => z.parse(a, "file")).toThrow();
expect(() => z.parse(a, 123)).toThrow();
});
test("z.transform", () => {
const a = z.pipe(
z.string(),
z.transform((val) => val.toUpperCase())
);
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<string>();
expect(z.parse(a, "hello")).toEqual("HELLO");
expect(() => z.parse(a, 123)).toThrow();
});
test("z.transform async", async () => {
const a = z.pipe(
z.string(),
z.transform(async (val) => val.toUpperCase())
);
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<string>();
expect(await z.parseAsync(a, "hello")).toEqual("HELLO");
await expect(() => z.parseAsync(a, 123)).rejects.toThrow();
});
test("z.preprocess", () => {
const a = z.pipe(
z.transform((val) => String(val).toUpperCase()),
z.string()
);
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<string>();
expect(z.parse(a, 123)).toEqual("123");
expect(z.parse(a, true)).toEqual("TRUE");
expect(z.parse(a, BigInt(1234))).toEqual("1234");
// expect(() => z.parse(a, Symbol("asdf"))).toThrow();
});
// test("z.preprocess async", () => {
// const a = z.preprocess(async (val) => String(val), z.string());
// type a = z.output<typeof a>;
// expectTypeOf<a>().toEqualTypeOf<string>();
// expect(z.parse(a, 123)).toEqual("123");
// expect(z.parse(a, true)).toEqual("true");
// expect(() => z.parse(a, {})).toThrow();
// });
test("z.optional", () => {
const a = z.optional(z.string());
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<string | undefined>();
expect(z.parse(a, "hello")).toEqual("hello");
expect(z.parse(a, undefined)).toEqual(undefined);
expect(() => z.parse(a, 123)).toThrow();
});
test("z.nullable", () => {
const a = z.nullable(z.string());
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<string | null>();
expect(z.parse(a, "hello")).toEqual("hello");
expect(z.parse(a, null)).toEqual(null);
expect(() => z.parse(a, 123)).toThrow();
});
test("z.default", () => {
const a = z._default(z.string(), "default");
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<string>();
expect(z.parse(a, undefined)).toEqual("default");
expect(z.parse(a, "hello")).toEqual("hello");
expect(() => z.parse(a, 123)).toThrow();
const b = z._default(z.string(), () => "default");
expect(z.parse(b, undefined)).toEqual("default");
expect(z.parse(b, "hello")).toEqual("hello");
expect(() => z.parse(b, 123)).toThrow();
});
test("z.catch", () => {
const a = z.catch(z.string(), "default");
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<string>();
expect(z.parse(a, "hello")).toEqual("hello");
expect(z.parse(a, 123)).toEqual("default");
const b = z.catch(z.string(), () => "default");
expect(z.parse(b, "hello")).toEqual("hello");
expect(z.parse(b, 123)).toEqual("default");
const c = z.catch(z.string(), (ctx) => {
return `${ctx.error.issues.length}issues`;
});
expect(z.parse(c, 1234)).toEqual("1issues");
});
test("z.nan", () => {
const a = z.nan();
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<number>();
expect(z.parse(a, Number.NaN)).toEqual(Number.NaN);
expect(() => z.parse(a, 123)).toThrow();
expect(() => z.parse(a, "NaN")).toThrow();
});
test("z.pipe", () => {
const a = z.pipe(
z.pipe(
z.string(),
z.transform((val) => val.length)
),
z.number()
);
type a_in = z.input<typeof a>;
expectTypeOf<a_in>().toEqualTypeOf<string>();
type a_out = z.output<typeof a>;
expectTypeOf<a_out>().toEqualTypeOf<number>();
expect(z.parse(a, "123")).toEqual(3);
expect(z.parse(a, "hello")).toEqual(5);
expect(() => z.parse(a, 123)).toThrow();
});
test("z.readonly", () => {
const a = z.readonly(z.string());
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<Readonly<string>>();
expect(z.parse(a, "hello")).toEqual("hello");
expect(() => z.parse(a, 123)).toThrow();
});
test("z.templateLiteral", () => {
const a = z.templateLiteral([z.string(), z.number()]);
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<`${string}${number}`>();
expect(z.parse(a, "hello123")).toEqual("hello123");
expect(() => z.parse(a, "hello")).toThrow();
expect(() => z.parse(a, 123)).toThrow();
// multipart
const b = z.templateLiteral([z.string(), z.number(), z.string()]);
type b = z.output<typeof b>;
expectTypeOf<b>().toEqualTypeOf<`${string}${number}${string}`>();
expect(z.parse(b, "hello123world")).toEqual("hello123world");
expect(z.parse(b, "123")).toEqual("123");
expect(() => z.parse(b, "hello")).toThrow();
expect(() => z.parse(b, 123)).toThrow();
// include boolean
const c = z.templateLiteral([z.string(), z.boolean()]);
type c = z.output<typeof c>;
expectTypeOf<c>().toEqualTypeOf<`${string}${boolean}`>();
expect(z.parse(c, "hellotrue")).toEqual("hellotrue");
expect(z.parse(c, "hellofalse")).toEqual("hellofalse");
expect(() => z.parse(c, "hello")).toThrow();
expect(() => z.parse(c, 123)).toThrow();
// include literal prefix
const d = z.templateLiteral([z.literal("hello"), z.number()]);
type d = z.output<typeof d>;
expectTypeOf<d>().toEqualTypeOf<`hello${number}`>();
expect(z.parse(d, "hello123")).toEqual("hello123");
expect(() => z.parse(d, 123)).toThrow();
expect(() => z.parse(d, "world123")).toThrow();
// include literal union
const e = z.templateLiteral([z.literal(["aa", "bb"]), z.number()]);
type e = z.output<typeof e>;
expectTypeOf<e>().toEqualTypeOf<`aa${number}` | `bb${number}`>();
expect(z.parse(e, "aa123")).toEqual("aa123");
expect(z.parse(e, "bb123")).toEqual("bb123");
expect(() => z.parse(e, "cc123")).toThrow();
expect(() => z.parse(e, 123)).toThrow();
});
// this returns both a schema and a check
test("z.custom schema", () => {
const a = z.custom((val) => {
return typeof val === "string";
});
expect(z.parse(a, "hello")).toEqual("hello");
expect(() => z.parse(a, 123)).toThrow();
});
test("z.custom check", () => {
// @ts-expect-error Inference not possible, use z.refine()
z.date().check(z.custom((val) => val.getTime() > 0));
});
test("z.check", () => {
// this is a more flexible version of z.custom that accepts an arbitrary _parse logic the function should return base.$ZodResult
const a = z.any().check(
z.check<string>((ctx) => {
if (typeof ctx.value === "string") return;
ctx.issues.push({
code: "custom",
origin: "custom",
message: "Expected a string",
input: ctx.value,
});
})
);
expect(z.safeParse(a, "hello")).toMatchObject({
success: true,
data: "hello",
});
expect(z.safeParse(a, 123)).toMatchObject({
success: false,
error: { issues: [{ code: "custom", message: "Expected a string" }] },
});
});
test("z.with (alias for z.check)", () => {
// .with() should work exactly the same as .check()
const a = z.any().with(
z.check<string>((ctx) => {
if (typeof ctx.value === "string") return;
ctx.issues.push({
code: "custom",
origin: "custom",
message: "Expected a string",
input: ctx.value,
});
})
);
expect(z.safeParse(a, "hello")).toMatchObject({
success: true,
data: "hello",
});
expect(z.safeParse(a, 123)).toMatchObject({
success: false,
error: { issues: [{ code: "custom", message: "Expected a string" }] },
});
// Test with refine
const b = z.string().with(z.refine((val) => val.length > 3, "Must be longer than 3"));
expect(z.safeParse(b, "hello").success).toBe(true);
expect(z.safeParse(b, "hi").success).toBe(false);
// Test with function
const c = z.string().with(({ value, issues }) => {
if (value.length <= 3) {
issues.push({
code: "custom",
input: value,
message: "Must be longer than 3",
});
}
});
expect(z.safeParse(c, "hello").success).toBe(true);
expect(z.safeParse(c, "hi").success).toBe(false);
});
test("z.instanceof", () => {
class A {}
const a = z.instanceof(A);
expect(z.parse(a, new A())).toBeInstanceOf(A);
expect(() => z.parse(a, {})).toThrow();
});
test("z.refine", () => {
const a = z.number().check(
z.refine((val) => val > 3),
z.refine((val) => val < 10)
);
expect(z.parse(a, 5)).toEqual(5);
expect(() => z.parse(a, 2)).toThrow();
expect(() => z.parse(a, 11)).toThrow();
expect(() => z.parse(a, "hi")).toThrow();
});
test("z.superRefine preserves explicit nullish issue input", () => {
const schema = z.string().check(
z.superRefine((_, ctx) => {
ctx.addIssue({ code: "custom", message: "default" });
ctx.addIssue({ code: "custom", message: "null", input: null });
ctx.addIssue({ code: "custom", message: "undefined", input: undefined });
})
);
const result = z.safeParse(schema, "sensitive", { reportInput: true });
expect(result.success).toEqual(false);
if (!result.success) {
expect(result.error.issues).toHaveLength(3);
expect(result.error.issues[0].input).toEqual("sensitive");
expect(result.error.issues[1].input).toEqual(null);
expect(result.error.issues[2]).toHaveProperty("input");
expect(result.error.issues[2].input).toEqual(undefined);
}
});
// test("z.superRefine", () => {
// const a = z.number([
// z.superRefine((val, ctx) => {
// if (val < 3) {
// return ctx.addIssue({
// code: "custom",
// origin: "custom",
// message: "Too small",
// input: val,
// });
// }
// if (val > 10) {
// return ctx.addIssue("Too big");
// }
// }),
// ]);
// expect(z.parse(a, 5)).toEqual(5);
// expect(() => z.parse(a, 2)).toThrow();
// expect(() => z.parse(a, 11)).toThrow();
// expect(() => z.parse(a, "hi")).toThrow();
// });
test("z.transform", () => {
const a = z.transform((val: number) => {
return `${val}`;
});
type a_in = z.input<typeof a>;
expectTypeOf<a_in>().toEqualTypeOf<number>();
type a_out = z.output<typeof a>;
expectTypeOf<a_out>().toEqualTypeOf<string>();
expect(z.parse(a, 123)).toEqual("123");
});
test("z.$brand()", () => {
const a = z.string().brand<"my-brand">();
type a = z.output<typeof a>;
const branded = (_: a) => {};
// @ts-expect-error
branded("asdf");
});
test("z.lazy", () => {
const a = z.lazy(() => z.string());
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<string>();
expect(z.parse(a, "hello")).toEqual("hello");
expect(() => z.parse(a, 123)).toThrow();
});
// schema that validates JSON-like data
test("z.json", () => {
const a = z.json();
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<util.JSONType>();
expect(z.parse(a, "hello")).toEqual("hello");
expect(z.parse(a, 123)).toEqual(123);
expect(z.parse(a, true)).toEqual(true);
expect(z.parse(a, null)).toEqual(null);
expect(z.parse(a, {})).toEqual({});
expect(z.parse(a, { a: "hello" })).toEqual({ a: "hello" });
expect(z.parse(a, [1, 2, 3])).toEqual([1, 2, 3]);
expect(z.parse(a, [{ a: "hello" }])).toEqual([{ a: "hello" }]);
// fail cases
expect(() => z.parse(a, new Date())).toThrow();
expect(() => z.parse(a, Symbol())).toThrow();
expect(() => z.parse(a, { a: new Date() })).toThrow();
expect(() => z.parse(a, undefined)).toThrow();
expect(() => z.parse(a, { a: undefined })).toThrow();
});
// promise
test("z.promise", async () => {
const a = z.promise(z.string());
type a = z.output<typeof a>;
expectTypeOf<a>().toEqualTypeOf<Promise<string>>();
expect(await z.safeParseAsync(a, Promise.resolve("hello"))).toMatchObject({
success: true,
data: "hello",
});
expect(await z.safeParseAsync(a, Promise.resolve(123))).toMatchObject({
success: false,
});
const b = z.string();
expect(() => z.parse(b, Promise.resolve("hello"))).toThrow();
});
// test("type assertions", () => {
// const schema = z.pipe(
// z.string(),
// z.transform((val) => val.length)
// );
// schema.assertInput<string>();
// // @ts-expect-error
// schema.assertInput<number>();
// schema.assertOutput<number>();
// // @ts-expect-error
// schema.assertOutput<string>();
// });
test("isPlainObject", () => {
expect(z.core.util.isPlainObject({})).toEqual(true);
expect(z.core.util.isPlainObject(Object.create(null))).toEqual(true);
expect(z.core.util.isPlainObject([])).toEqual(false);
expect(z.core.util.isPlainObject(new Date())).toEqual(false);
expect(z.core.util.isPlainObject(null)).toEqual(false);
expect(z.core.util.isPlainObject(undefined)).toEqual(false);
expect(z.core.util.isPlainObject("string")).toEqual(false);
expect(z.core.util.isPlainObject(123)).toEqual(false);
expect(z.core.util.isPlainObject(Symbol())).toEqual(false);
expect(z.core.util.isPlainObject({ constructor: "string" })).toEqual(true);
expect(z.core.util.isPlainObject({ constructor: 123 })).toEqual(true);
expect(z.core.util.isPlainObject({ constructor: null })).toEqual(true);
expect(z.core.util.isPlainObject({ constructor: undefined })).toEqual(true);
expect(z.core.util.isPlainObject({ constructor: true })).toEqual(true);
expect(z.core.util.isPlainObject({ constructor: {} })).toEqual(true);
expect(z.core.util.isPlainObject({ constructor: [] })).toEqual(true);
});
test("shallowClone with constructor field", () => {
const objWithConstructor = { constructor: "string", key: "value" };
const cloned = z.core.util.shallowClone(objWithConstructor);
expect(cloned).toEqual(objWithConstructor);
expect(cloned).not.toBe(objWithConstructor);
expect(cloned.constructor).toBe("string");
expect(cloned.key).toBe("value");
const testCases = [
{ constructor: 123, data: "test" },
{ constructor: null, data: "test" },
{ constructor: true, data: "test" },
{ constructor: {}, data: "test" },
{ constructor: [], data: "test" },
];
for (const testCase of testCases) {
const clonedCase = z.core.util.shallowClone(testCase);
expect(clonedCase).toEqual(testCase);
expect(clonedCase).not.toBe(testCase);
}
});
test("def typing", () => {
z.string().def.type satisfies "string";
z.number().def.type satisfies "number";
z.bigint().def.type satisfies "bigint";
z.boolean().def.type satisfies "boolean";
z.date().def.type satisfies "date";
z.symbol().def.type satisfies "symbol";
z.undefined().def.type satisfies "undefined";
z.string().nullable().def.type satisfies "nullable";
z.null().def.type satisfies "null";
z.any().def.type satisfies "any";
z.unknown().def.type satisfies "unknown";
z.never().def.type satisfies "never";
z.void().def.type satisfies "void";
z.array(z.string()).def.type satisfies "array";
z.object({ key: z.string() }).def.type satisfies "object";
z.union([z.string(), z.number()]).def.type satisfies "union";
z.intersection(z.string(), z.number()).def.type satisfies "intersection";
z.tuple([z.string(), z.number()]).def.type satisfies "tuple";
z.record(z.string(), z.number()).def.type satisfies "record";
z.map(z.string(), z.number()).def.type satisfies "map";
z.set(z.string()).def.type satisfies "set";
z.literal("example").def.type satisfies "literal";
z.enum(["a", "b", "c"]).def.type satisfies "enum";
z.promise(z.string()).def.type satisfies "promise";
z.lazy(() => z.string()).def.type satisfies "lazy";
z.string().optional().def.type satisfies "optional";
z.string().default("default").def.type satisfies "default";
z.templateLiteral([z.literal("a"), z.literal("b")]).def.type satisfies "template_literal";
z.custom<string>((val) => typeof val === "string").def.type satisfies "custom";
z.transform((val) => val as string).def.type satisfies "transform";
z.string().optional().nonoptional().def.type satisfies "nonoptional";
z.object({ key: z.string() }).readonly().def.type satisfies "readonly";
z.nan().def.type satisfies "nan";
z.unknown().pipe(z.number()).def.type satisfies "pipe";
z.success(z.string()).def.type satisfies "success";
z.string().catch("fallback").def.type satisfies "catch";
z.file().def.type satisfies "file";
});
test("runtime type property exists and returns correct values", () => {
const stringSchema = z.string();
expect(stringSchema.type).toBe("string");
});
test("type narrowing works with type property", () => {
type ArrayOrRecord = z.ZodArray<z.ZodString> | z.ZodRecord<z.ZodString, z.ZodAny>;
const arraySchema = z.array(z.string()) as ArrayOrRecord;
if (arraySchema.type === "array") {
expectTypeOf(arraySchema).toEqualTypeOf<z.ZodArray<z.ZodString>>();
expect(arraySchema.element).toBeDefined();
}
});
@@ -0,0 +1,224 @@
# Path-to-RegExp
> Turn a path string such as `/user/:name` into a regular expression.
[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]
[![Build status][build-image]][build-url]
[![Build coverage][coverage-image]][coverage-url]
[![License][license-image]][license-url]
## Installation
```
npm install path-to-regexp --save
```
## Usage
```js
const {
match,
pathToRegexp,
compile,
parse,
stringify,
} = require("path-to-regexp");
```
### Parameters
Parameters match arbitrary strings in a path by matching up to the end of the segment, or up to any proceeding tokens. They are defined by prefixing a colon to the parameter name (`:foo`). Parameter names can use any valid JavaScript identifier, or be double quoted to use other characters (`:"param-name"`).
```js
const fn = match("/:foo/:bar");
fn("/test/route");
//=> { path: '/test/route', params: { foo: 'test', bar: 'route' } }
```
### Wildcard
Wildcard parameters match one or more characters across multiple segments. They are defined the same way as regular parameters, but are prefixed with an asterisk (`*foo`).
```js
const fn = match("/*splat");
fn("/bar/baz");
//=> { path: '/bar/baz', params: { splat: [ 'bar', 'baz' ] } }
```
### Optional
Braces can be used to define parts of the path that are optional.
```js
const fn = match("/users{/:id}/delete");
fn("/users/delete");
//=> { path: '/users/delete', params: {} }
fn("/users/123/delete");
//=> { path: '/users/123/delete', params: { id: '123' } }
```
## Match
The `match` function returns a function for matching strings against a path:
- **path** String, `TokenData` object, or array of strings and `TokenData` objects.
- **options** _(optional)_ (Extends [pathToRegexp](#pathToRegexp) options)
- **decode** Function for decoding strings to params, or `false` to disable all processing. (default: `decodeURIComponent`)
```js
const fn = match("/foo/:bar");
```
**Please note:** `path-to-regexp` is intended for ordered data (e.g. paths, hosts). It can not handle arbitrarily ordered data (e.g. query strings, URL fragments, JSON, etc).
## PathToRegexp
The `pathToRegexp` function returns the `regexp` for matching strings against paths, and an array of `keys` for understanding the `RegExp#exec` matches.
- **path** String, `TokenData` object, or array of strings and `TokenData` objects.
- **options** _(optional)_ (See [parse](#parse) for more options)
- **sensitive** Regexp will be case sensitive. (default: `false`)
- **end** Validate the match reaches the end of the string. (default: `true`)
- **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`)
- **trailing** Allows optional trailing delimiter to match. (default: `true`)
```js
const { regexp, keys } = pathToRegexp("/foo/:bar");
regexp.exec("/foo/123"); //=> ["/foo/123", "123"]
```
## Compile ("Reverse" Path-To-RegExp)
The `compile` function will return a function for transforming parameters into a valid path:
- **path** A string or `TokenData` object.
- **options** (See [parse](#parse) for more options)
- **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`)
- **encode** Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`)
```js
const toPath = compile("/user/:id");
toPath({ id: "name" }); //=> "/user/name"
toPath({ id: "café" }); //=> "/user/caf%C3%A9"
const toPathRepeated = compile("/*segment");
toPathRepeated({ segment: ["foo"] }); //=> "/foo"
toPathRepeated({ segment: ["a", "b", "c"] }); //=> "/a/b/c"
// When disabling `encode`, you need to make sure inputs are encoded correctly. No arrays are accepted.
const toPathRaw = compile("/user/:id", { encode: false });
toPathRaw({ id: "%3A%2F" }); //=> "/user/%3A%2F"
```
## Stringify
Transform a `TokenData` object to a Path-to-RegExp string.
- **data** A `TokenData` object.
```js
const data = {
tokens: [
{ type: "text", value: "/" },
{ type: "param", name: "foo" },
],
};
const path = stringify(data); //=> "/:foo"
```
## Developers
- If you are rewriting paths with match and compile, consider using `encode: false` and `decode: false` to keep raw paths passed around.
- To ensure matches work on paths containing characters usually encoded, such as emoji, consider using [encodeurl](https://github.com/pillarjs/encodeurl) for `encodePath`.
### Parse
The `parse` function accepts a string and returns `TokenData`, which can be used with `match` and `compile`.
- **path** A string.
- **options** _(optional)_
- **encodePath** A function for encoding input strings. (default: `x => x`, recommended: [`encodeurl`](https://github.com/pillarjs/encodeurl))
### Tokens
`TokenData` has two properties:
- **tokens** A sequence of tokens, currently of types `text`, `param`, `wildcard`, or `group`.
- **originalPath** The original path used with `parse`, shown in error messages to assist debugging.
### Custom path
In some applications you may not be able to use the `path-to-regexp` syntax, but you still want to use this library for `match` and `compile`. For example:
```js
import { match } from "path-to-regexp";
const tokens = [
{ type: "text", value: "/" },
{ type: "param", name: "foo" },
];
const originalPath = "/[foo]"; // To help debug error messages.
const path = { tokens, originalPath };
const fn = match(path);
fn("/test"); //=> { path: '/test', params: { foo: 'test' } }
```
## Errors
An effort has been made to ensure ambiguous paths from previous releases throw an error. This means you might be seeing an error when things worked before.
### Missing parameter name
Parameter names must be provided after `:` or `*`, for example `/*path`. They can be valid JavaScript identifiers (e.g. `:myName`) or JSON strings (`:"my-name"`).
### Unexpected `?` or `+`
In past releases, `?`, `*`, and `+` were used to denote optional or repeating parameters. As an alternative, try these:
- For optional (`?`), use braces: `/file{.:ext}`.
- For one or more (`+`), use a wildcard: `/*path`.
- For zero or more (`*`), use both: `/files{/*path}`.
### Unexpected `(`, `)`, `[`, `]`, etc.
Previous versions of Path-to-RegExp used these for RegExp features. This version no longer supports them so they've been reserved to avoid ambiguity. To match these characters literally, escape them with a backslash, e.g. `"\\("`.
### Unterminated quote
Parameter names can be wrapped in double quote characters, and this error means you forgot to close the quote character. For example, `:"foo`.
### Express <= 4.x
Path-To-RegExp breaks compatibility with Express <= `4.x` in the following ways:
- The wildcard `*` must have a name and matches the behavior of parameters `:`.
- The optional character `?` is no longer supported, use braces instead: `/:file{.:ext}`.
- Regexp characters are not supported.
- Some characters have been reserved to avoid confusion during upgrade (`()[]?+!`).
- Parameter names now support valid JavaScript identifiers, or quoted like `:"this"`.
## License
MIT
[npm-image]: https://img.shields.io/npm/v/path-to-regexp
[npm-url]: https://npmjs.org/package/path-to-regexp
[downloads-image]: https://img.shields.io/npm/dm/path-to-regexp
[downloads-url]: https://npmjs.org/package/path-to-regexp
[build-image]: https://img.shields.io/github/actions/workflow/status/pillarjs/path-to-regexp/ci.yml?branch=master
[build-url]: https://github.com/pillarjs/path-to-regexp/actions/workflows/ci.yml?query=branch%3Amaster
[coverage-image]: https://img.shields.io/codecov/c/gh/pillarjs/path-to-regexp
[coverage-url]: https://codecov.io/gh/pillarjs/path-to-regexp
[license-image]: http://img.shields.io/npm/l/path-to-regexp.svg?style=flat
[license-url]: LICENSE.md
@@ -0,0 +1,476 @@
/**
* @fileoverview A utility for retrying failed async method calls.
*/
/* global setTimeout, clearTimeout */
//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------
const MAX_TASK_TIMEOUT = 60000;
const MAX_TASK_DELAY = 100;
const MAX_CONCURRENCY = 1000;
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
* Logs a message to the console if the DEBUG environment variable is set.
* @param {string} message The message to log.
* @returns {void}
*/
function debug(message) {
if (globalThis?.process?.env.DEBUG === "@hwc/retry") {
console.debug(message);
}
}
/*
* The following logic has been extracted from graceful-fs.
*
* The ISC License
*
* Copyright (c) 2011-2023 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* Checks if it is time to retry a task based on the timestamp and last attempt time.
* @param {RetryTask} task The task to check.
* @param {number} maxDelay The maximum delay for the queue.
* @returns {boolean} true if it is time to retry, false otherwise.
*/
function isTimeToRetry(task, maxDelay) {
const timeSinceLastAttempt = Date.now() - task.lastAttempt;
const timeSinceStart = Math.max(task.lastAttempt - task.timestamp, 1);
const desiredDelay = Math.min(timeSinceStart * 1.2, maxDelay);
return timeSinceLastAttempt >= desiredDelay;
}
/**
* Checks if it is time to bail out based on the given timestamp.
* @param {RetryTask} task The task to check.
* @param {number} timeout The timeout for the queue.
* @returns {boolean} true if it is time to bail, false otherwise.
*/
function isTimeToBail(task, timeout) {
return task.age > timeout;
}
/**
* Creates a new promise with resolve and reject functions.
* @returns {{promise:Promise<any>, resolve:(value:any) => any, reject: (value:any) => any}} A new promise.
*/
function createPromise() {
if (Promise.withResolvers) {
return Promise.withResolvers();
}
let resolve, reject;
const promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
if (resolve === undefined || reject === undefined) {
throw new Error("Promise executor did not initialize resolve or reject.");
}
return { promise, resolve, reject };
}
/**
* A class to represent a task in the retry queue.
*/
class RetryTask {
/**
* The unique ID for the task.
* @type {string}
*/
id = Math.random().toString(36).slice(2);
/**
* The function to call.
* @type {Function}
*/
fn;
/**
* The error that was thrown.
* @type {Error}
*/
error;
/**
* The timestamp of the task.
* @type {number}
*/
timestamp = Date.now();
/**
* The timestamp of the last attempt.
* @type {number}
*/
lastAttempt = this.timestamp;
/**
* The resolve function for the promise.
* @type {Function}
*/
resolve;
/**
* The reject function for the promise.
* @type {Function}
*/
reject;
/**
* The AbortSignal to monitor for cancellation.
* @type {AbortSignal|undefined}
*/
signal;
/**
* Creates a new instance.
* @param {Function} fn The function to call.
* @param {Error} error The error that was thrown.
* @param {Function} resolve The resolve function for the promise.
* @param {Function} reject The reject function for the promise.
* @param {AbortSignal|undefined} signal The AbortSignal to monitor for cancellation.
*/
constructor(fn, error, resolve, reject, signal) {
this.fn = fn;
this.error = error;
this.timestamp = Date.now();
this.lastAttempt = Date.now();
this.resolve = resolve;
this.reject = reject;
this.signal = signal;
}
/**
* Gets the age of the task.
* @returns {number} The age of the task in milliseconds.
* @readonly
*/
get age() {
return Date.now() - this.timestamp;
}
}
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
/**
* A class that manages a queue of retry jobs.
*/
class Retrier {
/**
* Represents the queue for processing tasks.
* @type {Array<RetryTask>}
*/
#retrying = [];
/**
* Represents the queue for pending tasks.
* @type {Array<Function>}
*/
#pending = [];
/**
* The number of tasks currently being processed.
* @type {number}
*/
#working = 0;
/**
* The timeout for the queue.
* @type {number}
*/
#timeout;
/**
* The maximum delay for the queue.
* @type {number}
*/
#maxDelay;
/**
* The setTimeout() timer ID.
* @type {NodeJS.Timeout|undefined}
*/
#timerId;
/**
* The function to call.
* @type {Function}
*/
#check;
/**
* The maximum number of concurrent tasks.
* @type {number}
*/
#concurrency;
/**
* Creates a new instance.
* @param {Function} check The function to call.
* @param {object} [options] The options for the instance.
* @param {number} [options.timeout] The timeout for the queue.
* @param {number} [options.maxDelay] The maximum delay for the queue.
* @param {number} [options.concurrency] The maximum number of concurrent tasks.
*/
constructor(check, { timeout = MAX_TASK_TIMEOUT, maxDelay = MAX_TASK_DELAY, concurrency = MAX_CONCURRENCY } = {}) {
if (typeof check !== "function") {
throw new Error("Missing function to check errors");
}
this.#check = check;
this.#timeout = timeout;
this.#maxDelay = maxDelay;
this.#concurrency = concurrency;
}
/**
* Gets the number of tasks waiting to be retried.
* @returns {number} The number of tasks in the retry queue.
*/
get retrying() {
return this.#retrying.length;
}
/**
* Gets the number of tasks waiting to be processed in the pending queue.
* @returns {number} The number of tasks in the pending queue.
*/
get pending() {
return this.#pending.length;
}
/**
* Gets the number of tasks currently being processed.
* @returns {number} The number of tasks currently being processed.
*/
get working() {
return this.#working;
}
/**
* Calls the function and retries if it fails.
* @param {Function} fn The function to call.
* @param {Object} options The options for the job.
* @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation.
* @param {Promise<any>} options.promise The promise to return when the function settles.
* @param {Function} options.resolve The resolve function for the promise.
* @param {Function} options.reject The reject function for the promise.
* @returns {Promise<any>} A promise that resolves when the function is
* called successfully.
*/
#call(fn, { signal, promise, resolve, reject }) {
let result;
try {
result = fn();
} catch (/** @type {any} */ error) {
reject(new Error(`Synchronous error: ${error.message}`, { cause: error }));
return promise;
}
// if the result is not a promise then reject an error
if (!result || typeof result.then !== "function") {
reject(new Error("Result is not a promise."));
return promise;
}
this.#working++;
promise.finally(() => {
this.#working--;
this.#processPending();
})
// `promise.finally` creates a new promise that may be rejected, so it must be handled.
.catch(() => { });
// call the original function and catch any ENFILE or EMFILE errors
Promise.resolve(result)
.then(value => {
debug("Function called successfully without retry.");
resolve(value);
})
.catch(error => {
if (!this.#check(error)) {
reject(error);
return;
}
const task = new RetryTask(fn, error, resolve, reject, signal);
debug(`Function failed, queuing for retry with task ${task.id}.`);
this.#retrying.push(task);
signal?.addEventListener("abort", () => {
debug(`Task ${task.id} was aborted due to AbortSignal.`);
reject(signal.reason);
});
this.#processQueue();
});
return promise;
}
/**
* Adds a new retry job to the queue.
* @template {(...args: unknown[]) => Promise<unknown>} Func
* @template {Awaited<ReturnType<Func>>} RetVal
* @param {Func} fn The function to call.
* @param {object} [options] The options for the job.
* @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation.
* @returns {Promise<RetVal>} A promise that resolves when the queue is processed.
*/
retry(fn, { signal } = {}) {
signal?.throwIfAborted();
const { promise, resolve, reject } = createPromise();
this.#pending.push(() => this.#call(fn, { signal, promise, resolve, reject }));
this.#processPending();
return promise;
}
/**
* Processes the pending queue and the retry queue.
* @returns {void}
*/
#processAll() {
if (this.pending) {
this.#processPending();
}
if (this.retrying) {
this.#processQueue();
}
}
/**
* Processes the pending queue to see which tasks can be started.
* @returns {void}
*/
#processPending() {
debug(`Processing pending tasks: ${this.pending} pending, ${this.working} working.`);
const available = this.#concurrency - this.working;
if (available <= 0) {
return;
}
const count = Math.min(this.pending, available);
for (let i = 0; i < count; i++) {
const task = this.#pending.shift();
task?.();
}
debug(`Processed pending tasks: ${this.pending} pending, ${this.working} working.`);
}
/**
* Processes the queue.
* @returns {void}
*/
#processQueue() {
// clear any timer because we're going to check right now
clearTimeout(this.#timerId);
this.#timerId = undefined;
debug(`Processing retry queue: ${this.retrying} retrying, ${this.working} working.`);
const processAgain = () => {
this.#timerId = setTimeout(() => this.#processAll(), 0);
};
// if there's nothing in the queue, we're done
const task = this.#retrying.shift();
if (!task) {
debug("Queue is empty, exiting.");
if (this.pending) {
processAgain();
}
return;
}
// if it's time to bail, then bail
if (isTimeToBail(task, this.#timeout)) {
debug(`Task ${task.id} was abandoned due to timeout.`);
task.reject(task.error);
processAgain();
return;
}
// if it's not time to retry, then wait and try again
if (!isTimeToRetry(task, this.#maxDelay)) {
debug(`Task ${task.id} is not ready to retry, skipping.`);
this.#retrying.push(task);
processAgain();
return;
}
// otherwise, try again
task.lastAttempt = Date.now();
// Promise.resolve needed in case it's a thenable but not a Promise
Promise.resolve(task.fn())
// @ts-ignore because we know it's any
.then(result => {
debug(`Task ${task.id} succeeded after ${task.age}ms.`);
task.resolve(result);
})
// @ts-ignore because we know it's any
.catch(error => {
if (!this.#check(error)) {
debug(`Task ${task.id} failed with non-retryable error: ${error.message}.`);
task.reject(error);
return;
}
// update the task timestamp and push to back of queue to try again
task.lastAttempt = Date.now();
this.#retrying.push(task);
debug(`Task ${task.id} failed, requeueing to try again.`);
})
.finally(() => {
this.#processAll();
});
}
}
export { Retrier };
@@ -0,0 +1,61 @@
export * from '@tanstack/store'
export { useStore } from './useStore'
export function shallow<T>(objA: T, objB: T) {
if (Object.is(objA, objB)) {
return true
}
if (
typeof objA !== 'object' ||
objA === null ||
typeof objB !== 'object' ||
objB === null
) {
return false
}
if (objA instanceof Map && objB instanceof Map) {
if (objA.size !== objB.size) return false
for (const [k, v] of objA) {
if (!objB.has(k) || !Object.is(v, objB.get(k))) return false
}
return true
}
if (objA instanceof Set && objB instanceof Set) {
if (objA.size !== objB.size) return false
for (const v of objA) {
if (!objB.has(v)) return false
}
return true
}
if (objA instanceof Date && objB instanceof Date) {
if (objA.getTime() !== objB.getTime()) return false
return true
}
const keysA = getOwnKeys(objA)
if (keysA.length !== getOwnKeys(objB).length) {
return false
}
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < keysA.length; i++) {
if (
!Object.prototype.hasOwnProperty.call(objB, keysA[i] as string) ||
!Object.is(objA[keysA[i] as keyof T], objB[keysA[i] as keyof T])
) {
return false
}
}
return true
}
function getOwnKeys(obj: object): Array<string | symbol> {
return (Object.keys(obj) as Array<string | symbol>).concat(
Object.getOwnPropertySymbols(obj),
)
}
@@ -0,0 +1,9 @@
require('thenify-all').withCallback(
require('crypto'),
exports, [
'pbkdf2',
'pseudoRandomBytes',
'randomBytes'
]
)
@@ -0,0 +1,10 @@
export function parseNullDef(refs) {
return refs.target === "openApi3"
? {
enum: ["null"],
nullable: true,
}
: {
type: "null",
};
}
@@ -0,0 +1,91 @@
/**
* @fileoverview Rule to flag when regex literals are not wrapped in parens
* @author Matt DuVall <http://www.mattduvall.com>
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "wrap-regex",
url: "https://eslint.style/rules/wrap-regex",
},
},
],
},
type: "layout",
docs: {
description: "Require parenthesis around regex literals",
recommended: false,
url: "https://eslint.org/docs/latest/rules/wrap-regex",
},
schema: [],
fixable: "code",
messages: {
requireParens:
"Wrap the regexp literal in parens to disambiguate the slash.",
},
},
create(context) {
const sourceCode = context.sourceCode;
return {
Literal(node) {
const token = sourceCode.getFirstToken(node),
nodeType = token.type;
if (nodeType === "RegularExpression") {
const beforeToken = sourceCode.getTokenBefore(node);
const afterToken = sourceCode.getTokenAfter(node);
const { parent } = node;
if (
parent.type === "MemberExpression" &&
parent.object === node &&
!(
beforeToken &&
beforeToken.value === "(" &&
afterToken &&
afterToken.value === ")"
)
) {
context.report({
node,
messageId: "requireParens",
fix: fixer =>
fixer.replaceText(
node,
`(${sourceCode.getText(node)})`,
),
});
}
}
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"utils.cjs","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport type { RouteIds } from './routeInfo'\nimport type { AnyRouter } from './router'\n\nexport type Awaitable<T> = T | Promise<T>\nexport type NoInfer<T> = [T][T extends any ? 0 : never]\nexport type IsAny<TValue, TYesResult, TNoResult = TValue> = 1 extends 0 & TValue\n ? TYesResult\n : TNoResult\n\nexport type PickAsRequired<TValue, TKey extends keyof TValue> = Omit<\n TValue,\n TKey\n> &\n Required<Pick<TValue, TKey>>\n\nexport type PickRequired<T> = {\n [K in keyof T as undefined extends T[K] ? never : K]: T[K]\n}\n\nexport type PickOptional<T> = {\n [K in keyof T as undefined extends T[K] ? K : never]: T[K]\n}\n\n// from https://stackoverflow.com/a/76458160\nexport type WithoutEmpty<T> = T extends any ? ({} extends T ? never : T) : never\n\nexport type Expand<T> = T extends object\n ? T extends infer O\n ? O extends Function\n ? O\n : { [K in keyof O]: O[K] }\n : never\n : T\n\nexport type DeepPartial<T> = T extends object\n ? {\n [P in keyof T]?: DeepPartial<T[P]>\n }\n : T\n\nexport type MakeDifferenceOptional<TLeft, TRight> = keyof TLeft &\n keyof TRight extends never\n ? TRight\n : Omit<TRight, keyof TLeft & keyof TRight> & {\n [K in keyof TLeft & keyof TRight]?: TRight[K]\n }\n\n// from https://stackoverflow.com/a/53955431\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type IsUnion<T, U extends T = T> = (\n T extends any ? (U extends T ? false : true) : never\n) extends false\n ? false\n : true\n\nexport type IsNonEmptyObject<T> = T extends object\n ? keyof T extends never\n ? false\n : true\n : false\n\nexport type Assign<TLeft, TRight> = TLeft extends any\n ? TRight extends any\n ? IsNonEmptyObject<TLeft> extends false\n ? TRight\n : IsNonEmptyObject<TRight> extends false\n ? TLeft\n : keyof TLeft & keyof TRight extends never\n ? TLeft & TRight\n : Omit<TLeft, keyof TRight> & TRight\n : never\n : never\n\nexport type IntersectAssign<TLeft, TRight> = TLeft extends any\n ? TRight extends any\n ? IsNonEmptyObject<TLeft> extends false\n ? TRight\n : IsNonEmptyObject<TRight> extends false\n ? TLeft\n : TRight & TLeft\n : never\n : never\n\nexport type Timeout = ReturnType<typeof setTimeout>\n\nexport type Updater<TPrevious, TResult = TPrevious> =\n | TResult\n | ((prev?: TPrevious) => TResult)\n\nexport type NonNullableUpdater<TPrevious, TResult = TPrevious> =\n | TResult\n | ((prev: TPrevious) => TResult)\n\nexport type ExtractObjects<TUnion> = TUnion extends MergeAllPrimitive\n ? never\n : TUnion\n\nexport type PartialMergeAllObject<TUnion> =\n ExtractObjects<TUnion> extends infer TObj\n ? [TObj] extends [never]\n ? never\n : {\n [TKey in TObj extends any ? keyof TObj : never]?: TObj extends any\n ? TKey extends keyof TObj\n ? TObj[TKey]\n : never\n : never\n }\n : never\n\nexport type MergeAllPrimitive =\n | ReadonlyArray<any>\n | number\n | string\n | bigint\n | boolean\n | symbol\n | undefined\n | null\n\nexport type ExtractPrimitives<TUnion> = TUnion extends MergeAllPrimitive\n ? TUnion\n : TUnion extends object\n ? never\n : TUnion\n\nexport type PartialMergeAll<TUnion> =\n | ExtractPrimitives<TUnion>\n | PartialMergeAllObject<TUnion>\n\nexport type Constrain<T, TConstraint, TDefault = TConstraint> =\n | (T extends TConstraint ? T : never)\n | TDefault\n\nexport type ConstrainLiteral<T, TConstraint, TDefault = TConstraint> =\n | (T & TConstraint)\n | TDefault\n\n/**\n * To be added to router types\n */\nexport type UnionToIntersection<T> = (\n T extends any ? (arg: T) => any : never\n) extends (arg: infer T) => any\n ? T\n : never\n\n/**\n * Merges everything in a union into one object.\n * This mapped type is homomorphic which means it preserves stuff! :)\n */\nexport type MergeAllObjects<\n TUnion,\n TIntersected = UnionToIntersection<ExtractObjects<TUnion>>,\n> = [keyof TIntersected] extends [never]\n ? never\n : {\n [TKey in keyof TIntersected]: TUnion extends any\n ? TUnion[TKey & keyof TUnion]\n : never\n }\n\nexport type MergeAll<TUnion> =\n | MergeAllObjects<TUnion>\n | ExtractPrimitives<TUnion>\n\nexport type ValidateJSON<T> = ((...args: Array<any>) => any) extends T\n ? unknown extends T\n ? never\n : 'Function is not serializable'\n : { [K in keyof T]: ValidateJSON<T[K]> }\n\nexport type LooseReturnType<T> = T extends (\n ...args: Array<any>\n) => infer TReturn\n ? TReturn\n : never\n\nexport type LooseAsyncReturnType<T> = T extends (\n ...args: Array<any>\n) => infer TReturn\n ? TReturn extends Promise<infer TReturn>\n ? TReturn\n : TReturn\n : never\n\n/**\n * Return the last element of an array.\n * IntendeLine truncated
@@ -0,0 +1,949 @@
export default `flf2a$ 9 8 15 0 20 0 16255 0
Author : myflix
Date : 2004/9/26 12:46:52
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
- Widened the space character.
Font modified May 26, 2012 by patorjk
- Switched the _ and - character (which were swapped).
- Added the 0xCA0 character
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
,---. #
| | #
| | #
| | #
| | #
| .' #
\`--' #
.--. #
'--' ##
#
,--.,--. #
\\ |\\ | #
\`-' \`-' #
#
#
#
#
##
#
,-. ,-. #
| | | | #
,--| |-| |--.#
'--| |-| |--'#
'--| |-| |--'#
| | | | #
\`-' \`-' #
##
,-. #
.-| |-. #
| | |_/ #
\\ | |. #
'-| | '. #
.- | | | #
| \`| | / #
\`-| |'\` #
\`-' ##
,-. #
,--. / / #
'--'/ / #
/ / #
/ / #
/ / #
/ / ,--. #
/ / '--' #
\`-' ##
#
.-----. #
/ .-. \\ #
| \\_.' / #
/ .-. ',-. #
| | | . /_ #
\\ '-' _.__)#
\`----'' #
##
#
,--. #
\\ | #
\`-' #
#
#
#
#
##
,-. #
/ | #
' .' #
| | #
| | #
| | #
' '. #
\\ | #
\`-' ##
,-. #
| \\ #
'. ' #
| | #
| | #
| | #
.' ' #
| / #
\`-' ##
#
.-. #
.-,| |,-. #
_\\ ' ' /_ #
(__ __) #
/ . . \\ #
\`-'| |\`-' #
\`-' #
##
#
#
,-. #
| | #
,---| |---. #
'---| |---' #
| | #
\`-' #
##
#
#
#
#
#
#
#
.-. #
',/ ##
#
#
#
.-') #
_( OO) #
(,------. #
'------' #
#
##
#
#
#
#
#
#
#
.-. #
\`-' ##
,-. #
/ / #
/ / #
/ / #
/ / #
/ / #
/ / #
/ / #
\`-' ##
#
#
.----. #
/ .. \\ #
. / \\ . #
| | ' | #
' \\ / ' #
\\ \`' / #
\`---'' ##
#
#
.---. #
/_ | #
| | #
| | #
| | #
| | #
\`---' ##
#
#
.-----. #
/ ,-. \\ #
'-' | | #
.' / #
.' /__ #
| | #
\`-------' ##
#
#
.-----. #
/ -. \\ #
'-' _' | #
|_ < #
.-. | | #
\\ \`-' / #
\`----'' ##
#
#
.---. #
/ . | #
/ /| | #
/ / | |_ #
/ '-' | #
\`----| |-' #
\`--' ##
#
#
.------. #
| ___| #
| '--. #
\`---. '. #
.- | | #
| \`-' / #
\`----'' ##
#
#
,--. #
/ .' #
. / -. #
| .-. ' #
' \\ | | #
\\ \`' / #
\`----' ##
#
#
.--------. #
| __ ' #
\`--' . / #
/ / #
. / #
/ / #
\`--' ##
#
#
.-----. #
/ .-. \\ #
| \\_.' / #
/ .-. '. #
| | | | #
\\ '-' / #
\`----'' ##
#
#
.----. #
/ ,. \\ #
| | \\ | #
' \`-' ' #
\`- / ' #
,' / #
\`---' ##
#
#
.-. #
\`-' #
#
.-. #
\`-' #
#
##
#
#
.-. #
'-' #
#
.-. #
',/ #
#
##
#
,-. #
/ / #
/ / #
/ / #
\\ \\ #
\\ \\ #
\\ \\ #
\`-' ##
#
#
,-----. #
'-----' #
#
,-----. #
'-----' #
#
##
#
,-. #
\\ \\ #
\\ \\ #
\\ \\ #
/ / #
/ / #
/ / #
\`-' ##
,------. #
' .--. ' #
| | | | #
'--' | | #
__. | #
| .' #
|___| #
.---. #
'---' ##
#
#
____ #
.' __ \\ #
/ .' \\ | #
| | (_/ | #
\\ \`.__.'\\ #
\`.___ .' #
##
('-. #
( OO ).-. #
/ . --. / #
| \\-. \\ #
.-'-' | | #
\\| |_.' | #
| .-. | #
| | | | #
\`--' \`--' ##
.-. .-') #
\\ ( OO ) #
;-----.\\ #
| .-. | #
| '-' /_) #
| .-. \`. #
| | \\ | #
| '--' / #
\`------' ##
#
#
.-----. #
' .--./ #
| |('-. #
/_) |OO ) #
|| |\`-'| #
(_' '--'\\ #
\`-----' ##
_ .-') _ #
( ( OO) ) #
\\ .'_ #
,\`'--..._) #
| | \\ ' #
| | ' | #
| | / : #
| '--' / #
\`-------' ##
('-. #
_( OO) #
(,------. #
| .---' #
| | #
(| '--. #
| .--' #
| \`---. #
\`------' ##
#
#
,------. #
('-| _.---' #
(OO|(_\\ #
/ | '--. #
\\_)| .--' #
\\| |_) #
\`--' ##
#
#
,----. #
' .-./-') #
| |_( O- ) #
| | .--, \\ #
(| | '. (_/ #
| '--' | #
\`------' ##
('-. .-. #
( OO ) / #
,--. ,--. #
| | | | #
| .| | #
| | #
| .-. | #
| | | | #
\`--' \`--' ##
#
#
,-.-') #
| |OO) #
| | \\ #
| |(_/ #
,| |_.' #
(_| | #
\`--' ##
#
#
,--. #
.-')| ,| #
( OO |(_| #
| \`-'| | #
,--. | | #
| '-' / #
\`-----' ##
.-. .-') #
\\ ( OO ) #
,--. ,--. #
| .' / #
| /, #
| ' _) #
| . \\ #
| |\\ \\ #
\`--' '--' ##
#
#
,--. #
| |.-') #
| | OO ) #
| |\`-' | #
(| '---.' #
| | #
\`------' ##
_ .-') #
( '.( OO )_ #
,--. ,--.)#
| \`.' | #
| | #
| |'.'| | #
| | | | #
| | | | #
\`--' \`--' ##
.-') _ #
( OO ) ) #
,--./ ,--,' #
| \\ | |\\ #
| \\| | ) #
| . |/ #
| |\\ | #
| | \\ | #
\`--' \`--' ##
#
#
.-'),-----. #
( OO' .-. '#
/ | | | |#
\\_) | |\\| |#
\\ | | | |#
\`' '-' '#
\`-----' ##
_ (\`-. #
( (OO ) #
_.\` \\ #
(__...--'' #
| / | | #
| |_.' | #
| .___.' #
| | #
\`--' ##
.-') #
.( OO) #
(_)---\\_) #
' .-. ' #
,| | | | #
(_| | | | #
| | | | #
' '-' '-.#
\`-----'--'##
_ .-') #
( \\( -O ) #
,------. #
| /\`. ' #
| / | | #
| |_.' | #
| . '.' #
| |\\ \\ #
\`--' '--' ##
.-') #
( OO ). #
(_)---\\_) #
/ _ | #
\\ :\` \`. #
'..\`''.) #
.-._) \\ #
\\ / #
\`-----' ##
.-') _ #
( OO) ) #
/ '._ #
|'--...__) #
'--. .--' #
| | #
| | #
| | #
\`--' ##
#
#
,--. ,--. #
| | | | #
| | | .-') #
| |_|( OO )#
| | | \`-' /#
(' '-'(_.-' #
\`-----' ##
(\`-. #
_(OO )_ #
,--(_/ ,. \\#
\\ \\ /(__/#
\\ \\ / / #
\\ ' /, #
\\ /__)#
\\ / #
\`-' ##
(\`\\ .-') /\`#
\`.( OO ),'#
,--./ .--. #
| | | #
| | | |, #
| |.'.| |_)#
| | #
| ,'. | #
'--' '--' ##
) (\`-. #
( OO ). #
(_/. \\_)-. #
\\ \`.' / #
\\ /\\ #
\\ \\ | #
.' \\_) #
/ .'. \\ #
'--' '--' ##
#
#
,--. ,--.#
\\ \`.' / #
.-') / #
(OO \\ / #
| / /\\_ #
\`-./ /.__) #
\`--' ##
.-') _ #
( OO) ) #
,(_)----. #
| | #
'--. / #
(_/ / #
/ /___ #
| | #
\`--------' ##
,----. #
| | #
| .-' #
| | #
| | #
| | #
| '-. #
| | #
\`----' ##
,-. #
\\ \\ #
\\ \\ #
\\ \\ #
\\ \\ #
\\ \\ #
\\ \\ #
\\ \\ #
\`-' ##
,----. #
| | #
\`-. | #
| | #
| | #
| | #
.-' | #
| | #
\`----' ##
#
#
,---. #
/ \\ \\ #
\`--' \`--' #
#
#
#
##
#
#
#
#
#
(\`-. #
(OO )_ #
,------.) #
\`------' ##
#
#
,--. #
'. \\ #
\`--' #
#
#
#
##
('-. #
( OO ).-. #
/ . --. / #
| \\-. \\ #
.-'-' | | #
\\| |_.' | #
| .-. | #
| | | | #
\`--' \`--' ##
.-. .-') #
\\ ( OO ) #
;-----.\\ #
| .-. | #
| '-' /_) #
| .-. \`. #
| | \\ | #
| '--' / #
\`------' ##
#
#
.-----. #
' .--./ #
| |('-. #
/_) |OO ) #
|| |\`-'| #
(_' '--'\\ #
\`-----' ##
_ .-') _ #
( ( OO) ) #
\\ .'_ #
,\`'--..._) #
| | \\ ' #
| | ' | #
| | / : #
| '--' / #
\`-------' ##
('-. #
_( OO) #
(,------. #
| .---' #
| | #
(| '--. #
| .--' #
| \`---. #
\`------' ##
#
#
,------. #
('-| _.---' #
(OO|(_\\ #
/ | '--. #
\\_)| .--' #
\\| |_) #
\`--' ##
#
#
,----. #
' .-./-') #
| |_( O- ) #
| | .--, \\ #
(| | '. (_/ #
| '--' | #
\`------' ##
('-. .-. #
( OO ) / #
,--. ,--. #
| | | | #
| .| | #
| | #
| .-. | #
| | | | #
\`--' \`--' ##
#
#
,-.-') #
| |OO) #
| | \\ #
| |(_/ #
,| |_.' #
(_| | #
\`--' ##
#
#
,--. #
.-')| ,| #
( OO |(_| #
| \`-'| | #
,--. | | #
| '-' / #
\`-----' ##
.-. .-') #
\\ ( OO ) #
,--. ,--. #
| .' / #
| /, #
| ' _) #
| . \\ #
| |\\ \\ #
\`--' '--' ##
#
#
,--. #
| |.-') #
| | OO ) #
| |\`-' | #
(| '---.' #
| | #
\`------' ##
_ .-') #
( '.( OO )_ #
,--. ,--.)#
| \`.' | #
| | #
| |'.'| | #
| | | | #
| | | | #
\`--' \`--' ##
.-') _ #
( OO ) ) #
,--./ ,--,' #
| \\ | |\\ #
| \\| | ) #
| . |/ #
| |\\ | #
| | \\ | #
\`--' \`--' ##
#
#
.-'),-----. #
( OO' .-. '#
/ | | | |#
\\_) | |\\| |#
\\ | | | |#
\`' '-' '#
\`-----' ##
_ (\`-. #
( (OO ) #
_.\` \\ #
(__...--'' #
| / | | #
| |_.' | #
| .___.' #
| | #
\`--' ##
.-') #
.( OO) #
(_)---\\_) #
' .-. ' #
,| | | | #
(_| | | | #
| | | | #
' '-' '-.#
\`-----'--'##
_ .-') #
( \\( -O ) #
,------. #
| /\`. ' #
| / | | #
| |_.' | #
| . '.' #
| |\\ \\ #
\`--' '--' ##
.-') #
( OO ). #
(_)---\\_) #
/ _ | #
\\ :\` \`. #
'..\`''.) #
.-._) \\ #
\\ / #
\`-----' ##
.-') _ #
( OO) ) #
/ '._ #
|'--...__) #
'--. .--' #
| | #
| | #
| | #
\`--' ##
#
#
,--. ,--. #
| | | | #
| | | .-') #
| |_|( OO )#
| | | \`-' /#
(' '-'(_.-' #
\`-----' ##
(\`-. #
_(OO )_ #
,--(_/ ,. \\#
\\ \\ /(__/#
\\ \\ / / #
\\ ' /, #
\\ /__)#
\\ / #
\`-' ##
(\`\\ .-') /\`#
\`.( OO ),'#
,--./ .--. #
| | | #
| | | |, #
| |.'.| |_)#
| | #
| ,'. | #
'--' '--' ##
) (\`-. #
( OO ). #
(_/. \\_)-. #
\\ \`.' / #
\\ /\\ #
\\ \\ | #
.' \\_) #
/ .'. \\ #
'--' '--' ##
#
#
,--. ,--.#
\\ \`.' / #
.-') / #
(OO \\ / #
| / /\\_ #
\`-./ /.__) #
\`--' ##
.-') _ #
( OO) ) #
,(_)----. #
| | #
'--. / #
(_/ / #
/ /___ #
| | #
\`--------' ##
,--. #
| | #
| .' #
.' / #
< < #
\`. \\ #
| '. #
| | #
\`--' ##
,-. #
| | #
| | #
| | #
| | #
| | #
| | #
| | #
\`-' ##
,--. #
| | #
'. | #
\\ \` #
> > #
/ . #
.' | #
| | #
\`--' ##
#
.--, #
.--' / #
/ ---\` #
\`--' #
#
#
#
##
('-. #
( OO ).-. #
/ . --. / #
| \\-. \\ #
.-'-' | | #
\\| |_.' | #
| .-. | #
| | | | #
\`--' \`--' ##
#
#
.-'),-----. #
( OO' .-. '#
/ | | | |#
\\_) | |\\| |#
\\ | | | |#
\`' '-' '#
\`-----' ##
#
#
,--. ,--. #
| | | | #
| | | .-') #
| |_|( OO )#
| | | \`-' /#
(' '-'(_.-' #
\`-----' ##
('-. #
( OO ).-. #
/ . --. / #
| \\-. \\ #
.-'-' | | #
\\| |_.' | #
| .-. | #
| | | | #
\`--' \`--' ##
#
#
.-'),-----. #
( OO' .-. '#
/ | | | |#
\\_) | |\\| |#
\\ | | | |#
\`' '-' '#
\`-----' ##
#
#
,--. ,--. #
| | | | #
| | | .-') #
| |_|( OO )#
| | | \`-' /#
(' '-'(_.-' #
\`-----' ##
�#
#
#
#
#
#
#
#
##
0xCA0 KANNADA LETTER TTHA
#
#
_ _ _ _)#
|______/ #
,-----. #
' .-. ' #
| | | | #
' '-' ' #
\`-----' ##`
@@ -0,0 +1,50 @@
//#region src/log/logging.d.ts
/** @inline */
type LogLevel = "info" | "debug" | "warn";
/** @inline */
type LogLevelOption = LogLevel | "silent";
/** @inline */
type LogLevelWithError = LogLevel | "error";
interface RolldownLog {
binding?: string;
cause?: unknown;
/**
* The log code for this log object.
* @example 'PLUGIN_ERROR'
*/
code?: string;
exporter?: string;
frame?: string;
hook?: string;
id?: string;
ids?: string[];
loc?: {
column: number;
file?: string;
line: number;
};
/**
* The message for this log object.
* @example 'The "transform" hook used by the output plugin "rolldown-plugin-foo" is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.'
*/
message: string;
meta?: any;
names?: string[];
plugin?: string;
pluginCode?: unknown;
pos?: number;
reexporter?: string;
stack?: string;
url?: string;
}
/** @inline */
type RolldownLogWithString = RolldownLog | string;
/** @category Plugin APIs */
interface RolldownError extends RolldownLog {
name?: string;
stack?: string;
watchFiles?: string[];
}
type LogOrStringHandler = (level: LogLevelWithError, log: RolldownLogWithString) => void;
//#endregion
export { RolldownLog as a, RolldownError as i, LogLevelOption as n, RolldownLogWithString as o, LogOrStringHandler as r, LogLevel as t };
@@ -0,0 +1,8 @@
import { Env, MiddlewareHandler } from "../../types.js";
import { ServeStaticOptions } from "../../middleware/serve-static/index.js";
//#region src/adapter/bun/serve-static.d.ts
/**
* @deprecated `hono/bun` will be removed in v5. Install `@hono/bun` and import from there instead.
*/
export declare const serveStatic: <E extends Env = Env>(options?: ServeStaticOptions<E>) => MiddlewareHandler;
//#endregion
@@ -0,0 +1,208 @@
import * as z from 'zod/v4';
/**
* Reusable URL validation that disallows javascript: scheme
*/
export const SafeUrlSchema = z
.url()
.superRefine((val, ctx) => {
if (!URL.canParse(val)) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'URL must be parseable',
fatal: true
});
return z.NEVER;
}
})
.refine(url => {
const u = new URL(url);
return u.protocol !== 'javascript:' && u.protocol !== 'data:' && u.protocol !== 'vbscript:';
}, { message: 'URL cannot use javascript:, data:, or vbscript: scheme' });
/**
* RFC 9728 OAuth Protected Resource Metadata
*/
export const OAuthProtectedResourceMetadataSchema = z.looseObject({
resource: z.string().url(),
authorization_servers: z.array(SafeUrlSchema).optional(),
jwks_uri: z.string().url().optional(),
scopes_supported: z.array(z.string()).optional(),
bearer_methods_supported: z.array(z.string()).optional(),
resource_signing_alg_values_supported: z.array(z.string()).optional(),
resource_name: z.string().optional(),
resource_documentation: z.string().optional(),
resource_policy_uri: z.string().url().optional(),
resource_tos_uri: z.string().url().optional(),
tls_client_certificate_bound_access_tokens: z.boolean().optional(),
authorization_details_types_supported: z.array(z.string()).optional(),
dpop_signing_alg_values_supported: z.array(z.string()).optional(),
dpop_bound_access_tokens_required: z.boolean().optional()
});
/**
* RFC 8414 OAuth 2.0 Authorization Server Metadata
*/
export const OAuthMetadataSchema = z.looseObject({
issuer: z.string(),
authorization_endpoint: SafeUrlSchema,
token_endpoint: SafeUrlSchema,
registration_endpoint: SafeUrlSchema.optional(),
scopes_supported: z.array(z.string()).optional(),
response_types_supported: z.array(z.string()),
response_modes_supported: z.array(z.string()).optional(),
grant_types_supported: z.array(z.string()).optional(),
token_endpoint_auth_methods_supported: z.array(z.string()).optional(),
token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
service_documentation: SafeUrlSchema.optional(),
revocation_endpoint: SafeUrlSchema.optional(),
revocation_endpoint_auth_methods_supported: z.array(z.string()).optional(),
revocation_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
introspection_endpoint: z.string().optional(),
introspection_endpoint_auth_methods_supported: z.array(z.string()).optional(),
introspection_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
code_challenge_methods_supported: z.array(z.string()).optional(),
client_id_metadata_document_supported: z.boolean().optional()
});
/**
* OpenID Connect Discovery 1.0 Provider Metadata
* see: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
*/
export const OpenIdProviderMetadataSchema = z.looseObject({
issuer: z.string(),
authorization_endpoint: SafeUrlSchema,
token_endpoint: SafeUrlSchema,
userinfo_endpoint: SafeUrlSchema.optional(),
jwks_uri: SafeUrlSchema,
registration_endpoint: SafeUrlSchema.optional(),
scopes_supported: z.array(z.string()).optional(),
response_types_supported: z.array(z.string()),
response_modes_supported: z.array(z.string()).optional(),
grant_types_supported: z.array(z.string()).optional(),
acr_values_supported: z.array(z.string()).optional(),
subject_types_supported: z.array(z.string()),
id_token_signing_alg_values_supported: z.array(z.string()),
id_token_encryption_alg_values_supported: z.array(z.string()).optional(),
id_token_encryption_enc_values_supported: z.array(z.string()).optional(),
userinfo_signing_alg_values_supported: z.array(z.string()).optional(),
userinfo_encryption_alg_values_supported: z.array(z.string()).optional(),
userinfo_encryption_enc_values_supported: z.array(z.string()).optional(),
request_object_signing_alg_values_supported: z.array(z.string()).optional(),
request_object_encryption_alg_values_supported: z.array(z.string()).optional(),
request_object_encryption_enc_values_supported: z.array(z.string()).optional(),
token_endpoint_auth_methods_supported: z.array(z.string()).optional(),
token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
display_values_supported: z.array(z.string()).optional(),
claim_types_supported: z.array(z.string()).optional(),
claims_supported: z.array(z.string()).optional(),
service_documentation: z.string().optional(),
claims_locales_supported: z.array(z.string()).optional(),
ui_locales_supported: z.array(z.string()).optional(),
claims_parameter_supported: z.boolean().optional(),
request_parameter_supported: z.boolean().optional(),
request_uri_parameter_supported: z.boolean().optional(),
require_request_uri_registration: z.boolean().optional(),
op_policy_uri: SafeUrlSchema.optional(),
op_tos_uri: SafeUrlSchema.optional(),
client_id_metadata_document_supported: z.boolean().optional()
});
/**
* OpenID Connect Discovery metadata that may include OAuth 2.0 fields
* This schema represents the real-world scenario where OIDC providers
* return a mix of OpenID Connect and OAuth 2.0 metadata fields
*/
export const OpenIdProviderDiscoveryMetadataSchema = z.object({
...OpenIdProviderMetadataSchema.shape,
...OAuthMetadataSchema.pick({
code_challenge_methods_supported: true
}).shape
});
/**
* OAuth 2.1 token response
*/
export const OAuthTokensSchema = z
.object({
access_token: z.string(),
id_token: z.string().optional(), // Optional for OAuth 2.1, but necessary in OpenID Connect
token_type: z.string(),
expires_in: z.coerce.number().optional(),
scope: z.string().optional(),
refresh_token: z.string().optional(),
/**
* Not part of the wire format: the authorization server this value was obtained from, added by
* the client's `auth()` before it is stored and compared when it is read back.
*/
issuer: z.string().optional().catch(undefined)
})
.strip();
/**
* OAuth 2.1 error response
*/
export const OAuthErrorResponseSchema = z.object({
error: z.string(),
error_description: z.string().optional(),
error_uri: z.string().optional()
});
/**
* Optional version of SafeUrlSchema that allows empty string for retrocompatibility on tos_uri and logo_uri
*/
export const OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z.literal('').transform(() => undefined));
/**
* RFC 7591 OAuth 2.0 Dynamic Client Registration metadata
*/
export const OAuthClientMetadataSchema = z
.object({
redirect_uris: z.array(SafeUrlSchema),
token_endpoint_auth_method: z.string().optional(),
grant_types: z.array(z.string()).optional(),
response_types: z.array(z.string()).optional(),
client_name: z.string().optional(),
client_uri: SafeUrlSchema.optional(),
logo_uri: OptionalSafeUrlSchema,
scope: z.string().optional(),
contacts: z.array(z.string()).optional(),
tos_uri: OptionalSafeUrlSchema,
policy_uri: z.string().optional(),
jwks_uri: SafeUrlSchema.optional(),
jwks: z.any().optional(),
software_id: z.string().optional(),
software_version: z.string().optional(),
software_statement: z.string().optional()
})
.strip();
/**
* RFC 7591 OAuth 2.0 Dynamic Client Registration client information
*/
export const OAuthClientInformationSchema = z
.object({
client_id: z.string(),
client_secret: z.string().optional(),
client_id_issued_at: z.number().optional(),
client_secret_expires_at: z.number().optional(),
/**
* Not part of the wire format: the authorization server this value was obtained from, added by
* the client's `auth()` before it is stored and compared when it is read back.
*/
issuer: z.string().optional().catch(undefined)
})
.strip();
/**
* RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata)
*/
export const OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
/**
* RFC 7591 OAuth 2.0 Dynamic Client Registration error response
*/
export const OAuthClientRegistrationErrorSchema = z
.object({
error: z.string(),
error_description: z.string().optional()
})
.strip();
/**
* RFC 7009 OAuth 2.0 Token Revocation request
*/
export const OAuthTokenRevocationRequestSchema = z
.object({
token: z.string(),
token_type_hint: z.string().optional()
})
.strip();
//# sourceMappingURL=auth.js.map
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _possibleConstructorReturn;
var _assertThisInitialized = require("./assertThisInitialized.js");
function _possibleConstructorReturn(self, value) {
if (value && (typeof value === "object" || typeof value === "function")) {
return value;
} else if (value !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return (0, _assertThisInitialized.default)(self);
}
//# sourceMappingURL=possibleConstructorReturn.js.map
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021-present Tanner Linsley
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,73 @@
{
"name": "@radix-ui/react-alert-dialog",
"version": "1.1.15",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"src",
"dist"
],
"sideEffects": false,
"dependencies": {
"@radix-ui/primitive": "1.1.3",
"@radix-ui/react-context": "1.1.2",
"@radix-ui/react-dialog": "1.1.15",
"@radix-ui/react-primitive": "2.1.3",
"@radix-ui/react-slot": "1.2.3",
"@radix-ui/react-compose-refs": "1.1.2"
},
"devDependencies": {
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"eslint": "^9.18.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"typescript": "^5.7.3",
"@repo/builder": "0.0.0",
"@repo/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0"
},
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@types/react-dom": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1 @@
{"version":3,"file":"size-rollup-style-effect.js","sources":["../lib/render/dom/is-css-var.js","../lib/render/utils/keys-transform.js","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/array.mjs","../lib/frameloop/order.js","../lib/frameloop/batcher.js","../lib/frameloop/render-step.js","../lib/frameloop/frame.js","../../motion-utils/dist/es/noop.mjs","../lib/frameloop/sync-time.js","../lib/value/index.js","../../motion-utils/dist/es/velocity-per-second.mjs","../lib/effects/utils/create-dom-effect.js","../lib/utils/resolve-elements.js","../lib/value/types/numbers/index.js","../lib/value/types/int.js","../lib/value/types/numbers/units.js","../lib/value/types/maps/number.js","../lib/value/types/maps/transform.js","../lib/effects/MotionValueState.js","../lib/value/types/utils/get-as-type.js","../lib/effects/utils/create-effect.js","../lib/effects/style/transform.js","../lib/effects/style/index.js","../lib/utils/is-html-element.js","../../motion-utils/dist/es/is-object.mjs"],"sourcesContent":["export const isCSSVar = (name) => name.startsWith(\"--\");\n//# sourceMappingURL=is-css-var.js.map","/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nexport const transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))();\n//# sourceMappingURL=keys-transform.js.map","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","export const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n//# sourceMappingURL=order.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { stepsOrder } from \"./order\";\nimport { createRenderStep } from \"./render-step\";\nconst maxElapsed = 40;\nexport function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flLine truncated
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_iT _XC","2":"_PS"},D:{"1":"_ZD","16":"_Y"},E:{"1":"_dB","2":"_u"},F:{"1":"_eD","2":"_fB","16":"B _oI _tB"},G:{"1":"_8C","2":"_1"},H:{"2":"1D"},I:{"1":"_X","2":"_W"},J:{"1":"A","2":"D"},K:{"1":"_OQ _eQ","2":"A","16":"B ZC"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:5,C:"FileReaderSync",D:true};
@@ -0,0 +1,22 @@
/**
* Check if the value is null or undefineds
*
* 校验是否是 null 或者 undefined
*
* @example
* ```js
* import { isNil } from 'is-what-type';
*
* isNil(null); // true
* isNil(undefined); // true
* isNil({}); // false
* isNil(''); // false
* isNil(0); // false
* isNil(false); // false
* isNil(NaN); // false
* ```
*
* @param value - The value to check
* @returns `true` if the value is null or undefined, `false` otherwise
*/
export declare function isNil(value: unknown): value is null | undefined;
@@ -0,0 +1,12 @@
/**
* A set of common reasons for calling nullThrows
*/
export declare const NullThrowsReasons: {
readonly MissingParent: "Expected node to have a parent.";
readonly MissingToken: (token: string, thing: string) => string;
};
/**
* Assert that a value must not be null or undefined.
* This is a nice explicit alternative to the non-null assertion operator.
*/
export declare function nullThrows<T>(value: T, message: string): NonNullable<T>;
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Star = createLucideIcon("Star", [
[
"path",
{
d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",
key: "r04s7s"
}
]
]);
export { Star as default };
//# sourceMappingURL=star.js.map
@@ -0,0 +1 @@
{"version":3,"file":"align-vertical-distribute-center.js","sources":["../../../src/icons/align-vertical-distribute-center.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name AlignVerticalDistributeCenter\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjIgMTdoLTMiIC8+CiAgPHBhdGggZD0iTTIyIDdoLTUiIC8+CiAgPHBhdGggZD0iTTUgMTdIMiIgLz4KICA8cGF0aCBkPSJNNyA3SDIiIC8+CiAgPHJlY3QgeD0iNSIgeT0iMTQiIHdpZHRoPSIxNCIgaGVpZ2h0PSI2IiByeD0iMiIgLz4KICA8cmVjdCB4PSI3IiB5PSI0IiB3aWR0aD0iMTAiIGhlaWdodD0iNiIgcng9IjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/align-vertical-distribute-center\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst AlignVerticalDistributeCenter = createLucideIcon('AlignVerticalDistributeCenter', [\n ['path', { d: 'M22 17h-3', key: '1lwga1' }],\n ['path', { d: 'M22 7h-5', key: 'o2endc' }],\n ['path', { d: 'M5 17H2', key: '1gx9xc' }],\n ['path', { d: 'M7 7H2', key: '6bq26l' }],\n ['rect', { x: '5', y: '14', width: '14', height: '6', rx: '2', key: '1qrzuf' }],\n ['rect', { x: '7', y: '4', width: '10', height: '6', rx: '2', key: 'we8e9z' }],\n]);\n\nexport default AlignVerticalDistributeCenter;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgC,iBAAiB,+BAAiC,CAAA,CAAA,CAAA;AAAA,CAAA,CACtF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAG,KAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,QAAQ,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAG,KAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,QAAQ,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/E,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,13 @@
import { t as CfWorkerJsonSchemaValidator } from "./cfWorkerProvider-BylNJ1R5.mjs";
//#region src/shimsBrowser.ts
/**
* Whether `fetch()` may throw `TypeError` due to CORS. Only true in browser contexts
* (including Web Workers / Service Workers). In Node.js and Cloudflare Workers, a
* `TypeError` from `fetch` is always a real network/configuration error.
*/
const CORS_IS_POSSIBLE = true;
//#endregion
export { CORS_IS_POSSIBLE, CfWorkerJsonSchemaValidator as DefaultJsonSchemaValidator };
//# sourceMappingURL=shimsBrowser.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"shirt.js","sources":["../../../src/icons/shirt.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Shirt\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAuMzggMy40NiAxNiAyYTQgNCAwIDAgMS04IDBMMy42MiAzLjQ2YTIgMiAwIDAgMC0xLjM0IDIuMjNsLjU4IDMuNDdhMSAxIDAgMCAwIC45OS44NEg2djEwYzAgMS4xLjkgMiAyIDJoOGEyIDIgMCAwIDAgMi0yVjEwaDIuMTVhMSAxIDAgMCAwIC45OS0uODRsLjU4LTMuNDdhMiAyIDAgMCAwLTEuMzQtMi4yM3oiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/shirt\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Shirt = createLucideIcon('Shirt', [\n [\n 'path',\n {\n d: 'M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z',\n key: '1wgbhj',\n },\n ],\n]);\n\nexport default Shirt;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CACtC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = inheritsComments;
var _inheritTrailingComments = require("./inheritTrailingComments.js");
var _inheritLeadingComments = require("./inheritLeadingComments.js");
var _inheritInnerComments = require("./inheritInnerComments.js");
function inheritsComments(child, parent) {
(0, _inheritTrailingComments.default)(child, parent);
(0, _inheritLeadingComments.default)(child, parent);
(0, _inheritInnerComments.default)(child, parent);
return child;
}
//# sourceMappingURL=inheritsComments.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_taggedTemplateLiteral","strings","raw","slice","Object","freeze","defineProperties","value"],"sources":["../../src/helpers/taggedTemplateLiteral.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _taggedTemplateLiteral(\n strings: readonly string[],\n raw?: readonly string[],\n): TemplateStringsArray {\n if (!raw) {\n raw = strings.slice(0);\n }\n return Object.freeze(\n Object.defineProperties<TemplateStringsArray>(strings as any, {\n raw: { value: Object.freeze(raw) },\n }),\n );\n}\n"],"mappings":";;;;;;AAEe,SAASA,sBAAsBA,CAC5CC,OAA0B,EAC1BC,GAAuB,EACD;EACtB,IAAI,CAACA,GAAG,EAAE;IACRA,GAAG,GAAGD,OAAO,CAACE,KAAK,CAAC,CAAC,CAAC;EACxB;EACA,OAAOC,MAAM,CAACC,MAAM,CAClBD,MAAM,CAACE,gBAAgB,CAAuBL,OAAO,EAAS;IAC5DC,GAAG,EAAE;MAAEK,KAAK,EAAEH,MAAM,CAACC,MAAM,CAACH,GAAG;IAAE;EACnC,CAAC,CACH,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,164 @@
import { __spreadArray } from "tslib";
import * as React from 'react';
import { RemoveScrollBar } from 'react-remove-scroll-bar';
import { styleSingleton } from 'react-style-singleton';
import { nonPassive } from './aggresiveCapture';
import { handleScroll, locationCouldBeScrolled } from './handleScroll';
export var getTouchXY = function (event) {
return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
};
export var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };
var extractRef = function (ref) {
return ref && 'current' in ref ? ref.current : ref;
};
var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };
var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); };
var idCounter = 0;
var lockStack = [];
export function RemoveScrollSideCar(props) {
var shouldPreventQueue = React.useRef([]);
var touchStartRef = React.useRef([0, 0]);
var activeAxis = React.useRef();
var id = React.useState(idCounter++)[0];
var Style = React.useState(styleSingleton)[0];
var lastProps = React.useRef(props);
React.useEffect(function () {
lastProps.current = props;
}, [props]);
React.useEffect(function () {
if (props.inert) {
document.body.classList.add("block-interactivity-".concat(id));
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); });
return function () {
document.body.classList.remove("block-interactivity-".concat(id));
allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); });
};
}
return;
}, [props.inert, props.lockRef.current, props.shards]);
var shouldCancelEvent = React.useCallback(function (event, parent) {
if (('touches' in event && event.touches.length === 2) || (event.type === 'wheel' && event.ctrlKey)) {
return !lastProps.current.allowPinchZoom;
}
var touch = getTouchXY(event);
var touchStart = touchStartRef.current;
var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
var currentAxis;
var target = event.target;
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
// allow horizontal touch move on Range inputs. They will not cause any scroll
if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
return false;
}
// allow drag selection (iOS); check if selection's anchorNode is the same as target or contains target
var selection = window.getSelection();
var anchorNode = selection && selection.anchorNode;
var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
if (isTouchingSelection) {
return false;
}
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
if (!canBeScrolledInMainDirection) {
return true;
}
if (canBeScrolledInMainDirection) {
currentAxis = moveDirection;
}
else {
currentAxis = moveDirection === 'v' ? 'h' : 'v';
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
// other axis might be not scrollable
}
if (!canBeScrolledInMainDirection) {
return false;
}
if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
activeAxis.current = currentAxis;
}
if (!currentAxis) {
return true;
}
var cancelingAxis = activeAxis.current || currentAxis;
return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);
}, []);
var shouldPrevent = React.useCallback(function (_event) {
var event = _event;
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
// not the last active
return;
}
var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta); })[0];
// self event, and should be canceled
if (sourceEvent && sourceEvent.should) {
if (event.cancelable) {
event.preventDefault();
}
return;
}
// outside or shard event
if (!sourceEvent) {
var shardNodes = (lastProps.current.shards || [])
.map(extractRef)
.filter(Boolean)
.filter(function (node) { return node.contains(event.target); });
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
if (shouldStop) {
if (event.cancelable) {
event.preventDefault();
}
}
}
}, []);
var shouldCancel = React.useCallback(function (name, delta, target, should) {
var event = { name: name, delta: delta, target: target, should: should, shadowParent: getOutermostShadowParent(target) };
shouldPreventQueue.current.push(event);
setTimeout(function () {
shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
}, 1);
}, []);
var scrollTouchStart = React.useCallback(function (event) {
touchStartRef.current = getTouchXY(event);
activeAxis.current = undefined;
}, []);
var scrollWheel = React.useCallback(function (event) {
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
}, []);
var scrollTouchMove = React.useCallback(function (event) {
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
}, []);
React.useEffect(function () {
lockStack.push(Style);
props.setCallbacks({
onScrollCapture: scrollWheel,
onWheelCapture: scrollWheel,
onTouchMoveCapture: scrollTouchMove,
});
document.addEventListener('wheel', shouldPrevent, nonPassive);
document.addEventListener('touchmove', shouldPrevent, nonPassive);
document.addEventListener('touchstart', scrollTouchStart, nonPassive);
return function () {
lockStack = lockStack.filter(function (inst) { return inst !== Style; });
document.removeEventListener('wheel', shouldPrevent, nonPassive);
document.removeEventListener('touchmove', shouldPrevent, nonPassive);
document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
};
}, []);
var removeScrollBar = props.removeScrollBar, inert = props.inert;
return (React.createElement(React.Fragment, null,
inert ? React.createElement(Style, { styles: generateStyle(id) }) : null,
removeScrollBar ? React.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null));
}
function getOutermostShadowParent(node) {
var shadowParent = null;
while (node !== null) {
if (node instanceof ShadowRoot) {
shadowParent = node.host;
node = node.host;
}
node = node.parentNode;
}
return shadowParent;
}
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Clock = createLucideIcon("Clock", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
]);
export { Clock as default };
//# sourceMappingURL=clock.js.map
@@ -0,0 +1,20 @@
{
"name": "@esbuild/linux-x64",
"version": "0.28.1",
"description": "The Linux 64-bit binary for esbuild, a JavaScript bundler.",
"repository": {
"type": "git",
"url": "git+https://github.com/evanw/esbuild.git"
},
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=18"
},
"os": [
"linux"
],
"cpu": [
"x64"
]
}
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const OctagonX = createLucideIcon("OctagonX", [
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
[
"path",
{
d: "M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",
key: "2d38gg"
}
],
["path", { d: "m9 9 6 6", key: "z0biqf" }]
]);
export { OctagonX as default };
//# sourceMappingURL=octagon-x.js.map
@@ -0,0 +1 @@
{"version":3,"file":"case-upper.js","sources":["../../../src/icons/case-upper.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CaseUpper\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMyAxNSA0LTggNCA4IiAvPgogIDxwYXRoIGQ9Ik00IDEzaDYiIC8+CiAgPHBhdGggZD0iTTE1IDExaDQuNWEyIDIgMCAwIDEgMCA0SDE1VjdoNGEyIDIgMCAwIDEgMCA0IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/case-upper\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CaseUpper = createLucideIcon('CaseUpper', [\n ['path', { d: 'm3 15 4-8 4 8', key: '1vwr6u' }],\n ['path', { d: 'M4 13h6', key: '1r9ots' }],\n ['path', { d: 'M15 11h4.5a2 2 0 0 1 0 4H15V7h4a2 2 0 0 1 0 4', key: '1sqfas' }],\n]);\n\nexport default CaseUpper;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const PocketKnife = createLucideIcon("PocketKnife", [
["path", { d: "M3 2v1c0 1 2 1 2 2S3 6 3 7s2 1 2 2-2 1-2 2 2 1 2 2", key: "19w3oe" }],
["path", { d: "M18 6h.01", key: "1v4wsw" }],
["path", { d: "M6 18h.01", key: "uhywen" }],
["path", { d: "M20.83 8.83a4 4 0 0 0-5.66-5.66l-12 12a4 4 0 1 0 5.66 5.66Z", key: "6fykxj" }],
["path", { d: "M18 11.66V22a4 4 0 0 0 4-4V6", key: "1utzek" }]
]);
export { PocketKnife as default };
//# sourceMappingURL=pocket-knife.js.map
@@ -0,0 +1,732 @@
export default `flf2a$ 7 7 14 0 16 0 8031 0
Author : MJP
Date : 2003/9/23 6:27:51
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
!#
#
#
#
#
#
##
"#
#
#
#
#
#
##
##
#
#
#
#
#
##
$#
#
#
#
#
#
##
%#
#
#
#
#
#
##
&#
#
#
#
#
#
##
'#
#
#
#
#
#
##
(#
#
#
#
#
#
##
)#
#
#
#
#
#
##
*#
#
#
#
#
#
##
+#
#
#
#
#
#
##
,#
#
#
#
#
#
##
-#
#
#
#
#
#
##
.#
#
#
#
#
#
##
/#
#
#
#
#
#
##
0#
#
#
#
#
#
##
1#
#
#
#
#
#
##
2#
#
#
#
#
#
##
3#
#
#
#
#
#
##
4#
#
#
#
#
#
##
5#
#
#
#
#
#
##
6#
#
#
#
#
#
##
7#
#
#
#
#
#
##
8#
#
#
#
#
#
##
9#
#
#
#
#
#
##
:#
#
#
#
#
#
##
;#
#
#
#
#
#
##
<#
#
#
#
#
#
##
=#
#
#
#
#
#
##
>#
#
#
#
#
#
##
?#
#
#
#
#
#
##
@#
#
#
#
#
#
##
#
/) #
(o)(O) #
//\\\\ #
|(__)| #
/,-. | #
-' '' ##
_ #
/||_ #
/\`_) #
| \`. #
| (_)) #
(.'-' #
) ##
c c #
(OO) #
,'.--.) #
/ //_|_\\ #
| \\___ #
'. ) #
\`-.' ##
_ #
_||\\ #
(_'\\ #
.' | #
((_) | #
\`-\`.) #
( ##
#
wWw #
(O)_ #
.' __) #
( _) #
\`.__) #
##
#
wWw #
(O)_ #
.' __) #
( _) #
)/ #
( ##
\\/ #
(OO) #
,'.--.) #
/ /|_|_\\ #
| \\_.--. #
'. \\) \\ #
\`-.(_.' ##
\\\\ // #
(o)(o) #
|| || #
|(__)| #
/.--.\\ #
-' \`- #
##
wW Ww #
(O)(O) #
(..) #
|| #
_||_ #
(_/\\_) #
##
_ #
_||\\ #
(_'\\ #
( | #
(\\_) | #
\`-\`.) #
( ##
_ #
(OO) .' ) #
||_/ .' #
| / #
||\\ \\ #
(/\\)\\ \`. #
\`._) ##
W W #
(O)(O) #
|| #
| \\ #
| \`. #
(.-.__) #
\`-' ##
\\\\\\ /// #
((O) (O)) #
| \\ / | #
||\\\\//|| #
|| \\/ || #
|| || #
(_/ \\_) ##
\\\\\\ /// #
((O)(O)) #
| \\ || #
||\\\\|| #
|| \\ | #
|| || #
(_/ \\_) ##
.-. #
c(O_O)c #
,'.---.\`, #
/ /|_|_|\\ \\ #
| \\_____/ | #
'. \`---' .\` #
\`-...-' ##
)) #
(o0)-. #
| (_)) #
| .-' #
|( #
\\) #
( ##
.-. #
c(O_O)c #
,'.---.\`, #
/ /|_|_|\\ \\ #
| \\___.--.| #
'. \`---\\) \\ #
\`-...(_.' ##
)) #
(Oo)-. #
| (_)) #
| .' #
)|\\\\ #
(/ \\) #
) ##
oo_ #
/ _)-< #
\\__ \`. #
\`. | #
_| | #
,-' | #
(_..--' ##
(o)__(o) #
(__ __) #
( ) #
)( #
( ) #
)/ #
( ##
wWw wWw #
(O) (O) #
/ ) ( \\ #
/ / \\ \\ #
| \\____/ | #
'. \`--' .\` #
\`-..-' ##
wWw wWw #
(O) (O) #
( \\ / ) #
\\ \\ / / #
/ \\/ \\ #
\\ \`--' / #
\`-..-' ##
(O)) ((O) #
|| || #
|| /\\ || #
||//\\\\|| #
/ / \\ \\ #
( / \\ ) #
) ( ##
wW Ww #
(O)\\ /(O) #
\`. \\/ .' #
\\ / #
/ \\ #
.' /\\ \`. #
(_.' \`._) ##
wWw wWw #
(O) (O) #
( \\ / ) #
\\ \\/ / #
\\o / #
_/ / #
(_.' ##
_oo #
>-(_ \\ #
/ _/ #
/ / #
/ ( #
( \`-. #
\`--.._) ##
[#
#
#
#
#
#
##
\\#
#
#
#
#
#
##
]#
#
#
#
#
#
##
^#
#
#
#
#
#
##
_#
#
#
#
#
#
##
\`#
#
#
#
#
#
##
#
/) #
(o)(O) #
//\\\\ #
|(__)| #
/,-. | #
-' '' ##
_ #
/||_ #
/\`_) #
| \`. #
| (_)) #
(.'-' #
) ##
c c #
(OO) #
,'.--.) #
/ //_|_\\ #
| \\___ #
'. ) #
\`-.' ##
_ #
_||\\ #
(_'\\ #
.' | #
((_) | #
\`-\`.) #
( ##
#
wWw #
(O)_ #
.' __) #
( _) #
\`.__) #
##
#
wWw #
(O)_ #
.' __) #
( _) #
)/ #
( ##
\\/ #
(OO) #
,'.--.) #
/ /|_|_\\ #
| \\_.--. #
'. \\) \\ #
\`-.(_.' ##
\\\\ // #
(o)(o) #
|| || #
|(__)| #
/.--.\\ #
-' \`- #
##
wW Ww #
(O)(O) #
(..) #
|| #
_||_ #
(_/\\_) #
##
_ #
_||\\ #
(_'\\ #
( | #
(\\_) | #
\`-\`.) #
( ##
_ #
(OO) .' ) #
||_/ .' #
| / #
||\\ \\ #
(/\\)\\ \`. #
\`._) ##
W W #
(O)(O) #
|| #
| \\ #
| \`. #
(.-.__) #
\`-' ##
\\\\\\ /// #
((O) (O)) #
| \\ / | #
||\\\\//|| #
|| \\/ || #
|| || #
(_/ \\_) ##
\\\\\\ /// #
((O)(O)) #
| \\ || #
||\\\\|| #
|| \\ | #
|| || #
(_/ \\_) ##
.-. #
c(O_O)c #
,'.---.\`, #
/ /|_|_|\\ \\ #
| \\_____/ | #
'. \`---' .\` #
\`-...-' ##
)) #
(o0)-. #
| (_)) #
| .-' #
|( #
\\) #
( ##
.-. #
c(O_O)c #
,'.---.\`, #
/ /|_|_|\\ \\ #
| \\___.--.| #
'. \`---\\) \\ #
\`-...(_.' ##
)) #
(Oo)-. #
| (_)) #
| .' #
)|\\\\ #
(/ \\) #
) ##
oo_ #
/ _)-< #
\\__ \`. #
\`. | #
_| | #
,-' | #
(_..--' ##
(o)__(o) #
(__ __) #
( ) #
)( #
( ) #
)/ #
( ##
wWw wWw #
(O) (O) #
/ ) ( \\ #
/ / \\ \\ #
| \\____/ | #
'. \`--' .\` #
\`-..-' ##
wWw wWw #
(O) (O) #
( \\ / ) #
\\ \\ / / #
/ \\/ \\ #
\\ \`--' / #
\`-..-' ##
(O)) ((O) #
|| || #
|| /\\ || #
||//\\\\|| #
/ / \\ \\ #
( / \\ ) #
) ( ##
wW Ww #
(O)\\ /(O) #
\`. \\/ .' #
\\ / #
/ \\ #
.' /\\ \`. #
(_.' \`._) ##
wWw wWw #
(O) (O) #
( \\ / ) #
\\ \\/ / #
\\o / #
_/ / #
(_.' ##
_oo #
>-(_ \\ #
/ _/ #
/ / #
/ ( #
( \`-. #
\`--.._) ##
{#
#
#
#
#
#
##
|#
#
#
#
#
#
##
}#
#
#
#
#
#
##
~#
#
#
#
#
#
##
#
/) #
(o)(O) #
//\\\\ #
|(__)| #
/,-. | #
-' '' ##
.-. #
c(O_O)c #
,'.---.\`, #
/ /|_|_|\\ \\ #
| \\_____/ | #
'. \`---' .\` #
\`-...-' ##
wWw wWw #
(O) (O) #
/ ) ( \\ #
/ / \\ \\ #
| \\____/ | #
'. \`--' .\` #
\`-..-' ##
#
/) #
(o)(O) #
//\\\\ #
|(__)| #
/,-. | #
-' '' ##
.-. #
c(O_O)c #
,'.---.\`, #
/ /|_|_|\\ \\ #
| \\_____/ | #
'. \`---' .\` #
\`-...-' ##
wWw wWw #
(O) (O) #
/ ) ( \\ #
/ / \\ \\ #
| \\____/ | #
'. \`--' .\` #
\`-..-' ##
�#
#
#
#
#
#
##
`
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"2":"_S"},D:{"1":"_MM","2":"_DR"},E:{"2":"_VD","194":"_KF"},F:{"1":"_RI","2":"_bR"},G:{"2":"_M"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_sF","2":"_4F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"2":"_C"}},B:4,C:"CSS Painting API",D:true};
@@ -0,0 +1,274 @@
import {
AnyClassGroupIds,
AnyConfig,
AnyThemeGroupIds,
ClassGroup,
ClassValidator,
Config,
ThemeGetter,
ThemeObject,
} from './types'
import { concatArrays } from './utils'
export interface ClassPartObject {
nextPart: Map<string, ClassPartObject>
validators: ClassValidatorObject[] | null
classGroupId: AnyClassGroupIds | undefined // Always define optional props for consistent shape
}
interface ClassValidatorObject {
classGroupId: AnyClassGroupIds
validator: ClassValidator
}
// Factory function ensures consistent object shapes
const createClassValidatorObject = (
classGroupId: AnyClassGroupIds,
validator: ClassValidator,
): ClassValidatorObject => ({
classGroupId,
validator,
})
// Factory ensures consistent ClassPartObject shape
const createClassPartObject = (
nextPart: Map<string, ClassPartObject> = new Map(),
validators: ClassValidatorObject[] | null = null,
classGroupId?: AnyClassGroupIds,
): ClassPartObject => ({
nextPart,
validators,
classGroupId,
})
const CLASS_PART_SEPARATOR = '-'
const EMPTY_CONFLICTS: readonly AnyClassGroupIds[] = []
// I use two dots here because one dot is used as prefix for class groups in plugins
const ARBITRARY_PROPERTY_PREFIX = 'arbitrary..'
export const createClassGroupUtils = (config: AnyConfig) => {
const classMap = createClassMap(config)
const { conflictingClassGroups, conflictingClassGroupModifiers } = config
const getClassGroupId = (className: string) => {
if (className.startsWith('[') && className.endsWith(']')) {
return getGroupIdForArbitraryProperty(className)
}
const classParts = className.split(CLASS_PART_SEPARATOR)
// Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and skip it.
const startIndex = classParts[0] === '' && classParts.length > 1 ? 1 : 0
return getGroupRecursive(classParts, startIndex, classMap)
}
const getConflictingClassGroupIds = (
classGroupId: AnyClassGroupIds,
hasPostfixModifier: boolean,
): readonly AnyClassGroupIds[] => {
if (hasPostfixModifier) {
const modifierConflicts = conflictingClassGroupModifiers[classGroupId]
const baseConflicts = conflictingClassGroups[classGroupId]
if (modifierConflicts) {
if (baseConflicts) {
// Merge base conflicts with modifier conflicts
return concatArrays(baseConflicts, modifierConflicts)
}
// Only modifier conflicts
return modifierConflicts
}
// Fall back to without postfix if no modifier conflicts
return baseConflicts || EMPTY_CONFLICTS
}
return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS
}
return {
getClassGroupId,
getConflictingClassGroupIds,
}
}
const getGroupRecursive = (
classParts: string[],
startIndex: number,
classPartObject: ClassPartObject,
): AnyClassGroupIds | undefined => {
const classPathsLength = classParts.length - startIndex
if (classPathsLength === 0) {
return classPartObject.classGroupId
}
const currentClassPart = classParts[startIndex]!
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart)
if (nextClassPartObject) {
const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject)
if (result) return result
}
const validators = classPartObject.validators
if (validators === null) {
return undefined
}
// Build classRest string efficiently by joining from startIndex onwards
const classRest =
startIndex === 0
? classParts.join(CLASS_PART_SEPARATOR)
: classParts.slice(startIndex).join(CLASS_PART_SEPARATOR)
const validatorsLength = validators.length
for (let i = 0; i < validatorsLength; i++) {
const validatorObj = validators[i]!
if (validatorObj.validator(classRest)) {
return validatorObj.classGroupId
}
}
return undefined
}
/**
* Get the class group ID for an arbitrary property.
*
* @param className - The class name to get the group ID for. Is expected to be string starting with `[` and ending with `]`.
*/
const getGroupIdForArbitraryProperty = (className: string): AnyClassGroupIds | undefined =>
className.slice(1, -1).indexOf(':') === -1
? undefined
: (() => {
const content = className.slice(1, -1)
const colonIndex = content.indexOf(':')
const property = content.slice(0, colonIndex)
return property ? ARBITRARY_PROPERTY_PREFIX + property : undefined
})()
/**
* Exported for testing only
*/
export const createClassMap = (config: Config<AnyClassGroupIds, AnyThemeGroupIds>) => {
const { theme, classGroups } = config
return processClassGroups(classGroups, theme)
}
// Split into separate functions to maintain monomorphic call sites
const processClassGroups = (
classGroups: Record<AnyClassGroupIds, ClassGroup<AnyThemeGroupIds>>,
theme: ThemeObject<AnyThemeGroupIds>,
): ClassPartObject => {
const classMap = createClassPartObject()
for (const classGroupId in classGroups) {
const group = classGroups[classGroupId]!
processClassesRecursively(group, classMap, classGroupId, theme)
}
return classMap
}
const processClassesRecursively = (
classGroup: ClassGroup<AnyThemeGroupIds>,
classPartObject: ClassPartObject,
classGroupId: AnyClassGroupIds,
theme: ThemeObject<AnyThemeGroupIds>,
) => {
const len = classGroup.length
for (let i = 0; i < len; i++) {
const classDefinition = classGroup[i]!
processClassDefinition(classDefinition, classPartObject, classGroupId, theme)
}
}
// Split into separate functions for each type to maintain monomorphic call sites
const processClassDefinition = (
classDefinition: ClassGroup<AnyThemeGroupIds>[number],
classPartObject: ClassPartObject,
classGroupId: AnyClassGroupIds,
theme: ThemeObject<AnyThemeGroupIds>,
) => {
if (typeof classDefinition === 'string') {
processStringDefinition(classDefinition, classPartObject, classGroupId)
return
}
if (typeof classDefinition === 'function') {
processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme)
return
}
processObjectDefinition(
classDefinition as Record<string, ClassGroup<AnyThemeGroupIds>>,
classPartObject,
classGroupId,
theme,
)
}
const processStringDefinition = (
classDefinition: string,
classPartObject: ClassPartObject,
classGroupId: AnyClassGroupIds,
) => {
const classPartObjectToEdit =
classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition)
classPartObjectToEdit.classGroupId = classGroupId
}
const processFunctionDefinition = (
classDefinition: Function,
classPartObject: ClassPartObject,
classGroupId: AnyClassGroupIds,
theme: ThemeObject<AnyThemeGroupIds>,
) => {
if (isThemeGetter(classDefinition)) {
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme)
return
}
if (classPartObject.validators === null) {
classPartObject.validators = []
}
classPartObject.validators.push(
createClassValidatorObject(classGroupId, classDefinition as ClassValidator),
)
}
const processObjectDefinition = (
classDefinition: Record<string, ClassGroup<AnyThemeGroupIds>>,
classPartObject: ClassPartObject,
classGroupId: AnyClassGroupIds,
theme: ThemeObject<AnyThemeGroupIds>,
) => {
const entries = Object.entries(classDefinition)
const len = entries.length
for (let i = 0; i < len; i++) {
const [key, value] = entries[i]!
processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme)
}
}
const getPart = (classPartObject: ClassPartObject, path: string): ClassPartObject => {
let current = classPartObject
const parts = path.split(CLASS_PART_SEPARATOR)
const len = parts.length
for (let i = 0; i < len; i++) {
const part = parts[i]!
let next = current.nextPart.get(part)
if (!next) {
next = createClassPartObject()
current.nextPart.set(part, next)
}
current = next
}
return current
}
// Type guard maintains monomorphic check
const isThemeGetter = (func: Function): func is ThemeGetter =>
'isThemeGetter' in func && (func as ThemeGetter).isThemeGetter === true
@@ -0,0 +1,22 @@
// Generated by LiveScript 1.6.0
(function(){
var parseString, cast, parseType, VERSION, parsedTypeParse, parse;
parseString = require('./parse-string');
cast = require('./cast');
parseType = require('type-check').parseType;
VERSION = '0.4.1';
parsedTypeParse = function(parsedType, string, options){
options == null && (options = {});
options.explicit == null && (options.explicit = false);
options.customTypes == null && (options.customTypes = {});
return cast(parseString(parsedType, string, options), parsedType, options);
};
parse = function(type, string, options){
return parsedTypeParse(parseType(type), string, options);
};
module.exports = {
VERSION: VERSION,
parse: parse,
parsedTypeParse: parsedTypeParse
};
}).call(this);
@@ -0,0 +1,124 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "χαρακτήρες", verb: "να έχει" },
file: { unit: "bytes", verb: "να έχει" },
array: { unit: "στοιχεία", verb: "να έχει" },
set: { unit: "στοιχεία", verb: "να έχει" },
map: { unit: "καταχωρήσεις", verb: "να έχει" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "είσοδος",
email: "διεύθυνση email",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO ημερομηνία και ώρα",
date: "ISO ημερομηνία",
time: "ISO ώρα",
duration: "ISO διάρκεια",
ipv4: "διεύθυνση IPv4",
ipv6: "διεύθυνση IPv6",
mac: "διεύθυνση MAC",
cidrv4: "εύρος IPv4",
cidrv6: "εύρος IPv6",
base64: "συμβολοσειρά κωδικοποιημένη σε base64",
base64url: "συμβολοσειρά κωδικοποιημένη σε base64url",
json_string: "συμβολοσειρά JSON",
e164: "αριθμός E.164",
credit_card: "αριθμός πιστωτικής κάρτας",
currency_code: "κωδικός νομίσματος",
iban: "IBAN",
jwt: "JWT",
template_literal: "είσοδος",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (typeof issue.expected === "string" && /^[A-Z]/.test(issue.expected)) {
return `Μη έγκυρη είσοδος: αναμενόταν instanceof ${issue.expected}, λήφθηκε ${received}`;
}
return `Μη έγκυρη είσοδος: αναμενόταν ${expected}, λήφθηκε ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Μη έγκυρη είσοδος: αναμενόταν ${util.stringifyPrimitive(issue.values[0])}`;
return `Μη έγκυρη επιλογή: αναμενόταν ένα από ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Πολύ μεγάλο: αναμενόταν ${issue.origin ?? "τιμή"} να έχει ${adj}${issue.maximum.toString()} ${sizing.unit ?? "στοιχεία"}`;
return `Πολύ μεγάλο: αναμενόταν ${issue.origin ?? "τιμή"} να είναι ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Πολύ μικρό: αναμενόταν ${issue.origin} να έχει ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Πολύ μικρό: αναμενόταν ${issue.origin} να είναι ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") {
return `Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${_issue.prefix}"`;
}
if (_issue.format === "ends_with") return `Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${_issue.suffix}"`;
if (_issue.format === "includes") return `Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${_issue.includes}"`;
if (_issue.format === "regex")
return `Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${_issue.pattern}`;
return `Μη έγκυρο: ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${issue.divisor}`;
case "unrecognized_keys":
return `Άγνωστ${issue.keys.length > 1 ? "α" : "ο"} κλειδ${issue.keys.length > 1 ? "ιά" : "ί"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Μη έγκυρο κλειδί στο ${issue.origin}`;
case "invalid_union":
return "Μη έγκυρη είσοδος";
case "invalid_element":
return `Μη έγκυρη τιμή στο ${issue.origin}`;
default:
return `Μη έγκυρη είσοδος`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1,61 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2019 = void 0;
const core_1 = require("./core");
const draft7_1 = require("./vocabularies/draft7");
const dynamic_1 = require("./vocabularies/dynamic");
const next_1 = require("./vocabularies/next");
const unevaluated_1 = require("./vocabularies/unevaluated");
const discriminator_1 = require("./vocabularies/discriminator");
const json_schema_2019_09_1 = require("./refs/json-schema-2019-09");
const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema";
class Ajv2019 extends core_1.default {
constructor(opts = {}) {
super({
...opts,
dynamicRef: true,
next: true,
unevaluated: true,
});
}
_addVocabularies() {
super._addVocabularies();
this.addVocabulary(dynamic_1.default);
draft7_1.default.forEach((v) => this.addVocabulary(v));
this.addVocabulary(next_1.default);
this.addVocabulary(unevaluated_1.default);
if (this.opts.discriminator)
this.addKeyword(discriminator_1.default);
}
_addDefaultMetaSchema() {
super._addDefaultMetaSchema();
const { $data, meta } = this.opts;
if (!meta)
return;
json_schema_2019_09_1.default.call(this, $data);
this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
}
defaultMeta() {
return (this.opts.defaultMeta =
super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));
}
}
exports.Ajv2019 = Ajv2019;
module.exports = exports = Ajv2019;
module.exports.Ajv2019 = Ajv2019;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Ajv2019;
var validate_1 = require("./compile/validate");
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });
var codegen_1 = require("./compile/codegen");
Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } });
Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } });
Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } });
Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } });
Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } });
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } });
var validation_error_1 = require("./runtime/validation_error");
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } });
var ref_error_1 = require("./compile/ref_error");
Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } });
//# sourceMappingURL=2019.js.map
@@ -0,0 +1,134 @@
import { N as NamedUtilityValue, P as PluginUtils } from './resolve-config-B4yBzhca.js';
import './colors-C__qRT83.js';
/**
* The source code for one or more nodes in the AST
*
* This generally corresponds to a stylesheet
*/
interface Source {
/**
* The path to the file that contains the referenced source code
*
* If this references the *output* source code, this is `null`.
*/
file: string | null;
/**
* The referenced source code
*/
code: string;
}
/**
* The file and offsets within it that this node covers
*
* This can represent either:
* - A location in the original CSS which caused this node to be created
* - A location in the output CSS where this node resides
*/
type SourceLocation = [source: Source, start: number, end: number];
type Config = UserConfig;
type PluginFn = (api: PluginAPI) => void;
type PluginWithConfig = {
handler: PluginFn;
config?: UserConfig;
/** @internal */
reference?: boolean;
src?: SourceLocation | undefined;
};
type PluginWithOptions<T> = {
(options?: T): PluginWithConfig;
__isOptionsFunction: true;
};
type Plugin = PluginFn | PluginWithConfig | PluginWithOptions<any>;
type PluginAPI = {
addBase(base: CssInJs): void;
addVariant(name: string, variant: string | string[] | CssInJs): void;
matchVariant<T = string>(name: string, cb: (value: T | string, extra: {
modifier: string | null;
}) => string | string[], options?: {
values?: Record<string, T>;
sort?(a: {
value: T | string;
modifier: string | null;
}, b: {
value: T | string;
modifier: string | null;
}): number;
}): void;
addUtilities(utilities: Record<string, CssInJs | CssInJs[]> | Record<string, CssInJs | CssInJs[]>[], options?: {}): void;
matchUtilities(utilities: Record<string, (value: string, extra: {
modifier: string | null;
}) => CssInJs | CssInJs[]>, options?: Partial<{
type: string | string[];
supportsNegativeValues: boolean;
values: Record<string, string> & {
__BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined;
};
modifiers: 'any' | Record<string, string>;
}>): void;
addComponents(utilities: Record<string, CssInJs> | Record<string, CssInJs>[], options?: {}): void;
matchComponents(utilities: Record<string, (value: string, extra: {
modifier: string | null;
}) => CssInJs>, options?: Partial<{
type: string | string[];
supportsNegativeValues: boolean;
values: Record<string, string> & {
__BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined;
};
modifiers: 'any' | Record<string, string>;
}>): void;
theme(path: string, defaultValue?: any): any;
config(path?: string, defaultValue?: any): any;
prefix(className: string): string;
};
type CssInJs = {
[key: string]: string | string[] | CssInJs | CssInJs[];
};
type ResolvableTo<T> = T | ((utils: PluginUtils) => T);
type ThemeValue = ResolvableTo<Record<string, unknown>> | null | undefined;
type ThemeConfig = Record<string, ThemeValue> & {
extend?: Record<string, ThemeValue>;
};
type ContentFile = string | {
raw: string;
extension?: string;
};
type DarkModeStrategy = false | 'media' | 'class' | ['class', string] | 'selector' | ['selector', string] | ['variant', string | string[]];
interface UserConfig {
presets?: UserConfig[];
theme?: ThemeConfig;
plugins?: Plugin[];
}
interface UserConfig {
content?: ContentFile[] | {
relative?: boolean;
files: ContentFile[];
};
}
interface UserConfig {
darkMode?: DarkModeStrategy;
}
interface UserConfig {
prefix?: string;
}
interface UserConfig {
blocklist?: string[];
}
interface UserConfig {
important?: boolean | string;
}
interface UserConfig {
future?: 'all' | Record<string, boolean>;
}
interface UserConfig {
experimental?: 'all' | Record<string, boolean>;
}
declare function createPlugin(handler: PluginFn, config?: Partial<Config>): PluginWithConfig;
declare namespace createPlugin {
var withOptions: <T>(pluginFunction: (options?: T) => PluginFn, configFunction?: (options?: T) => Partial<Config>) => PluginWithOptions<T>;
}
export { createPlugin as default };
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const VolumeX = createLucideIcon("VolumeX", [
[
"path",
{
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
key: "uqj9uw"
}
],
["line", { x1: "22", x2: "16", y1: "9", y2: "15", key: "1ewh16" }],
["line", { x1: "16", x2: "22", y1: "9", y2: "15", key: "5ykzw1" }]
]);
export { VolumeX as default };
//# sourceMappingURL=volume-x.js.map
@@ -0,0 +1,139 @@
<h1 align="center"> <code>express-rate-limit</code> </h1>
<div align="center">
[![tests](https://img.shields.io/github/actions/workflow/status/express-rate-limit/express-rate-limit/ci.yaml)](https://github.com/express-rate-limit/express-rate-limit/actions/workflows/ci.yaml)
[![npm version](https://img.shields.io/npm/v/express-rate-limit.svg)](https://npmjs.org/package/express-rate-limit 'View this project on NPM')
[![npm downloads](https://img.shields.io/npm/dm/express-rate-limit)](https://www.npmjs.com/package/express-rate-limit)
[![license](https://img.shields.io/npm/l/express-rate-limit)](license.md)
</div>
Basic rate-limiting middleware for [Express](http://expressjs.com/). Use to
limit repeated requests to public APIs and/or endpoints such as password reset.
Plays nice with
[express-slow-down](https://www.npmjs.com/package/express-slow-down) and
[ratelimit-header-parser](https://www.npmjs.com/package/ratelimit-header-parser).
## Usage
The [full documentation](https://express-rate-limit.mintlify.app/overview) is
available on-line.
```ts
import { rateLimit } from 'express-rate-limit'
const limiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
limit: 100, // Limit each IP to 100 requests per `window` (here, per 15 minutes).
standardHeaders: 'draft-8', // draft-6: `RateLimit-*` headers; draft-7 & draft-8: combined `RateLimit` header
legacyHeaders: false, // Disable the `X-RateLimit-*` headers.
ipv6Subnet: 56, // Set to 60 or 64 to be less aggressive, or 52 or 48 to be more aggressive
// store: ... , // Redis, Memcached, etc. See below.
})
// Apply the rate limiting middleware to all requests.
app.use(limiter)
```
### Data Stores
The rate limiter comes with a built-in memory store, and supports a variety of
[external data stores](https://express-rate-limit.mintlify.app/reference/stores).
### Configuration
All function options may be async. Click the name for additional info and
default values.
| Option | Type | Remarks |
| -------------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [`windowMs`] | `number` | How long to remember requests for, in milliseconds. |
| [`limit`] | `number` \| `function` | How many requests to allow. |
| [`message`] | `string` \| `json` \| `function` | Response to return after limit is reached. |
| [`statusCode`] | `number` | HTTP status code after limit is reached (default is 429). |
| [`handler`] | `function` | Function to run after limit is reached (overrides `message` and `statusCode` settings, if set). |
| [`legacyHeaders`] | `boolean` | Enable the `X-Rate-Limit` header. |
| [`standardHeaders`] | `'draft-6'` \| `'draft-7'` \| `'draft-8'` | Enable the `Ratelimit` header. |
| [`identifier`] | `string` \| `function` | Name associated with the quota policy enforced by this rate limiter. |
| [`store`] | `Store` | Use a custom store to share hit counts across multiple nodes. |
| [`passOnStoreError`] | `boolean` | Allow (`true`) or block (`false`, default) traffic if the store becomes unavailable. |
| [`keyGenerator`] | `function` | Identify users (defaults to IP address). |
| [`ipv6Subnet`] | `number` (32-64) \| `function` \| `false` | How many bits of IPv6 addresses to use in default `keyGenerator` |
| [`requestPropertyName`] | `string` | Add rate limit info to the `req` object. |
| [`skip`] | `function` | Return `true` to bypass the limiter for the given request. |
| [`skipSuccessfulRequests`] | `boolean` | Uncount 1xx/2xx/3xx responses. |
| [`skipFailedRequests`] | `boolean` | Uncount 4xx/5xx responses. |
| [`requestWasSuccessful`] | `function` | Used by `skipSuccessfulRequests` and `skipFailedRequests`. |
| [`validate`] | `boolean` \| `object` | Enable or disable built-in validation checks. |
| [`logger`] | `Logger` | Custom logger |
## Thank You
---
Thanks to Mintlify for hosting the documentation at
[express-rate-limit.mintlify.app](https://express-rate-limit.mintlify.app)
<p align="center">
<a href="https://mintlify.com/?utm_campaign=devmark&utm_medium=readme&utm_source=express-rate-limit">
<img height="75" src="https://devmark-public-assets.s3.us-west-2.amazonaws.com/sponsorships/mintlify.svg" alt="Create your docs today">
</a>
</p>
---
And thank you to everyone who's contributed to this project in any way! 🫶
## Issues and Contributing
If you encounter a bug or want to see something added/changed, please go ahead
and
[open an issue](https://github.com/express-rate-limit/express-rate-limit/issues/new)!
If you need help with something, feel free to
[start a discussion](https://github.com/express-rate-limit/express-rate-limit/discussions/new)!
If you wish to contribute to the library, thanks! First, please read
[the contributing guide](https://express-rate-limit.mintlify.app/guides/contributing).
Then you can pick up any issue and fix/implement it!
## License
MIT © [Nathan Friedly](http://nfriedly.com/),
[Vedant K](https://github.com/gamemaker1)
[`windowMs`]:
https://express-rate-limit.mintlify.app/reference/configuration#windowms
[`limit`]: https://express-rate-limit.mintlify.app/reference/configuration#limit
[`message`]:
https://express-rate-limit.mintlify.app/reference/configuration#message
[`statusCode`]:
https://express-rate-limit.mintlify.app/reference/configuration#statuscode
[`handler`]:
https://express-rate-limit.mintlify.app/reference/configuration#handler
[`legacyHeaders`]:
https://express-rate-limit.mintlify.app/reference/configuration#legacyheaders
[`standardHeaders`]:
https://express-rate-limit.mintlify.app/reference/configuration#standardheaders
[`identifier`]:
https://express-rate-limit.mintlify.app/reference/configuration#identifier
[`store`]: https://express-rate-limit.mintlify.app/reference/configuration#store
[`passOnStoreError`]:
https://express-rate-limit.mintlify.app/reference/configuration#passonstoreerror
[`keyGenerator`]:
https://express-rate-limit.mintlify.app/reference/configuration#keygenerator
[`ipv6Subnet`]:
https://express-rate-limit.mintlify.app/reference/configuration#ipv6subnet
[`requestPropertyName`]:
https://express-rate-limit.mintlify.app/reference/configuration#requestpropertyname
[`skip`]: https://express-rate-limit.mintlify.app/reference/configuration#skip
[`skipSuccessfulRequests`]:
https://express-rate-limit.mintlify.app/reference/configuration#skipsuccessfulrequests
[`skipFailedRequests`]:
https://express-rate-limit.mintlify.app/reference/configuration#skipfailedrequests
[`requestWasSuccessful`]:
https://express-rate-limit.mintlify.app/reference/configuration#requestwassuccessful
[`validate`]:
https://express-rate-limit.mintlify.app/reference/configuration#validate
[`logger`]:
https://express-rate-limit.mintlify.app/reference/configuration#logger
@@ -0,0 +1,146 @@
import { ElementType } from "domelementtype";
import { Element, Text, Comment, CDATA, Document, ProcessingInstruction, } from "./node.js";
export * from "./node.js";
// Default options
const defaultOpts = {
withStartIndices: false,
withEndIndices: false,
xmlMode: false,
};
export class DomHandler {
/**
* @param callback Called once parsing has completed.
* @param options Settings for the handler.
* @param elementCB Callback whenever a tag is closed.
*/
constructor(callback, options, elementCB) {
/** The elements of the DOM */
this.dom = [];
/** The root element for the DOM */
this.root = new Document(this.dom);
/** Indicated whether parsing has been completed. */
this.done = false;
/** Stack of open tags. */
this.tagStack = [this.root];
/** A data node that is still being written to. */
this.lastNode = null;
/** Reference to the parser instance. Used for location information. */
this.parser = null;
// Make it possible to skip arguments, for backwards-compatibility
if (typeof options === "function") {
elementCB = options;
options = defaultOpts;
}
if (typeof callback === "object") {
options = callback;
callback = undefined;
}
this.callback = callback !== null && callback !== void 0 ? callback : null;
this.options = options !== null && options !== void 0 ? options : defaultOpts;
this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
}
onparserinit(parser) {
this.parser = parser;
}
// Resets the handler back to starting state
onreset() {
this.dom = [];
this.root = new Document(this.dom);
this.done = false;
this.tagStack = [this.root];
this.lastNode = null;
this.parser = null;
}
// Signals the handler that parsing is done
onend() {
if (this.done)
return;
this.done = true;
this.parser = null;
this.handleCallback(null);
}
onerror(error) {
this.handleCallback(error);
}
onclosetag() {
this.lastNode = null;
const elem = this.tagStack.pop();
if (this.options.withEndIndices) {
elem.endIndex = this.parser.endIndex;
}
if (this.elementCB)
this.elementCB(elem);
}
onopentag(name, attribs) {
const type = this.options.xmlMode ? ElementType.Tag : undefined;
const element = new Element(name, attribs, undefined, type);
this.addNode(element);
this.tagStack.push(element);
}
ontext(data) {
const { lastNode } = this;
if (lastNode && lastNode.type === ElementType.Text) {
lastNode.data += data;
if (this.options.withEndIndices) {
lastNode.endIndex = this.parser.endIndex;
}
}
else {
const node = new Text(data);
this.addNode(node);
this.lastNode = node;
}
}
oncomment(data) {
if (this.lastNode && this.lastNode.type === ElementType.Comment) {
this.lastNode.data += data;
return;
}
const node = new Comment(data);
this.addNode(node);
this.lastNode = node;
}
oncommentend() {
this.lastNode = null;
}
oncdatastart() {
const text = new Text("");
const node = new CDATA([text]);
this.addNode(node);
text.parent = node;
this.lastNode = text;
}
oncdataend() {
this.lastNode = null;
}
onprocessinginstruction(name, data) {
const node = new ProcessingInstruction(name, data);
this.addNode(node);
}
handleCallback(error) {
if (typeof this.callback === "function") {
this.callback(error, this.dom);
}
else if (error) {
throw error;
}
}
addNode(node) {
const parent = this.tagStack[this.tagStack.length - 1];
const previousSibling = parent.children[parent.children.length - 1];
if (this.options.withStartIndices) {
node.startIndex = this.parser.startIndex;
}
if (this.options.withEndIndices) {
node.endIndex = this.parser.endIndex;
}
parent.children.push(node);
if (previousSibling) {
node.prev = previousSibling;
previousSibling.next = node;
}
node.parent = parent;
this.lastNode = null;
}
}
export default DomHandler;
@@ -0,0 +1,27 @@
/**
* @fileoverview The list of feature flags supported by the parser and their default
* settings.
* @author Nicholas C. Zakas
*/
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
// None!
//------------------------------------------------------------------------------
// Public
//------------------------------------------------------------------------------
export default {
// React JSX parsing
jsx: false,
// allow return statement in global scope
globalReturn: false,
// allow implied strict mode
impliedStrict: false
};
@@ -0,0 +1,151 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://json-schema.org/draft-07/schema#",
"title": "Core schema meta-schema",
"definitions": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": {"$ref": "#"}
},
"nonNegativeInteger": {
"type": "integer",
"minimum": 0
},
"nonNegativeIntegerDefault0": {
"allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}]
},
"simpleTypes": {
"enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
},
"stringArray": {
"type": "array",
"items": {"type": "string"},
"uniqueItems": true,
"default": []
}
},
"type": ["object", "boolean"],
"properties": {
"$id": {
"type": "string",
"format": "uri-reference"
},
"$schema": {
"type": "string",
"format": "uri"
},
"$ref": {
"type": "string",
"format": "uri-reference"
},
"$comment": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"default": true,
"readOnly": {
"type": "boolean",
"default": false
},
"examples": {
"type": "array",
"items": true
},
"multipleOf": {
"type": "number",
"exclusiveMinimum": 0
},
"maximum": {
"type": "number"
},
"exclusiveMaximum": {
"type": "number"
},
"minimum": {
"type": "number"
},
"exclusiveMinimum": {
"type": "number"
},
"maxLength": {"$ref": "#/definitions/nonNegativeInteger"},
"minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
"pattern": {
"type": "string",
"format": "regex"
},
"additionalItems": {"$ref": "#"},
"items": {
"anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}],
"default": true
},
"maxItems": {"$ref": "#/definitions/nonNegativeInteger"},
"minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
"uniqueItems": {
"type": "boolean",
"default": false
},
"contains": {"$ref": "#"},
"maxProperties": {"$ref": "#/definitions/nonNegativeInteger"},
"minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
"required": {"$ref": "#/definitions/stringArray"},
"additionalProperties": {"$ref": "#"},
"definitions": {
"type": "object",
"additionalProperties": {"$ref": "#"},
"default": {}
},
"properties": {
"type": "object",
"additionalProperties": {"$ref": "#"},
"default": {}
},
"patternProperties": {
"type": "object",
"additionalProperties": {"$ref": "#"},
"propertyNames": {"format": "regex"},
"default": {}
},
"dependencies": {
"type": "object",
"additionalProperties": {
"anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}]
}
},
"propertyNames": {"$ref": "#"},
"const": true,
"enum": {
"type": "array",
"items": true,
"minItems": 1,
"uniqueItems": true
},
"type": {
"anyOf": [
{"$ref": "#/definitions/simpleTypes"},
{
"type": "array",
"items": {"$ref": "#/definitions/simpleTypes"},
"minItems": 1,
"uniqueItems": true
}
]
},
"format": {"type": "string"},
"contentMediaType": {"type": "string"},
"contentEncoding": {"type": "string"},
"if": {"$ref": "#"},
"then": {"$ref": "#"},
"else": {"$ref": "#"},
"allOf": {"$ref": "#/definitions/schemaArray"},
"anyOf": {"$ref": "#/definitions/schemaArray"},
"oneOf": {"$ref": "#/definitions/schemaArray"},
"not": {"$ref": "#"}
},
"default": true
}
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './chart-column.js';
//# sourceMappingURL=bar-chart-3.js.map
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CloudRain = createLucideIcon("CloudRain", [
["path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242", key: "1pljnt" }],
["path", { d: "M16 14v6", key: "1j4efv" }],
["path", { d: "M8 14v6", key: "17c4r9" }],
["path", { d: "M12 16v6", key: "c8a4gj" }]
]);
export { CloudRain as default };
//# sourceMappingURL=cloud-rain.js.map
@@ -0,0 +1,119 @@
declare type CallbackFunction<T = string> = (error: Error | null, result?: T) => void;
declare interface FigletDefaults {
font: FontName;
fontPath: string;
fetchFontIfMissing: boolean;
}
declare class FigletFont {
options: FontMetadata;
comment: string;
numChars: number;
[charCode: number]: string[];
constructor();
}
declare interface FigletModule {
loadFont: (font: FontName, callback?: CallbackFunction<FontMetadata>) => Promise<FontMetadata | null>;
loadFontSync: (font: FontName) => FontMetadata;
fonts: (callback?: CallbackFunction<FontName[]>) => Promise<FontName[]>;
fontsSync: () => FontName[];
parseFont: (font: FontName, data: string, override?: boolean) => FontMetadata;
preloadFonts: (fonts: FontName[], callback?: (error?: Error) => void) => Promise<void>;
loadedFonts: () => string[];
clearLoadedFonts: () => void;
textSync: (text: string, options?: FigletOptions) => string;
text: (text: string, optionsOrFontOrCallback?: FigletOptions | FontName | CallbackFunction<string>, callback?: CallbackFunction<string>) => Promise<string>;
(text: string, optionsOrFontOrCallback?: FigletOptions | FontName | CallbackFunction<string>, callback?: CallbackFunction<string>): Promise<string>;
figFonts: Record<string, FigletFont>;
defaults: (opts?: Partial<FigletDefaults>) => FigletDefaults;
metadata: (fontName: FontName, callback?: (error: Error | null, fontOptions?: FontMetadata, comment?: string) => void) => Promise<[FontMetadata, string] | null>;
}
declare interface FigletOptions {
font?: FontName;
horizontalLayout?: KerningMethods;
verticalLayout?: KerningMethods;
width?: number;
whitespaceBreak?: boolean;
printDirection?: PrintDirection;
showHardBlanks?: boolean;
}
declare interface FittingRules {
hLayout: number;
hRule1: boolean;
hRule2: boolean;
hRule3: boolean;
hRule4: boolean;
hRule5: boolean;
hRule6: boolean;
vLayout: number;
vRule1: boolean;
vRule2: boolean;
vRule3: boolean;
vRule4: boolean;
vRule5: boolean;
}
declare interface FontMetadata {
baseline?: number;
codeTagCount?: number | null;
fittingRules: FittingRules;
fullLayout?: number | null;
hardBlank?: string;
height?: number;
maxLength?: number;
numCommentLines?: number;
oldLayout?: number;
printDirection?: PrintDirection;
}
declare type FontName =
"1Row"
| "3-D"
| "3D Diagonal"
| "3D-ASCII"
| "3x5"
| "4Max"
| "5 Line Oblique"
| "Standard"
| "Ghost"
| "Big"
| "Block"
| "Bubble"
| "Digital"
| "Ivrit"
| "Mini"
| "Script"
| "Shadow"
| "Slant"
| "Small"
| "Speed"
| "Tinker-Toy"
| string;
declare type KerningMethods = "default" | "full" | "fitted" | "controlled smushing" | "universal smushing";
declare type PrintDirection = -1 | 0 | 1;
declare const nodeFiglet: FigletModule;
declare namespace nodeFiglet {
export type {
CallbackFunction,
FigletDefaults,
FigletOptions,
FontMetadata,
FontName,
KerningMethods,
PrintDirection
};
}
export = nodeFiglet;
@@ -0,0 +1,6 @@
export type Options = [('method' | 'property')?];
export type MessageIds = 'errorMethod' | 'errorProperty';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1 @@
{"version":3,"file":"chart-bar-increasing.js","sources":["../../../src/icons/chart-bar-increasing.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChartBarIncreasing\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyAzdjE2YTIgMiAwIDAgMCAyIDJoMTYiIC8+CiAgPHBhdGggZD0iTTcgMTFoOCIgLz4KICA8cGF0aCBkPSJNNyAxNmgxMiIgLz4KICA8cGF0aCBkPSJNNyA2aDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/chart-bar-increasing\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChartBarIncreasing = createLucideIcon('ChartBarIncreasing', [\n ['path', { d: 'M3 3v16a2 2 0 0 0 2 2h16', key: 'c24i48' }],\n ['path', { d: 'M7 11h8', key: '1feolt' }],\n ['path', { d: 'M7 16h12', key: 'wsnu98' }],\n ['path', { d: 'M7 6h3', key: 'w9rmul' }],\n]);\n\nexport default ChartBarIncreasing;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,iBAAiB,oBAAsB,CAAA,CAAA,CAAA;AAAA,CAAA,CAChE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACzC,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FileAudio2 = createLucideIcon("FileAudio2", [
["path", { d: "M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2", key: "17k7jt" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["circle", { cx: "3", cy: "17", r: "1", key: "vo6nti" }],
["path", { d: "M2 17v-3a4 4 0 0 1 8 0v3", key: "1ggdre" }],
["circle", { cx: "9", cy: "17", r: "1", key: "bc1fq4" }]
]);
export { FileAudio2 as default };
//# sourceMappingURL=file-audio-2.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_aB","130":"_AC"},C:{"2":"_zS _TG _UM _2I _p _L","578":"_bK _4E _sD"},D:{"1":"_IS","2":"_xR"},E:{"2":"_yG","4":"_6D"},F:{"2":"_c"},G:{"2":"_0C","4":"_AD","260":"_hK _mP _qE"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"2":"_C"}},B:5,C:"Add to home screen (A2HS)",D:false};
@@ -0,0 +1,515 @@
export default `flf2a$ 5 5 14 1 3 0 129 0
BABYFACE Leet by cat, v0.8 2019
gopher:╱╱baud.baby
$$@
$$@
$$@
$$@
$$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
_______ @
╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲___╱____╱ @@
_______@
╱╱ ╱@
╱╱ ╲@
╱ ╱@
╲________╱ @@
_______ @
╱╱ ╲@
╱╱ ╱@
╱ --╱ @
╲________╱ @@
______ @
_╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲________╱ @@
_______ @
╱╱ ╲@
╱╱ ╱@
╱ _╱ @
╲________╱ @@
_______ @
╱╱ ╲@
╱╱ __╱@
╱ _╱ @
╲_______╱ @@
_______ @
╱╱ ╲@
╱╱ __╱@
╱ ╱ ╱ @
╲________╱ @@
_______ @
╱ ╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲___╱____╱ @@
________ @
╱ ╲@
_╱ ╱ @
╱ ╱ @
╲╲_______╱ @@
______ @
╱ ╲@
╱ ╱@
_╱ ╱╱ @
╲______╱╱ @@
____ ___ @
╱ ╱ ╲@
╱ ╱@
╱╱ _╱ @
╲╲___╱___╱ @@
______ @
╱╱ ╲@
╱╱ ╱@
╱ ╱ @
╲________╱ @@
_______ @
╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲__╱__╱__╱ @@
_______ @
╱╱ ╱ ╲@
╱╱ ╱@
╱ ╱ @
╲__╱_____╱ @@
_______ @
╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱╱ __╱ @
╲╲_____╱ @@
_______ @
╱ ╲╲@
╱ ╱╱@
╲__ ╱ @
╲_____╱ @@
_______ @
╱╱ ╲@
╱╱ ╱@
╱ _╱ @
╲____╱___╱ @@
________ @
╱ ╲@
╱ _╱@
╱- ╱ @
╲_______╱╱ @@
________ @
╱ ╲@
╱ _╱@
╱ ╱ @
╲_____╱╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╱ ╱╱ @
╲_______╱╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╲ ╱ @
╲╲_____╱ @@
________ @
╱ ╱ ╱ ╲@
╱ ╱@
╱╱ ╱ @
╲╲_______╱ @@
________ @
╱ ╱ ╲@
╱_ _╱@
╱ ╱ @
╲___╱___╱╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╲__ ╱╱ @
╲____╱╱ @@
_______ @
╱ ╲╲@
╱- ╱@
╱ _╱ @
╲________╱ @@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
________ @
╱ ╲@
╱ ╱@
╱ ╱ @
╲___╱____╱ @@
________@
╱ ╱@
╱ ╲@
╱ ╱@
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱ --╱ @
╲________╱ @@
_______ @
_╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱ _╱ @
╲________╱ @@
________ @
╱ ╲@
╱ __╱@
╱ _╱ @
╲_______╱ @@
________ @
╱ ╲@
╱ __╱@
╱ ╱ ╱ @
╲________╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╱ ╱ @
╲___╱____╱ @@
________ @
╱ ╲@
_╱ ╱ @
╱ ╱ @
╲________╱ @@
______ @
╱ ╲@
╱ ╱@
_╱ ╱ @
╲_______╱ @@
____ ___ @
╱ ╱ ╲@
╱ ╱@
╱ _╱ @
╲____╱___╱ @@
_______ @
╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱ ╱ @
╲__╱__╱__╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╱ ╱ @
╲__╱_____╱ @@
________ @
╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱ __╱ @
╲______╱ @@
________ @
╱ ╲@
╱ ╱@
╲__ ╱ @
╲_____╱ @@
________ @
╱ ╲@
╱ ╱@
╱ _╱ @
╲____╱___╱ @@
________ @
╱ ╲@
╱ _╱@
╱- ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ _╱@
╱ ╱ @
╲______╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╲ ╱ @
╲______╱ @@
________ @
╱ ╱ ╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╱ ╲@
╱_ _╱@
╱ ╱ @
╲___╱____╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╲__ ╱ @
╲_____╱ @@
________ @
╱ ╲@
╱- ╱@
╱ _╱ @
╲________╱ @@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
`
@@ -0,0 +1,6 @@
import type { JSDOM } from 'jsdom'
declare global {
const jsdom: JSDOM
}
export {}
@@ -0,0 +1,6 @@
import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {
limit: number;
}, AnySchema>;
declare const def: CodeKeywordDefinition;
export default def;
@@ -0,0 +1,595 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
*/
"use strict";
const {
CALL,
CONSTRUCT,
ReferenceTracker,
getStaticValue,
getStringIfConstant,
} = require("@eslint-community/eslint-utils");
const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp");
const {
isCombiningCharacter,
isEmojiModifier,
isRegionalIndicatorSymbol,
isSurrogatePair,
} = require("./utils/unicode");
const astUtils = require("./utils/ast-utils.js");
const { isValidWithUnicodeFlag } = require("./utils/regular-expressions");
const {
parseStringLiteral,
parseTemplateToken,
} = require("./utils/char-source");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* @typedef {import('@eslint-community/regexpp').AST.Character} Character
* @typedef {import('@eslint-community/regexpp').AST.CharacterClassElement} CharacterClassElement
*/
/**
* Iterate character sequences of a given nodes.
*
* CharacterClassRange syntax can steal a part of character sequence,
* so this function reverts CharacterClassRange syntax and restore the sequence.
* @param {CharacterClassElement[]} nodes The node list to iterate character sequences.
* @returns {IterableIterator<Character[]>} The list of character sequences.
*/
function* iterateCharacterSequence(nodes) {
/** @type {Character[]} */
let seq = [];
for (const node of nodes) {
switch (node.type) {
case "Character":
seq.push(node);
break;
case "CharacterClassRange":
seq.push(node.min);
yield seq;
seq = [node.max];
break;
case "CharacterSet":
case "CharacterClass": // [[]] nesting character class
case "ClassStringDisjunction": // \q{...}
case "ExpressionCharacterClass": // [A--B]
if (seq.length > 0) {
yield seq;
seq = [];
}
break;
// no default
}
}
if (seq.length > 0) {
yield seq;
}
}
/**
* Checks whether the given character node is a Unicode code point escape or not.
* @param {Character} char the character node to check.
* @returns {boolean} `true` if the character node is a Unicode code point escape.
*/
function isUnicodeCodePointEscape(char) {
return /^\\u\{[\da-f]+\}$/iu.test(char.raw);
}
/**
* Each function returns matched characters if it detects that kind of problem.
* @type {Record<string, (chars: Character[]) => IterableIterator<Character[]>>}
*/
const findCharacterSequences = {
*surrogatePairWithoutUFlag(chars) {
for (const [index, char] of chars.entries()) {
const previous = chars[index - 1];
if (
previous &&
char &&
isSurrogatePair(previous.value, char.value) &&
!isUnicodeCodePointEscape(previous) &&
!isUnicodeCodePointEscape(char)
) {
yield [previous, char];
}
}
},
*surrogatePair(chars) {
for (const [index, char] of chars.entries()) {
const previous = chars[index - 1];
if (
previous &&
char &&
isSurrogatePair(previous.value, char.value) &&
(isUnicodeCodePointEscape(previous) ||
isUnicodeCodePointEscape(char))
) {
yield [previous, char];
}
}
},
*combiningClass(chars, unfilteredChars) {
/*
* When `allowEscape` is `true`, a combined character should only be allowed if the combining mark appears as an escape sequence.
* This means that the base character should be considered even if it's escaped.
*/
for (const [index, char] of chars.entries()) {
const previous = unfilteredChars[index - 1];
if (
previous &&
char &&
isCombiningCharacter(char.value) &&
!isCombiningCharacter(previous.value)
) {
yield [previous, char];
}
}
},
*emojiModifier(chars) {
for (const [index, char] of chars.entries()) {
const previous = chars[index - 1];
if (
previous &&
char &&
isEmojiModifier(char.value) &&
!isEmojiModifier(previous.value)
) {
yield [previous, char];
}
}
},
*regionalIndicatorSymbol(chars) {
for (const [index, char] of chars.entries()) {
const previous = chars[index - 1];
if (
previous &&
char &&
isRegionalIndicatorSymbol(char.value) &&
isRegionalIndicatorSymbol(previous.value)
) {
yield [previous, char];
}
}
},
*zwj(chars) {
let sequence = null;
for (const [index, char] of chars.entries()) {
const previous = chars[index - 1];
const next = chars[index + 1];
if (
previous &&
char &&
next &&
char.value === 0x200d &&
previous.value !== 0x200d &&
next.value !== 0x200d
) {
if (sequence) {
if (sequence.at(-1) === previous) {
sequence.push(char, next); // append to the sequence
} else {
yield sequence;
sequence = chars.slice(index - 1, index + 2);
}
} else {
sequence = chars.slice(index - 1, index + 2);
}
}
}
if (sequence) {
yield sequence;
}
},
};
const kinds = Object.keys(findCharacterSequences);
/**
* Gets the value of the given node if it's a static value other than a regular expression object,
* or the node's `regex` property.
* The purpose of this method is to provide a replacement for `getStaticValue` in environments where certain regular expressions cannot be evaluated.
* A known example is Node.js 18 which does not support the `v` flag.
* Calling `getStaticValue` on a regular expression node with the `v` flag on Node.js 18 always returns `null`.
* A limitation of this method is that it can only detect a regular expression if the specified node is itself a regular expression literal node.
* @param {ASTNode | undefined} node The node to be inspected.
* @param {Scope} initialScope Scope to start finding variables. This function tries to resolve identifier references which are in the given scope.
* @returns {{ value: any } | { regex: { pattern: string, flags: string } } | null} The static value of the node, or `null`.
*/
function getStaticValueOrRegex(node, initialScope) {
if (!node) {
return null;
}
if (node.type === "Literal" && node.regex) {
return { regex: node.regex };
}
const staticValue = getStaticValue(node, initialScope);
if (staticValue?.value instanceof RegExp) {
return null;
}
return staticValue;
}
/**
* Checks whether a specified regexpp character is represented as an acceptable escape sequence.
* This function requires the source text of the character to be known.
* @param {Character} char Character to check.
* @param {string} charSource Source text of the character to check.
* @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence.
*/
function checkForAcceptableEscape(char, charSource) {
if (!charSource.startsWith("\\")) {
return false;
}
const match = /(?<=^\\+).$/su.exec(charSource);
return match?.[0] !== String.fromCodePoint(char.value);
}
/**
* Checks whether a specified regexpp character is represented as an acceptable escape sequence.
* This function works with characters that are produced by a string or template literal.
* It requires the source text and the CodeUnit list of the literal to be known.
* @param {Character} char Character to check.
* @param {string} nodeSource Source text of the string or template literal that produces the character.
* @param {CodeUnit[]} codeUnits List of CodeUnit objects of the literal that produces the character.
* @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence.
*/
function checkForAcceptableEscapeInString(char, nodeSource, codeUnits) {
const firstIndex = char.start;
const lastIndex = char.end - 1;
const start = codeUnits[firstIndex].start;
const end = codeUnits[lastIndex].end;
const charSource = nodeSource.slice(start, end);
return checkForAcceptableEscape(char, charSource);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
defaultOptions: [
{
allowEscape: false,
},
],
docs: {
description:
"Disallow characters which are made with multiple code points in character class syntax",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-misleading-character-class",
},
hasSuggestions: true,
schema: [
{
type: "object",
properties: {
allowEscape: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
surrogatePairWithoutUFlag:
"Unexpected surrogate pair in character class. Use 'u' flag.",
surrogatePair: "Unexpected surrogate pair in character class.",
combiningClass: "Unexpected combined character in character class.",
emojiModifier: "Unexpected modified Emoji in character class.",
regionalIndicatorSymbol:
"Unexpected national flag in character class.",
zwj: "Unexpected joined character sequence in character class.",
suggestUnicodeFlag: "Add unicode 'u' flag to regex.",
},
},
create(context) {
const [{ allowEscape }] = context.options;
const sourceCode = context.sourceCode;
const parser = new RegExpParser();
const checkedPatternNodes = new Set();
/**
* Verify a given regular expression.
* @param {Node} node The node to report.
* @param {string} pattern The regular expression pattern to verify.
* @param {string} flags The flags of the regular expression.
* @param {Function} unicodeFixer Fixer for missing "u" flag.
* @returns {void}
*/
function verify(node, pattern, flags, unicodeFixer) {
let patternNode;
try {
patternNode = parser.parsePattern(pattern, 0, pattern.length, {
unicode: flags.includes("u"),
unicodeSets: flags.includes("v"),
});
} catch {
// Ignore regular expressions with syntax errors
return;
}
let codeUnits = null;
/**
* Checks whether a specified regexpp character is represented as an acceptable escape sequence.
* For the purposes of this rule, an escape sequence is considered acceptable if it consists of one or more backslashes followed by the character being escaped.
* @param {Character} char Character to check.
* @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence.
*/
function isAcceptableEscapeSequence(char) {
if (node.type === "Literal" && node.regex) {
return checkForAcceptableEscape(char, char.raw);
}
if (node.type === "Literal" && typeof node.value === "string") {
const nodeSource = node.raw;
codeUnits ??= parseStringLiteral(nodeSource);
return checkForAcceptableEscapeInString(
char,
nodeSource,
codeUnits,
);
}
if (astUtils.isStaticTemplateLiteral(node)) {
const nodeSource = sourceCode.getText(node);
codeUnits ??= parseTemplateToken(nodeSource);
return checkForAcceptableEscapeInString(
char,
nodeSource,
codeUnits,
);
}
return false;
}
const foundKindMatches = new Map();
visitRegExpAST(patternNode, {
onCharacterClassEnter(ccNode) {
for (const unfilteredChars of iterateCharacterSequence(
ccNode.elements,
)) {
let chars;
if (allowEscape) {
// Replace escape sequences with null to avoid having them flagged.
chars = unfilteredChars.map(char =>
isAcceptableEscapeSequence(char) ? null : char,
);
} else {
chars = unfilteredChars;
}
for (const kind of kinds) {
const matches = findCharacterSequences[kind](
chars,
unfilteredChars,
);
if (foundKindMatches.has(kind)) {
foundKindMatches.get(kind).push(...matches);
} else {
foundKindMatches.set(kind, [...matches]);
}
}
}
},
});
/**
* Finds the report loc(s) for a range of matches.
* Only literals and expression-less templates generate granular errors.
* @param {Character[][]} matches Lists of individual characters being reported on.
* @returns {Location[]} locs for context.report.
* @see https://github.com/eslint/eslint/pull/17515
*/
function getNodeReportLocations(matches) {
if (
!astUtils.isStaticTemplateLiteral(node) &&
node.type !== "Literal"
) {
return matches.length ? [node.loc] : [];
}
return matches.map(chars => {
const firstIndex = chars[0].start;
const lastIndex = chars.at(-1).end - 1;
let start;
let end;
if (node.type === "TemplateLiteral") {
const source = sourceCode.getText(node);
const offset = node.range[0];
codeUnits ??= parseTemplateToken(source);
start = offset + codeUnits[firstIndex].start;
end = offset + codeUnits[lastIndex].end;
} else if (typeof node.value === "string") {
// String Literal
const source = node.raw;
const offset = node.range[0];
codeUnits ??= parseStringLiteral(source);
start = offset + codeUnits[firstIndex].start;
end = offset + codeUnits[lastIndex].end;
} else {
// RegExp Literal
const offset = node.range[0] + 1; // Add 1 to skip the leading slash.
start = offset + firstIndex;
end = offset + lastIndex + 1;
}
return {
start: sourceCode.getLocFromIndex(start),
end: sourceCode.getLocFromIndex(end),
};
});
}
for (const [kind, matches] of foundKindMatches) {
let suggest;
if (kind === "surrogatePairWithoutUFlag") {
suggest = [
{
messageId: "suggestUnicodeFlag",
fix: unicodeFixer,
},
];
}
const locs = getNodeReportLocations(matches);
for (const loc of locs) {
context.report({
node,
loc,
messageId: kind,
suggest,
});
}
}
}
return {
"Literal[regex]"(node) {
if (checkedPatternNodes.has(node)) {
return;
}
verify(node, node.regex.pattern, node.regex.flags, fixer => {
if (
!isValidWithUnicodeFlag(
context.languageOptions.ecmaVersion,
node.regex.pattern,
)
) {
return null;
}
return fixer.insertTextAfter(node, "u");
});
},
Program(node) {
const scope = sourceCode.getScope(node);
const tracker = new ReferenceTracker(scope);
/*
* Iterate calls of RegExp.
* E.g., `new RegExp()`, `RegExp()`, `new window.RegExp()`,
* `const {RegExp: a} = window; new a()`, etc...
*/
for (const { node: refNode } of tracker.iterateGlobalReferences(
{
RegExp: { [CALL]: true, [CONSTRUCT]: true },
},
)) {
let pattern, flags;
const [patternNode, flagsNode] = refNode.arguments;
const evaluatedPattern = getStaticValueOrRegex(
patternNode,
scope,
);
if (!evaluatedPattern) {
continue;
}
if (flagsNode) {
if (evaluatedPattern.regex) {
pattern = evaluatedPattern.regex.pattern;
checkedPatternNodes.add(patternNode);
} else {
pattern = String(evaluatedPattern.value);
}
flags = getStringIfConstant(flagsNode, scope);
} else {
if (evaluatedPattern.regex) {
continue;
}
pattern = String(evaluatedPattern.value);
flags = "";
}
if (typeof flags === "string") {
verify(patternNode, pattern, flags, fixer => {
if (
!isValidWithUnicodeFlag(
context.languageOptions.ecmaVersion,
pattern,
)
) {
return null;
}
if (refNode.arguments.length === 1) {
const penultimateToken =
sourceCode.getLastToken(refNode, {
skip: 1,
}); // skip closing parenthesis
return fixer.insertTextAfter(
penultimateToken,
astUtils.isCommaToken(penultimateToken)
? ' "u",'
: ', "u"',
);
}
if (
(flagsNode.type === "Literal" &&
typeof flagsNode.value === "string") ||
flagsNode.type === "TemplateLiteral"
) {
const range = [
flagsNode.range[0],
flagsNode.range[1] - 1,
];
return fixer.insertTextAfterRange(range, "u");
}
return null;
});
}
}
},
};
},
};
@@ -0,0 +1,186 @@
2.0.1 / 2025-11-20
==================
* deps: use tilde notation for dependencies
* deps: update statuses to 2.0.2
2.0.0 / 2021-12-17
==================
* Drop support for Node.js 0.6
* Remove `I'mateapot` export; use `ImATeapot` instead
* Remove support for status being non-first argument
* Rename `UnorderedCollection` constructor to `TooEarly`
* deps: depd@2.0.0
- Replace internal `eval` usage with `Function` constructor
- Use instance methods on `process` to check for listeners
* deps: statuses@2.0.1
- Fix messaging casing of `418 I'm a Teapot`
- Remove code 306
- Rename `425 Unordered Collection` to standard `425 Too Early`
2021-11-14 / 1.8.1
==================
* deps: toidentifier@1.0.1
2020-06-29 / 1.8.0
==================
* Add `isHttpError` export to determine if value is an HTTP error
* deps: setprototypeof@1.2.0
2019-06-24 / 1.7.3
==================
* deps: inherits@2.0.4
2019-02-18 / 1.7.2
==================
* deps: setprototypeof@1.1.1
2018-09-08 / 1.7.1
==================
* Fix error creating objects in some environments
2018-07-30 / 1.7.0
==================
* Set constructor name when possible
* Use `toidentifier` module to make class names
* deps: statuses@'>= 1.5.0 < 2'
2018-03-29 / 1.6.3
==================
* deps: depd@~1.1.2
- perf: remove argument reassignment
* deps: setprototypeof@1.1.0
* deps: statuses@'>= 1.4.0 < 2'
2017-08-04 / 1.6.2
==================
* deps: depd@1.1.1
- Remove unnecessary `Buffer` loading
2017-02-20 / 1.6.1
==================
* deps: setprototypeof@1.0.3
- Fix shim for old browsers
2017-02-14 / 1.6.0
==================
* Accept custom 4xx and 5xx status codes in factory
* Add deprecation message to `"I'mateapot"` export
* Deprecate passing status code as anything except first argument in factory
* Deprecate using non-error status codes
* Make `message` property enumerable for `HttpError`s
2016-11-16 / 1.5.1
==================
* deps: inherits@2.0.3
- Fix issue loading in browser
* deps: setprototypeof@1.0.2
* deps: statuses@'>= 1.3.1 < 2'
2016-05-18 / 1.5.0
==================
* Support new code `421 Misdirected Request`
* Use `setprototypeof` module to replace `__proto__` setting
* deps: statuses@'>= 1.3.0 < 2'
- Add `421 Misdirected Request`
- perf: enable strict mode
* perf: enable strict mode
2016-01-28 / 1.4.0
==================
* Add `HttpError` export, for `err instanceof createError.HttpError`
* deps: inherits@2.0.1
* deps: statuses@'>= 1.2.1 < 2'
- Fix message for status 451
- Remove incorrect nginx status code
2015-02-02 / 1.3.1
==================
* Fix regression where status can be overwritten in `createError` `props`
2015-02-01 / 1.3.0
==================
* Construct errors using defined constructors from `createError`
* Fix error names that are not identifiers
- `createError["I'mateapot"]` is now `createError.ImATeapot`
* Set a meaningful `name` property on constructed errors
2014-12-09 / 1.2.8
==================
* Fix stack trace from exported function
* Remove `arguments.callee` usage
2014-10-14 / 1.2.7
==================
* Remove duplicate line
2014-10-02 / 1.2.6
==================
* Fix `expose` to be `true` for `ClientError` constructor
2014-09-28 / 1.2.5
==================
* deps: statuses@1
2014-09-21 / 1.2.4
==================
* Fix dependency version to work with old `npm`s
2014-09-21 / 1.2.3
==================
* deps: statuses@~1.1.0
2014-09-21 / 1.2.2
==================
* Fix publish error
2014-09-21 / 1.2.1
==================
* Support Node.js 0.6
* Use `inherits` instead of `util`
2014-09-09 / 1.2.0
==================
* Fix the way inheriting functions
* Support `expose` being provided in properties argument
2014-09-08 / 1.1.0
==================
* Default status to 500
* Support provided `error` to extend
2014-09-08 / 1.0.1
==================
* Fix accepting string message
2014-09-08 / 1.0.0
==================
* Initial release
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"_b"},B:{"1":"_J"},C:{"1":"_zH","2":"_tG"},D:{"1":"_AK","132":"_jJ"},E:{"1":"_jB","16":"L _e","132":"_1Q"},F:{"1":"_0J aC","2":"_0D","16":"C","132":"_BC"},G:{"1":"_9B","16":"_d","132":"_jL"},H:{"2":"1D"},I:{"1":"_X","16":"_m","132":"_hL"},J:{"132":"_B"},K:{"1":"_ZB","2":"_gB","16":"C"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:5,C:"KeyboardEvent.location",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"wine.js","sources":["../../../src/icons/wine.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Wine\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAyMmg4IiAvPgogIDxwYXRoIGQ9Ik03IDEwaDEwIiAvPgogIDxwYXRoIGQ9Ik0xMiAxNXY3IiAvPgogIDxwYXRoIGQ9Ik0xMiAxNWE1IDUgMCAwIDAgNS01YzAtMi0uNS00LTItOEg5Yy0xLjUgNC0yIDYtMiA4YTUgNSAwIDAgMCA1IDVaIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/wine\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Wine = createLucideIcon('Wine', [\n ['path', { d: 'M8 22h8', key: 'rmew8v' }],\n ['path', { d: 'M7 10h10', key: '1101jm' }],\n ['path', { d: 'M12 15v7', key: 't2xh3l' }],\n [\n 'path',\n { d: 'M12 15a5 5 0 0 0 5-5c0-2-.5-4-2-8H9c-1.5 4-2 6-2 8a5 5 0 0 0 5 5Z', key: '10ffi3' },\n ],\n]);\n\nexport default Wine;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CAAA,CACpC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC1F,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Tablets = createLucideIcon("Tablets", [
["circle", { cx: "7", cy: "7", r: "5", key: "x29byf" }],
["circle", { cx: "17", cy: "17", r: "5", key: "1op1d2" }],
["path", { d: "M12 17h10", key: "ls21zv" }],
["path", { d: "m3.46 10.54 7.08-7.08", key: "1rehiu" }]
]);
export { Tablets as default };
//# sourceMappingURL=tablets.js.map
@@ -0,0 +1,12 @@
/**
* @preserve
* JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
*
* @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
* @see http://github.com/homebrewing/brauhaus-diff
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
* @see http://github.com/garycourt/murmurhash-js
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
* @see http://sites.google.com/site/murmurhash/
*/
!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}();
@@ -0,0 +1,16 @@
'use strict';
const pathKey = (options = {}) => {
const environment = options.env || process.env;
const platform = options.platform || process.platform;
if (platform !== 'win32') {
return 'PATH';
}
return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';
};
module.exports = pathKey;
// TODO: Remove this for the next major release
module.exports.default = pathKey;
@@ -0,0 +1,202 @@
/**
* @fileoverview A rule to disallow or enforce spaces inside of single line blocks.
* @author Toru Nagashima
* @deprecated in ESLint v8.53.0
*/
"use strict";
const util = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "block-spacing",
url: "https://eslint.style/rules/block-spacing",
},
},
],
},
type: "layout",
docs: {
description:
"Disallow or enforce spaces inside of blocks after opening block and before closing block",
recommended: false,
url: "https://eslint.org/docs/latest/rules/block-spacing",
},
fixable: "whitespace",
schema: [{ enum: ["always", "never"] }],
messages: {
missing: "Requires a space {{location}} '{{token}}'.",
extra: "Unexpected space(s) {{location}} '{{token}}'.",
},
},
create(context) {
const always = context.options[0] !== "never",
messageId = always ? "missing" : "extra",
sourceCode = context.sourceCode;
/**
* Gets the open brace token from a given node.
* @param {ASTNode} node A BlockStatement/StaticBlock/SwitchStatement node to get.
* @returns {Token} The token of the open brace.
*/
function getOpenBrace(node) {
if (node.type === "SwitchStatement") {
if (node.cases.length > 0) {
return sourceCode.getTokenBefore(node.cases[0]);
}
return sourceCode.getLastToken(node, 1);
}
if (node.type === "StaticBlock") {
return sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token
}
// "BlockStatement"
return sourceCode.getFirstToken(node);
}
/**
* Checks whether or not:
* - given tokens are on same line.
* - there is/isn't a space between given tokens.
* @param {Token} left A token to check.
* @param {Token} right The token which is next to `left`.
* @returns {boolean}
* When the option is `"always"`, `true` if there are one or more spaces between given tokens.
* When the option is `"never"`, `true` if there are not any spaces between given tokens.
* If given tokens are not on same line, it's always `true`.
*/
function isValid(left, right) {
return (
!util.isTokenOnSameLine(left, right) ||
sourceCode.isSpaceBetween(left, right) === always
);
}
/**
* Checks and reports invalid spacing style inside braces.
* @param {ASTNode} node A BlockStatement/StaticBlock/SwitchStatement node to check.
* @returns {void}
*/
function checkSpacingInsideBraces(node) {
// Gets braces and the first/last token of content.
const openBrace = getOpenBrace(node);
const closeBrace = sourceCode.getLastToken(node);
const firstToken = sourceCode.getTokenAfter(openBrace, {
includeComments: true,
});
const lastToken = sourceCode.getTokenBefore(closeBrace, {
includeComments: true,
});
// Skip if the node is invalid or empty.
if (
openBrace.type !== "Punctuator" ||
openBrace.value !== "{" ||
closeBrace.type !== "Punctuator" ||
closeBrace.value !== "}" ||
firstToken === closeBrace
) {
return;
}
// Skip line comments for option never
if (!always && firstToken.type === "Line") {
return;
}
// Check.
if (!isValid(openBrace, firstToken)) {
let loc = openBrace.loc;
if (messageId === "extra") {
loc = {
start: openBrace.loc.end,
end: firstToken.loc.start,
};
}
context.report({
node,
loc,
messageId,
data: {
location: "after",
token: openBrace.value,
},
fix(fixer) {
if (always) {
return fixer.insertTextBefore(firstToken, " ");
}
return fixer.removeRange([
openBrace.range[1],
firstToken.range[0],
]);
},
});
}
if (!isValid(lastToken, closeBrace)) {
let loc = closeBrace.loc;
if (messageId === "extra") {
loc = {
start: lastToken.loc.end,
end: closeBrace.loc.start,
};
}
context.report({
node,
loc,
messageId,
data: {
location: "before",
token: closeBrace.value,
},
fix(fixer) {
if (always) {
return fixer.insertTextAfter(lastToken, " ");
}
return fixer.removeRange([
lastToken.range[1],
closeBrace.range[0],
]);
},
});
}
}
return {
BlockStatement: checkSpacingInsideBraces,
StaticBlock: checkSpacingInsideBraces,
SwitchStatement: checkSpacingInsideBraces,
};
},
};
@@ -0,0 +1 @@
module.exports={C:{"66":0.0052,"78":0.0052,"109":0.0052,"115":0.10396,"120":1.16955,"121":2.28712,"123":0.0052,"124":0.0104,"125":0.0052,"137":0.0052,"138":0.0104,"140":0.0052,"141":0.0052,"143":0.0052,"149":0.0052,"150":0.0052,"151":0.0052,"152":0.48861,"153":0.01559,"154":0.14035,"155":0.29109,"156":0.30148,"157":0.01559,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 116 117 118 119 122 126 127 128 129 130 131 132 133 134 135 136 139 142 144 145 146 147 148 158 159 160 3.5 3.6"},D:{"60":0.0052,"61":0.0052,"62":0.0052,"63":0.0052,"64":0.0052,"66":0.0104,"67":0.0052,"68":0.0052,"69":0.0104,"70":0.0052,"71":0.0052,"73":0.0104,"75":0.0052,"79":0.0052,"86":0.0052,"87":0.0052,"90":0.0052,"92":0.05198,"98":0.02599,"101":0.0052,"103":0.31708,"104":0.29109,"105":0.28589,"106":0.28589,"107":0.28589,"108":0.30148,"109":0.84208,"110":0.2703,"111":0.28069,"112":0.28589,"113":0.0052,"114":0.0104,"116":0.58737,"117":0.28589,"118":1.5542,"119":2.24554,"120":2.57301,"121":0.0104,"122":0.0104,"123":0.01559,"124":0.30668,"125":0.0052,"126":0.0052,"127":0.0104,"128":0.01559,"129":0.0052,"130":0.0052,"131":0.59257,"132":0.02599,"133":0.56658,"134":0.01559,"135":0.02079,"136":0.03119,"137":0.03639,"138":0.08317,"139":0.32228,"140":0.02079,"141":0.01559,"142":0.04158,"143":0.03119,"144":0.43143,"145":0.06757,"146":0.29629,"147":0.03119,"148":0.09356,"149":0.35346,"150":0.49901,"151":7.87497,"152":5.63463,"153":5.39552,"154":1.27351,"155":0.0104,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 65 72 74 76 77 78 80 81 83 84 85 88 89 91 93 94 95 96 97 99 100 102 115 156 157"},F:{"51":0.0052,"52":0.0052,"53":0.0052,"54":0.0104,"55":0.0052,"56":0.0052,"57":0.0052,"79":0.0052,"95":0.0052,"100":0.0052,"101":0.02079,"102":0.0052,"105":0.0052,"106":0.0104,"107":0.0052,"116":0.0052,"120":0.0052,"131":0.0052,"133":0.01559,"134":0.05718,"135":0.32747,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 103 104 108 109 110 111 112 113 114 115 117 118 119 121 122 123 124 125 126 127 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.0052,"92":0.02079,"100":0.0052,"109":0.0104,"114":0.0052,"118":0.0052,"119":1.13836,"120":1.20074,"122":0.02079,"124":0.0052,"131":0.0052,"132":0.0052,"135":0.0052,"139":0.0052,"140":0.0052,"141":0.0052,"143":0.0104,"145":0.0052,"146":0.02079,"147":0.0104,"148":0.0104,"149":0.01559,"150":0.03639,"151":0.11955,"152":0.90965,"153":1.13316,"154":0.28589,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 121 123 125 126 127 128 129 130 133 134 136 137 138 142 144"},E:{"27":0.09876,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 16.0 16.2 16.3 16.4 16.5 18.0 18.4 27.1 27.2 TP","13.1":0.0052,"14.1":0.0052,"15.4":0.01559,"15.5":0.0104,"15.6":0.10396,"16.1":0.0052,"16.6":0.06757,"17.0":0.01559,"17.1":0.03119,"17.2":0.0052,"17.3":0.0104,"17.4":0.01559,"17.5":0.01559,"17.6":0.03639,"18.1":0.0052,"18.2":0.0052,"18.3":0.02079,"18.5-18.7":0.02079,"26.0":0.0104,"26.1":0.0052,"26.2":0.02599,"26.3":0.02599,"26.4":0.01559,"26.5":0.12475,"26.6":0.56658},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00116,"5.0-5.1":0.00116,"6.0-6.1":0,"7.0-7.1":0.00233,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01163,"11.0-11.2":0.00116,"11.3-11.4":0.00233,"12.0-12.1":0,"12.2-12.5":0.03024,"13.0-13.1":0,"13.2":0.00582,"13.3":0,"13.4-13.7":0.00116,"14.0-14.4":0.00465,"14.5-14.8":0.00698,"15.0-15.1":0.00698,"15.2-15.3":0.00465,"15.4":0.00582,"15.5":0.00698,"15.6-15.8":0.1512,"16.0":0.01163,"16.1":0.02093,"16.2":0.01163,"16.3":0.02559,"16.4":0.00582,"16.5":0.0093,"16.6-16.7":0.21051,"17.0":0.00814,"17.1":0.01163,"17.2":0.01163,"17.3":0.01745,"17.4":0.02442,"17.5":0.04768,"17.6-17.7":0.12328,"18.0":0.02559,"18.1":0.05117,"18.2":0.06978,"18.3":0.12096,"18.4":0.0756,"18.5-18.7":1.56197,"26.0":0.0756,"26.1":0.07676,"26.2":0.20004,"26.3":0.21633,"26.4":0.15817,"26.5":1.05953,"26.6":6.53747,"27.0":0.50127,"27.1":0,"27.2":0.01279},P:{"20":0.00868,"21":0.00868,"22":0.01736,"23":0.01736,"24":0.02604,"25":0.05208,"26":0.05208,"27":0.03472,"28":0.12151,"29":0.26907,"30":2.53443,_:"4 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 15.0 17.0 18.0","7.2-7.4":0.06076,"14.0":0.00868,"16.0":0.02604,"19.0":0.00868},I:{"0":0.01919,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.38416,_:"10 11 12 11.1 Line truncated
@@ -0,0 +1,23 @@
Copyright 2013 Thorsten Lorenz.
All rights reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,35 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FishOff = createLucideIcon("FishOff", [
[
"path",
{
d: "M18 12.47v.03m0-.5v.47m-.475 5.056A6.744 6.744 0 0 1 15 18c-3.56 0-7.56-2.53-8.5-6 .348-1.28 1.114-2.433 2.121-3.38m3.444-2.088A8.802 8.802 0 0 1 15 6c3.56 0 6.06 2.54 7 6-.309 1.14-.786 2.177-1.413 3.058",
key: "1j1hse"
}
],
[
"path",
{
d: "M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33m7.48-4.372A9.77 9.77 0 0 1 16 6.07m0 11.86a9.77 9.77 0 0 1-1.728-3.618",
key: "1q46z8"
}
],
[
"path",
{
d: "m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98M8.53 3h5.27a2 2 0 0 1 1.98 1.67l.23 1.4M2 2l20 20",
key: "1407gh"
}
]
]);
export { FishOff as default };
//# sourceMappingURL=fish-off.js.map
@@ -0,0 +1,40 @@
{
"name": "parseurl",
"description": "parse a url with memoization",
"version": "1.3.3",
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>",
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
],
"repository": "pillarjs/parseurl",
"license": "MIT",
"devDependencies": {
"beautify-benchmark": "0.2.4",
"benchmark": "2.1.4",
"eslint": "5.16.0",
"eslint-config-standard": "12.0.0",
"eslint-plugin-import": "2.17.1",
"eslint-plugin-node": "7.0.1",
"eslint-plugin-promise": "4.1.1",
"eslint-plugin-standard": "4.0.0",
"fast-url-parser": "1.1.3",
"istanbul": "0.4.5",
"mocha": "6.1.3"
},
"files": [
"LICENSE",
"HISTORY.md",
"README.md",
"index.js"
],
"engines": {
"node": ">= 0.8"
},
"scripts": {
"bench": "node benchmark/index.js",
"lint": "eslint .",
"test": "mocha --check-leaks --bail --reporter spec test/",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/"
}
}
@@ -0,0 +1,109 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.selectParser = void 0;
const v3_1 = require("zod/v3");
const any_js_1 = require("./parsers/any.js");
const array_js_1 = require("./parsers/array.js");
const bigint_js_1 = require("./parsers/bigint.js");
const boolean_js_1 = require("./parsers/boolean.js");
const branded_js_1 = require("./parsers/branded.js");
const catch_js_1 = require("./parsers/catch.js");
const date_js_1 = require("./parsers/date.js");
const default_js_1 = require("./parsers/default.js");
const effects_js_1 = require("./parsers/effects.js");
const enum_js_1 = require("./parsers/enum.js");
const intersection_js_1 = require("./parsers/intersection.js");
const literal_js_1 = require("./parsers/literal.js");
const map_js_1 = require("./parsers/map.js");
const nativeEnum_js_1 = require("./parsers/nativeEnum.js");
const never_js_1 = require("./parsers/never.js");
const null_js_1 = require("./parsers/null.js");
const nullable_js_1 = require("./parsers/nullable.js");
const number_js_1 = require("./parsers/number.js");
const object_js_1 = require("./parsers/object.js");
const optional_js_1 = require("./parsers/optional.js");
const pipeline_js_1 = require("./parsers/pipeline.js");
const promise_js_1 = require("./parsers/promise.js");
const record_js_1 = require("./parsers/record.js");
const set_js_1 = require("./parsers/set.js");
const string_js_1 = require("./parsers/string.js");
const tuple_js_1 = require("./parsers/tuple.js");
const undefined_js_1 = require("./parsers/undefined.js");
const union_js_1 = require("./parsers/union.js");
const unknown_js_1 = require("./parsers/unknown.js");
const readonly_js_1 = require("./parsers/readonly.js");
const selectParser = (def, typeName, refs) => {
switch (typeName) {
case v3_1.ZodFirstPartyTypeKind.ZodString:
return (0, string_js_1.parseStringDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodNumber:
return (0, number_js_1.parseNumberDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodObject:
return (0, object_js_1.parseObjectDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodBigInt:
return (0, bigint_js_1.parseBigintDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodBoolean:
return (0, boolean_js_1.parseBooleanDef)();
case v3_1.ZodFirstPartyTypeKind.ZodDate:
return (0, date_js_1.parseDateDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodUndefined:
return (0, undefined_js_1.parseUndefinedDef)(refs);
case v3_1.ZodFirstPartyTypeKind.ZodNull:
return (0, null_js_1.parseNullDef)(refs);
case v3_1.ZodFirstPartyTypeKind.ZodArray:
return (0, array_js_1.parseArrayDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodUnion:
case v3_1.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
return (0, union_js_1.parseUnionDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodIntersection:
return (0, intersection_js_1.parseIntersectionDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodTuple:
return (0, tuple_js_1.parseTupleDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodRecord:
return (0, record_js_1.parseRecordDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodLiteral:
return (0, literal_js_1.parseLiteralDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodEnum:
return (0, enum_js_1.parseEnumDef)(def);
case v3_1.ZodFirstPartyTypeKind.ZodNativeEnum:
return (0, nativeEnum_js_1.parseNativeEnumDef)(def);
case v3_1.ZodFirstPartyTypeKind.ZodNullable:
return (0, nullable_js_1.parseNullableDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodOptional:
return (0, optional_js_1.parseOptionalDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodMap:
return (0, map_js_1.parseMapDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodSet:
return (0, set_js_1.parseSetDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodLazy:
return () => def.getter()._def;
case v3_1.ZodFirstPartyTypeKind.ZodPromise:
return (0, promise_js_1.parsePromiseDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodNaN:
case v3_1.ZodFirstPartyTypeKind.ZodNever:
return (0, never_js_1.parseNeverDef)(refs);
case v3_1.ZodFirstPartyTypeKind.ZodEffects:
return (0, effects_js_1.parseEffectsDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodAny:
return (0, any_js_1.parseAnyDef)(refs);
case v3_1.ZodFirstPartyTypeKind.ZodUnknown:
return (0, unknown_js_1.parseUnknownDef)(refs);
case v3_1.ZodFirstPartyTypeKind.ZodDefault:
return (0, default_js_1.parseDefaultDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodBranded:
return (0, branded_js_1.parseBrandedDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodReadonly:
return (0, readonly_js_1.parseReadonlyDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodCatch:
return (0, catch_js_1.parseCatchDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodPipeline:
return (0, pipeline_js_1.parsePipelineDef)(def, refs);
case v3_1.ZodFirstPartyTypeKind.ZodFunction:
case v3_1.ZodFirstPartyTypeKind.ZodVoid:
case v3_1.ZodFirstPartyTypeKind.ZodSymbol:
return undefined;
default:
return ((_) => undefined)(typeName);
}
};
exports.selectParser = selectParser;
@@ -0,0 +1,202 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OAUTH_ERRORS = exports.CustomOAuthError = exports.InvalidTargetError = exports.InsufficientScopeError = exports.InvalidClientMetadataError = exports.TooManyRequestsError = exports.MethodNotAllowedError = exports.InvalidTokenError = exports.UnsupportedTokenTypeError = exports.UnsupportedResponseTypeError = exports.TemporarilyUnavailableError = exports.ServerError = exports.AccessDeniedError = exports.InvalidScopeError = exports.UnsupportedGrantTypeError = exports.UnauthorizedClientError = exports.InvalidGrantError = exports.InvalidClientError = exports.InvalidRequestError = exports.OAuthError = void 0;
/**
* Base class for all OAuth errors
*/
class OAuthError extends Error {
constructor(message, errorUri) {
super(message);
this.errorUri = errorUri;
this.name = this.constructor.name;
}
/**
* Converts the error to a standard OAuth error response object
*/
toResponseObject() {
const response = {
error: this.errorCode,
error_description: this.message
};
if (this.errorUri) {
response.error_uri = this.errorUri;
}
return response;
}
get errorCode() {
return this.constructor.errorCode;
}
}
exports.OAuthError = OAuthError;
/**
* Invalid request error - The request is missing a required parameter,
* includes an invalid parameter value, includes a parameter more than once,
* or is otherwise malformed.
*/
class InvalidRequestError extends OAuthError {
}
exports.InvalidRequestError = InvalidRequestError;
InvalidRequestError.errorCode = 'invalid_request';
/**
* Invalid client error - Client authentication failed (e.g., unknown client, no client
* authentication included, or unsupported authentication method).
*/
class InvalidClientError extends OAuthError {
}
exports.InvalidClientError = InvalidClientError;
InvalidClientError.errorCode = 'invalid_client';
/**
* Invalid grant error - The provided authorization grant or refresh token is
* invalid, expired, revoked, does not match the redirection URI used in the
* authorization request, or was issued to another client.
*/
class InvalidGrantError extends OAuthError {
}
exports.InvalidGrantError = InvalidGrantError;
InvalidGrantError.errorCode = 'invalid_grant';
/**
* Unauthorized client error - The authenticated client is not authorized to use
* this authorization grant type.
*/
class UnauthorizedClientError extends OAuthError {
}
exports.UnauthorizedClientError = UnauthorizedClientError;
UnauthorizedClientError.errorCode = 'unauthorized_client';
/**
* Unsupported grant type error - The authorization grant type is not supported
* by the authorization server.
*/
class UnsupportedGrantTypeError extends OAuthError {
}
exports.UnsupportedGrantTypeError = UnsupportedGrantTypeError;
UnsupportedGrantTypeError.errorCode = 'unsupported_grant_type';
/**
* Invalid scope error - The requested scope is invalid, unknown, malformed, or
* exceeds the scope granted by the resource owner.
*/
class InvalidScopeError extends OAuthError {
}
exports.InvalidScopeError = InvalidScopeError;
InvalidScopeError.errorCode = 'invalid_scope';
/**
* Access denied error - The resource owner or authorization server denied the request.
*/
class AccessDeniedError extends OAuthError {
}
exports.AccessDeniedError = AccessDeniedError;
AccessDeniedError.errorCode = 'access_denied';
/**
* Server error - The authorization server encountered an unexpected condition
* that prevented it from fulfilling the request.
*/
class ServerError extends OAuthError {
}
exports.ServerError = ServerError;
ServerError.errorCode = 'server_error';
/**
* Temporarily unavailable error - The authorization server is currently unable to
* handle the request due to a temporary overloading or maintenance of the server.
*/
class TemporarilyUnavailableError extends OAuthError {
}
exports.TemporarilyUnavailableError = TemporarilyUnavailableError;
TemporarilyUnavailableError.errorCode = 'temporarily_unavailable';
/**
* Unsupported response type error - The authorization server does not support
* obtaining an authorization code using this method.
*/
class UnsupportedResponseTypeError extends OAuthError {
}
exports.UnsupportedResponseTypeError = UnsupportedResponseTypeError;
UnsupportedResponseTypeError.errorCode = 'unsupported_response_type';
/**
* Unsupported token type error - The authorization server does not support
* the requested token type.
*/
class UnsupportedTokenTypeError extends OAuthError {
}
exports.UnsupportedTokenTypeError = UnsupportedTokenTypeError;
UnsupportedTokenTypeError.errorCode = 'unsupported_token_type';
/**
* Invalid token error - The access token provided is expired, revoked, malformed,
* or invalid for other reasons.
*/
class InvalidTokenError extends OAuthError {
}
exports.InvalidTokenError = InvalidTokenError;
InvalidTokenError.errorCode = 'invalid_token';
/**
* Method not allowed error - The HTTP method used is not allowed for this endpoint.
* (Custom, non-standard error)
*/
class MethodNotAllowedError extends OAuthError {
}
exports.MethodNotAllowedError = MethodNotAllowedError;
MethodNotAllowedError.errorCode = 'method_not_allowed';
/**
* Too many requests error - Rate limit exceeded.
* (Custom, non-standard error based on RFC 6585)
*/
class TooManyRequestsError extends OAuthError {
}
exports.TooManyRequestsError = TooManyRequestsError;
TooManyRequestsError.errorCode = 'too_many_requests';
/**
* Invalid client metadata error - The client metadata is invalid.
* (Custom error for dynamic client registration - RFC 7591)
*/
class InvalidClientMetadataError extends OAuthError {
}
exports.InvalidClientMetadataError = InvalidClientMetadataError;
InvalidClientMetadataError.errorCode = 'invalid_client_metadata';
/**
* Insufficient scope error - The request requires higher privileges than provided by the access token.
*/
class InsufficientScopeError extends OAuthError {
}
exports.InsufficientScopeError = InsufficientScopeError;
InsufficientScopeError.errorCode = 'insufficient_scope';
/**
* Invalid target error - The requested resource is invalid, missing, unknown, or malformed.
* (Custom error for resource indicators - RFC 8707)
*/
class InvalidTargetError extends OAuthError {
}
exports.InvalidTargetError = InvalidTargetError;
InvalidTargetError.errorCode = 'invalid_target';
/**
* A utility class for defining one-off error codes
*/
class CustomOAuthError extends OAuthError {
constructor(customErrorCode, message, errorUri) {
super(message, errorUri);
this.customErrorCode = customErrorCode;
}
get errorCode() {
return this.customErrorCode;
}
}
exports.CustomOAuthError = CustomOAuthError;
/**
* A full list of all OAuthErrors, enabling parsing from error responses
*/
exports.OAUTH_ERRORS = {
[InvalidRequestError.errorCode]: InvalidRequestError,
[InvalidClientError.errorCode]: InvalidClientError,
[InvalidGrantError.errorCode]: InvalidGrantError,
[UnauthorizedClientError.errorCode]: UnauthorizedClientError,
[UnsupportedGrantTypeError.errorCode]: UnsupportedGrantTypeError,
[InvalidScopeError.errorCode]: InvalidScopeError,
[AccessDeniedError.errorCode]: AccessDeniedError,
[ServerError.errorCode]: ServerError,
[TemporarilyUnavailableError.errorCode]: TemporarilyUnavailableError,
[UnsupportedResponseTypeError.errorCode]: UnsupportedResponseTypeError,
[UnsupportedTokenTypeError.errorCode]: UnsupportedTokenTypeError,
[InvalidTokenError.errorCode]: InvalidTokenError,
[MethodNotAllowedError.errorCode]: MethodNotAllowedError,
[TooManyRequestsError.errorCode]: TooManyRequestsError,
[InvalidClientMetadataError.errorCode]: InvalidClientMetadataError,
[InsufficientScopeError.errorCode]: InsufficientScopeError,
[InvalidTargetError.errorCode]: InvalidTargetError
};
//# sourceMappingURL=errors.js.map
@@ -0,0 +1,90 @@
import { decode, encode } from './qss'
import type { AnySchema } from './validators'
/** Default `parseSearch` that strips leading '?' and JSON-parses values. */
export const defaultParseSearch = parseSearchWith(JSON.parse)
/** Default `stringifySearch` using JSON.stringify for complex values. */
export const defaultStringifySearch = stringifySearchWith(
JSON.stringify,
JSON.parse,
)
/**
* Build a `parseSearch` function using a provided JSON-like parser.
*
* The returned function strips a leading `?`, decodes values, and attempts to
* JSON-parse string values using the given `parser`.
*
* @param parser Function to parse a string value (e.g. `JSON.parse`).
* @returns A `parseSearch` function compatible with `Router` options.
* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization
*/
export function parseSearchWith(parser: (str: string) => any) {
return (searchStr: string): AnySchema => {
if (searchStr[0] === '?') {
searchStr = searchStr.substring(1)
}
const query: Record<string, unknown> = decode(searchStr)
// Try to parse any query params that might be json
for (const key in query) {
const value = query[key]
if (typeof value === 'string') {
try {
query[key] = parser(value)
} catch (_err) {
// silent
}
}
}
return query
}
}
/**
* Build a `stringifySearch` function using a provided serializer.
*
* Non-primitive values are serialized with `stringify`. If a `parser` is
* supplied, string values that are parseable are re-serialized to ensure
* symmetry with `parseSearch`.
*
* @param stringify Function to serialize a value (e.g. `JSON.stringify`).
* @param parser Optional parser to detect parseable strings.
* @returns A `stringifySearch` function compatible with `Router` options.
* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization
*/
export function stringifySearchWith(
stringify: (search: any) => string,
parser?: (str: string) => any,
) {
const hasParser = typeof parser === 'function'
function stringifyValue(val: any) {
if (typeof val === 'object' && val !== null) {
try {
return stringify(val)
} catch (_err) {
// silent
}
} else if (hasParser && typeof val === 'string') {
try {
// Check if it's a valid parseable string.
// If it is, then stringify it again.
parser(val)
return stringify(val)
} catch (_err) {
// silent
}
}
return val
}
return (search: Record<string, any>) => {
const searchStr = encode(search, stringifyValue)
return searchStr ? `?${searchStr}` : ''
}
}
export type SearchSerializer = (searchObj: Record<string, any>) => string
export type SearchParser = (searchStr: string) => Record<string, any>
@@ -0,0 +1,125 @@
# ajv-formats
JSON Schema formats for Ajv
[![Build Status](https://travis-ci.org/ajv-validator/ajv-formats.svg?branch=master)](https://travis-ci.org/ajv-validator/ajv-formats)
[![npm](https://img.shields.io/npm/v/ajv-formats.svg)](https://www.npmjs.com/package/ajv-formats)
[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)
[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin)
## Usage
```javascript
// ESM/TypeScript import
import Ajv from "ajv"
import addFormats from "ajv-formats"
// Node.js require:
const Ajv = require("ajv")
const addFormats = require("ajv-formats")
const ajv = new Ajv()
addFormats(ajv)
```
## Formats
The package defines these formats:
- _date_: full-date according to [RFC3339](http://tools.ietf.org/html/rfc3339#section-5.6).
- _time_: time (time-zone is mandatory).
- _date-time_: date-time (time-zone is mandatory).
- _iso-time_: time with optional time-zone.
- _iso-date-time_: date-time with optional time-zone.
- _duration_: duration from [RFC3339](https://tools.ietf.org/html/rfc3339#appendix-A)
- _uri_: full URI.
- _uri-reference_: URI reference, including full and relative URIs.
- _uri-template_: URI template according to [RFC6570](https://tools.ietf.org/html/rfc6570)
- _url_ (deprecated): [URL record](https://url.spec.whatwg.org/#concept-url).
- _email_: email address.
- _hostname_: host name according to [RFC1034](http://tools.ietf.org/html/rfc1034#section-3.5).
- _ipv4_: IP address v4.
- _ipv6_: IP address v6.
- _regex_: tests whether a string is a valid regular expression by passing it to RegExp constructor.
- _uuid_: Universally Unique IDentifier according to [RFC4122](http://tools.ietf.org/html/rfc4122).
- _json-pointer_: JSON-pointer according to [RFC6901](https://tools.ietf.org/html/rfc6901).
- _relative-json-pointer_: relative JSON-pointer according to [this draft](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00).
- _byte_: base64 encoded data according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
- _int32_: signed 32 bits integer according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
- _int64_: signed 64 bits according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
- _float_: float according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
- _double_: double according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
- _password_: password string according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
- _binary_: binary string according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
See regular expressions used for format validation and the sources that were used in [formats.ts](https://github.com/ajv-validator/ajv-formats/blob/master/src/formats.ts).
**Please note**: JSON Schema draft-07 also defines formats `iri`, `iri-reference`, `idn-hostname` and `idn-email` for URLs, hostnames and emails with international characters. These formats are available in [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) plugin.
## Keywords to compare values: `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum`
These keywords allow to define minimum/maximum constraints when the format keyword defines ordering (`compare` function in format definition).
These keywords are added to ajv instance when ajv-formats is used without options or with option `keywords: true`.
These keywords apply only to strings. If the data is not a string, the validation succeeds.
The value of keywords `formatMaximum`/`formatMinimum` and `formatExclusiveMaximum`/`formatExclusiveMinimum` should be a string or [\$data reference](https://github.com/ajv-validator/ajv/blob/master/docs/validation.md#data-reference). This value is the maximum (minimum) allowed value for the data to be valid as determined by `format` keyword. If `format` keyword is not present schema compilation will throw exception.
When these keyword are added, they also add comparison functions to formats `"date"`, `"time"` and `"date-time"`. User-defined formats also can have comparison functions. See [addFormat](https://github.com/ajv-validator/ajv/blob/master/docs/api.md#api-addformat) method.
```javascript
require("ajv-formats")(ajv)
const schema = {
type: "string",
format: "date",
formatMinimum: "2016-02-06",
formatExclusiveMaximum: "2016-12-27",
}
const validDataList = ["2016-02-06", "2016-12-26"]
const invalidDataList = ["2016-02-05", "2016-12-27", "abc"]
```
## Options
Options can be passed via the second parameter. Options value can be
1. The list of format names that will be added to ajv instance:
```javascript
addFormats(ajv, ["date", "time"])
```
**Please note**: when ajv encounters an undefined format it throws exception (unless ajv instance was configured with `strict: false` option). To allow specific undefined formats they have to be passed to ajv instance via `formats` option with `true` value:
```javascript
const ajv = new Ajv((formats: {date: true, time: true})) // to ignore "date" and "time" formats in schemas.
```
2. Format validation mode (default is `"full"`) with optional list of format names and `keywords` option to add additional format comparison keywords:
```javascript
addFormats(ajv, {mode: "fast"})
```
or
```javascript
addFormats(ajv, {mode: "fast", formats: ["date", "time"], keywords: true})
```
In `"fast"` mode the following formats are simplified: `"date"`, `"time"`, `"date-time"`, `"iso-time"`, `"iso-date-time"`, `"uri"`, `"uri-reference"`, `"email"`. For example, `"date"`, `"time"` and `"date-time"` do not validate ranges in `"fast"` mode, only string structure, and other formats have simplified regular expressions.
## Tests
```bash
npm install
git submodule update --init
npm test
```
## License
[MIT](https://github.com/ajv-validator/ajv-formats/blob/master/LICENSE)
@@ -0,0 +1,88 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#",
"title": "Meta-schema for the security assessment of JSON Schemas",
"description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data",
"definitions": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": {"$ref": "#"}
}
},
"dependencies": {
"patternProperties": {
"description": "prevent slow validation of large property names",
"required": ["propertyNames"],
"properties": {
"propertyNames": {
"required": ["maxLength"]
}
}
},
"uniqueItems": {
"description": "prevent slow validation of large non-scalar arrays",
"if": {
"properties": {
"uniqueItems": {"const": true},
"items": {
"properties": {
"type": {
"anyOf": [
{
"enum": ["object", "array"]
},
{
"type": "array",
"contains": {"enum": ["object", "array"]}
}
]
}
}
}
}
},
"then": {
"required": ["maxItems"]
}
},
"pattern": {
"description": "prevent slow pattern matching of large strings",
"required": ["maxLength"]
},
"format": {
"description": "prevent slow format validation of large strings",
"required": ["maxLength"]
}
},
"properties": {
"additionalItems": {"$ref": "#"},
"additionalProperties": {"$ref": "#"},
"dependencies": {
"additionalProperties": {
"anyOf": [{"type": "array"}, {"$ref": "#"}]
}
},
"items": {
"anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}]
},
"definitions": {
"additionalProperties": {"$ref": "#"}
},
"patternProperties": {
"additionalProperties": {"$ref": "#"}
},
"properties": {
"additionalProperties": {"$ref": "#"}
},
"if": {"$ref": "#"},
"then": {"$ref": "#"},
"else": {"$ref": "#"},
"allOf": {"$ref": "#/definitions/schemaArray"},
"anyOf": {"$ref": "#/definitions/schemaArray"},
"oneOf": {"$ref": "#/definitions/schemaArray"},
"not": {"$ref": "#"},
"contains": {"$ref": "#"},
"propertyNames": {"$ref": "#"}
}
}
@@ -0,0 +1 @@
{"version":3,"file":"is-html-element.mjs","sources":["../../../src/utils/is-html-element.ts"],"sourcesContent":["import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nexport function isHTMLElement(element: unknown): element is HTMLElement {\n return (\n isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element)\n )\n}\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,SAAU,aAAa,CAAC,OAAgB,EAAA;AAC1C,IAAA,QACI,QAAQ,CAAC,OAAO,CAAC;AACjB,QAAA,cAAc,IAAI,OAAO;AACzB,QAAA,EAAE,iBAAiB,IAAI,OAAO,CAAC;AAEvC;;;;"}
@@ -0,0 +1,18 @@
import {nextToken, skipLineComment} from "../tokenizer/index";
import {charCodes} from "../util/charcodes";
import {input, state} from "./base";
import {parseTopLevel} from "./statement";
export function parseFile() {
// If enabled, skip leading hashbang line.
if (
state.pos === 0 &&
input.charCodeAt(0) === charCodes.numberSign &&
input.charCodeAt(1) === charCodes.exclamationMark
) {
skipLineComment(2);
}
nextToken();
return parseTopLevel();
}