Skip to content

Commit c2cb648

Browse files
committed
refactor: drop unused qqbot utility exports
1 parent 4cbd1b5 commit c2cb648

2 files changed

Lines changed: 0 additions & 49 deletions

File tree

extensions/qqbot/src/engine/utils/string-normalize.ts

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,8 @@ export function normalizeLowercaseStringOrEmpty(value: unknown): string {
4949
return normalizeOptionalLowercaseString(value) ?? "";
5050
}
5151

52-
/** Return the raw string value or `undefined`. No trimming. */
53-
export function readStringValue(value: unknown): string | undefined {
54-
return typeof value === "string" ? value : undefined;
55-
}
56-
57-
/** Return true when the value is a non-empty trimmed string. */
58-
export function hasNonEmptyString(value: unknown): value is string {
59-
return normalizeOptionalString(value) !== undefined;
60-
}
61-
6252
// ---- Record coercion ----
6353

64-
/** Coerce a value into a `Record<string, unknown>`, defaulting to `{}`. */
65-
export function asRecord(value: unknown): Record<string, unknown> {
66-
return typeof value === "object" && value !== null ? (value as Record<string, unknown>) : {};
67-
}
68-
6954
/** Coerce a value into a `Record<string, unknown>` or `undefined`. */
7055
export function asOptionalObjectRecord(value: unknown): Record<string, unknown> | undefined {
7156
return value && typeof value === "object" ? (value as Record<string, unknown>) : undefined;
@@ -80,37 +65,6 @@ export function readStringField(
8065
return typeof v === "string" ? v : undefined;
8166
}
8267

83-
/** Read a number field from a record. */
84-
export function readNumberField(
85-
record: Record<string, unknown> | null | undefined,
86-
key: string,
87-
): number | undefined {
88-
const v = record?.[key];
89-
return typeof v === "number" ? v : undefined;
90-
}
91-
92-
/** Read a boolean field from a record. */
93-
export function readBooleanField(
94-
record: Record<string, unknown> | null | undefined,
95-
key: string,
96-
): boolean | undefined {
97-
const v = record?.[key];
98-
return typeof v === "boolean" ? v : undefined;
99-
}
100-
101-
/** Coerce a value into a string→string map, filtering out non-string values. */
102-
export function readStringMap(value: unknown): Record<string, string> {
103-
const record = asOptionalObjectRecord(value);
104-
if (!record) {
105-
return {};
106-
}
107-
return Object.fromEntries(
108-
Object.entries(record).flatMap(([key, entryValue]) =>
109-
typeof entryValue === "string" ? [[key, entryValue]] : [],
110-
),
111-
);
112-
}
113-
11468
// ---- Filename normalization ----
11569

11670
/**

extensions/qqbot/src/engine/utils/text-chunk.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
/** Maximum text length for a single QQ Bot message. */
1313
export const TEXT_CHUNK_LIMIT = 5000;
1414

15-
/** Text chunker function signature. */
16-
export type ChunkTextFn = (text: string, limit: number) => string[];
17-
1815
/**
1916
* Naive text chunking fallback.
2017
*

0 commit comments

Comments
 (0)