9 lines
227 B
TypeScript
9 lines
227 B
TypeScript
const serialize = (value: unknown) => {
|
|
return JSON.parse(JSON.stringify(value))
|
|
}
|
|
|
|
const deserialize = (value: Record<string, any>, constructor: any): any => {
|
|
return constructor(value)
|
|
}
|
|
|
|
export { serialize, deserialize } |