release: WRNexusJS 0.4.0

This commit is contained in:
2026-07-27 12:42:18 +05:30
parent 8b728a3e5d
commit 30e5721e84
250 changed files with 10065 additions and 3923 deletions
+11
View File
@@ -6,6 +6,7 @@ import {
getOriginalRequestPath,
getOriginalRequestUrl,
redirectToLogin,
stableStringify,
} from "../src/index.ts";
function context(url: string, headers: HeadersInit = {}) {
@@ -133,3 +134,13 @@ test("supports an allowed-host callback and custom response options", () => {
expect(location.searchParams.get("tenant")).toBe("acme");
expect(location.searchParams.get("next")).toBe("https://reports.example.test/");
});
test("stableStringify permits repeated references but rejects cycles", () => {
const shared = { value: 1 };
expect(stableStringify({ second: shared, first: shared })).toBe(
'{"first":{"value":1},"second":{"value":1}}',
);
const circular: { self?: unknown } = {};
circular.self = circular;
expect(() => stableStringify(circular)).toThrow("circular");
});