[PR #7162] [MERGED] chore(core): add deprecate API #15358

Closed
opened 2026-04-13 09:59:14 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7162
Author: @himself65
Created: 1/7/2026
Status: ✅ Merged
Merged: 1/7/2026
Merged by: @himself65

Base: canary ← Head: himself65/2026/01/07/deprecate


📝 Commits (2)

📊 Changes

3 files changed (+94 additions, -0 deletions)

View changed files

➕ packages/core/src/utils/deprecate.test.ts (+72 -0)
➕ packages/core/src/utils/deprecate.ts (+21 -0)
📝 packages/core/src/utils/index.ts (+1 -0)

📄 Description

Summary by cubic

Add a deprecate utility to wrap functions and emit a one-time deprecation warning while preserving behavior. Exported from core utils and covered with tests.

  • New Features
    • Added deprecate(fn, message, logger?) that warns once with “[Deprecation] …” and then calls the original function.
    • Supports custom logger.warn; falls back to console.warn.
    • Preserves this context, arguments, and return value.

Written for commit 5b55eb33ee. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7162 **Author:** [@himself65](https://github.com/himself65) **Created:** 1/7/2026 **Status:** ✅ Merged **Merged:** 1/7/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2026/01/07/deprecate` --- ### 📝 Commits (2) - [`dea1678`](https://github.com/better-auth/better-auth/commit/dea167850f05395f4424bf583459f1a4f0e2fc82) chore(core): add `deprecate` API - [`5b55eb3`](https://github.com/better-auth/better-auth/commit/5b55eb33eef461cd2e5ffbf018b1395be9e30062) fix: export ### 📊 Changes **3 files changed** (+94 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `packages/core/src/utils/deprecate.test.ts` (+72 -0) ➕ `packages/core/src/utils/deprecate.ts` (+21 -0) 📝 `packages/core/src/utils/index.ts` (+1 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Add a deprecate utility to wrap functions and emit a one-time deprecation warning while preserving behavior. Exported from core utils and covered with tests. - New Features - Added deprecate(fn, message, logger?) that warns once with “[Deprecation] …” and then calls the original function. - Supports custom logger.warn; falls back to console.warn. - Preserves this context, arguments, and return value. <sup>Written for commit 5b55eb33eef461cd2e5ffbf018b1395be9e30062. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 09:59:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#15358