Skip to content

Commit 3df8b9e

Browse files
feat(overmind): add json function to deep copy objects for 3rd parties
1 parent 6b76588 commit 3df8b9e

File tree

1 file changed

+3
-0
lines changed
  • packages/node_modules/overmind/src

1 file changed

+3
-0
lines changed

packages/node_modules/overmind/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ export const MODE_DEFAULT = Symbol('MODE_DEFAULT')
7676
export const MODE_TEST = Symbol('MODE_TEST')
7777
export const MODE_SSR = Symbol('MODE_SSR')
7878

79+
export const json = (obj: any) =>
80+
deepCopy(obj && obj[IS_PROXY] ? obj[VALUE] : obj)
81+
7982
export interface OvermindSSR<Config extends IConfiguration>
8083
extends Overmind<Config> {
8184
hydrate(): IMutation[]

0 commit comments

Comments
 (0)