We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84ce57a commit 03f66a5Copy full SHA for 03f66a5
src/common/utils.ts
@@ -0,0 +1,10 @@
1
+/**
2
+ * Clone a new object by an object instance
3
+ * @param origin Original object instance
4
+ */
5
+export function cloneInstance<T>(origin: T) {
6
+ return {
7
+ ...origin,
8
+ ...Object.getPrototypeOf(origin),
9
+ };
10
+}
0 commit comments