refactor: move capitalizeFirstLetter to core (#6506)

This commit is contained in:
Alex Yang
2025-12-03 15:21:03 -08:00
committed by github-actions[bot]
parent 717752e19a
commit 951dfdd7e7
10 changed files with 8 additions and 14 deletions

View File

@@ -3,6 +3,7 @@ import type {
BetterAuthClientPlugin,
} from "@better-auth/core";
import type { BASE_ERROR_CODES } from "@better-auth/core/error";
import { capitalizeFirstLetter } from "@better-auth/core/utils";
import type {
BetterFetchError,
BetterFetchResponse,
@@ -23,10 +24,6 @@ function getAtomKey(str: string) {
return `use${capitalizeFirstLetter(str)}`;
}
export function capitalizeFirstLetter(str: string) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
type InferResolvedHooks<O extends BetterAuthClientOptions> = O extends {
plugins: Array<infer Plugin>;
}

View File

@@ -3,6 +3,7 @@ import type {
BetterAuthClientPlugin,
} from "@better-auth/core";
import type { BASE_ERROR_CODES } from "@better-auth/core/error";
import { capitalizeFirstLetter } from "@better-auth/core/utils";
import type {
BetterFetchError,
BetterFetchResponse,
@@ -23,10 +24,6 @@ function getAtomKey(str: string) {
return `use${capitalizeFirstLetter(str)}`;
}
export function capitalizeFirstLetter(str: string) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
type InferResolvedHooks<O extends BetterAuthClientOptions> = O extends {
plugins: Array<infer Plugin>;
}

View File

@@ -3,13 +3,13 @@ import type {
BetterAuthClientPlugin,
} from "@better-auth/core";
import type { BASE_ERROR_CODES } from "@better-auth/core/error";
import { capitalizeFirstLetter } from "@better-auth/core/utils";
import type {
BetterFetchError,
BetterFetchResponse,
} from "@better-fetch/fetch";
import type { Accessor } from "solid-js";
import type { PrettifyDeep, UnionToIntersection } from "../../types/helper";
import { capitalizeFirstLetter } from "../../utils/misc";
import { getClientConfig } from "../config";
import { createDynamicPathProxy } from "../proxy";
import type {

View File

@@ -3,13 +3,13 @@ import type {
BetterAuthClientPlugin,
} from "@better-auth/core";
import type { BASE_ERROR_CODES } from "@better-auth/core/error";
import { capitalizeFirstLetter } from "@better-auth/core/utils";
import type {
BetterFetchError,
BetterFetchResponse,
} from "@better-fetch/fetch";
import type { Atom } from "nanostores";
import type { PrettifyDeep, UnionToIntersection } from "../../types/helper";
import { capitalizeFirstLetter } from "../../utils/misc";
import { getClientConfig } from "../config";
import { createDynamicPathProxy } from "../proxy";
import type {

View File

@@ -3,13 +3,13 @@ import type {
BetterAuthClientPlugin,
} from "@better-auth/core";
import type { BASE_ERROR_CODES } from "@better-auth/core/error";
import { capitalizeFirstLetter } from "@better-auth/core/utils";
import type {
BetterFetchError,
BetterFetchResponse,
} from "@better-fetch/fetch";
import type { Atom } from "nanostores";
import type { PrettifyDeep, UnionToIntersection } from "../types/helper";
import { capitalizeFirstLetter } from "../utils/misc";
import { getClientConfig } from "./config";
import { createDynamicPathProxy } from "./proxy";
import type {

View File

@@ -3,13 +3,13 @@ import type {
BetterAuthClientPlugin,
} from "@better-auth/core";
import type { BASE_ERROR_CODES } from "@better-auth/core/error";
import { capitalizeFirstLetter } from "@better-auth/core/utils";
import type {
BetterFetchError,
BetterFetchResponse,
} from "@better-fetch/fetch";
import type { DeepReadonly, Ref } from "vue";
import type { PrettifyDeep, UnionToIntersection } from "../../types/helper";
import { capitalizeFirstLetter } from "../../utils/misc";
import { getClientConfig } from "../config";
import { createDynamicPathProxy } from "../proxy";
import type {

View File

@@ -1,4 +1,3 @@
export { generateId } from "@better-auth/core/utils";
export * from "../oauth2/state";
export * from "./hide-metadata";
export * from "./misc";

View File

@@ -1,8 +1,8 @@
import { existsSync } from "node:fs";
import fs from "node:fs/promises";
import path from "node:path";
import { capitalizeFirstLetter } from "@better-auth/core/utils";
import { produceSchema } from "@mrleebo/prisma-ast";
import { capitalizeFirstLetter } from "better-auth";
import { initGetFieldName, initGetModelName } from "better-auth/adapters";
import type { FieldType } from "better-auth/db";
import { getAuthTables } from "better-auth/db";

View File

@@ -1,3 +1,4 @@
export { defineErrorCodes } from "./error-codes";
export { generateId } from "./id";
export { safeJSONParse } from "./json";
export { capitalizeFirstLetter } from "./string";