forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattachment-utils.ts
More file actions
32 lines (29 loc) · 913 Bytes
/
Copy pathattachment-utils.ts
File metadata and controls
32 lines (29 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Re-export utilities from shared
export {
getModalityFromMimeType,
formatFileSize,
exceedsMaxSize,
readFileAsBase64,
generateVideoThumbnail,
matchesAcceptFilter,
} from "@copilotkit/shared";
// Deprecation warning helpers — react-ui specific
const suppressedWarnings = new Set<string>();
let globalSuppress = false;
/**
* Issue a deprecation warning once per key per session.
* Suppressed entirely if the user calls suppressDeprecationWarnings().
*/
export function deprecationWarning(key: string, message: string) {
if (globalSuppress || suppressedWarnings.has(key)) return;
if (typeof process !== "undefined" && process.env?.NODE_ENV === "production")
return;
suppressedWarnings.add(key);
console.warn(`[CopilotKit] Deprecation: ${message}`);
}
/**
* Suppress all CopilotKit deprecation warnings.
*/
export function suppressDeprecationWarnings() {
globalSuppress = true;
}