Download Latest Version 3.0.7 source code.tar.gz (319.8 kB)
Email in envelope

Get an email when there's a new version of Wretch

Home / 3.0.6
Name Modified Size InfoDownloads / Week
Parent folder
3.0.6 source code.tar.gz 2025-12-12 315.8 kB
3.0.6 source code.zip 2025-12-12 500.5 kB
README.md 2025-12-12 2.1 kB
Totals: 3 Items   818.3 kB 0

3.0.6 (2025-12-12)

:bug: Bug fix(es)

  • Add Self to return type (e5582d6)

    :::ts import wretch from "wretch"; import AbortAddon from "wretch/addons/abort";

    const base = wretch() .addon(AbortAddon()) .catcher(404, (error) => { throw error; });

    // Previously: ❌ TypeScript error: Property 'signal' does not exist // Now: 🟢 base.signal(new AbortController()).get("/test");

  • Widen catcherFallback error type (d0a3fbe), closes #290

    :::ts import wretch from "wretch";

    class ApiError extends Error { constructor(public status: number, message: string) { super(message); } }

    const api = wretch() .customError(async (error) => { return new ApiError(error.status, error.message); }) .catcherFallback((error) => { // Previously 🔴 // Error was typed as "ApiError" // But if you block the URL in Chrome DevTools (or network is down): // error is actually TypeError: Failed to fetch // // Now: 🟢 // error is properly typed as "unknown" console.log(error);

    });

:white_check_mark: Test improvement(s)

  • Add core snippet testing infrastructure (fcea6f7)
  • Add directive system for snippet test control (106e0d6)
  • Add execution engine and test orchestration (28f60a1)
  • Add extensible plugin system with examples (262a40d)
  • Integrate snippet testing framework and document usage (9cdeb4c)
Source: README.md, updated 2025-12-12