[Refactor] Use util.clone in mergeIfValid (#2752)

This commit is contained in:
Chenlei Hu
2025-02-27 11:47:56 -05:00
committed by GitHub
parent f9157ee05f
commit 96f02dbf80
2 changed files with 3 additions and 7 deletions

View File

@@ -28,7 +28,7 @@ function formatDate(text: string, date: Date) {
})
}
export function clone(obj: any) {
export function clone<T>(obj: T): T {
try {
if (typeof structuredClone !== 'undefined') {
return structuredClone(obj)