[api] Add clone function to utils

This commit is contained in:
Ferdinand Thiessen 2021-11-21 15:08:58 +01:00
parent 04e3c57397
commit 1158525abb
2 changed files with 4 additions and 0 deletions

View File

@ -5,3 +5,4 @@ export * from './src/stores/';
export * from './src/utils/datetime';
export * from './src/utils/permission';
export * from './src/utils/validators';
export * from './src/utils/misc';

3
api/src/utils/misc.ts Normal file
View File

@ -0,0 +1,3 @@
export function clone<T>(o: T): T {
return <T>JSON.parse(JSON.stringify(o));
}