diff --git a/src/vanilla.ts b/src/vanilla.ts index ab471238..d284eea4 100644 --- a/src/vanilla.ts +++ b/src/vanilla.ts @@ -325,19 +325,21 @@ export function ref(obj: T) { // unstable APIs (subject to change without notice) // ------------------------------------------------ -export const unstable_getInternalStates = (): { +export function unstable_getInternalStates(): { proxyStateMap: typeof proxyStateMap refSet: typeof refSet snapCache: typeof snapCache versionHolder: typeof versionHolder proxyCache: typeof proxyCache -} => ({ - proxyStateMap, - refSet, - snapCache, - versionHolder, - proxyCache, -}) +} { + return { + proxyStateMap, + refSet, + snapCache, + versionHolder, + proxyCache, + } +} export function unstable_replaceInternalFunction( name: 'objectIs', diff --git a/src/vanilla/utils/deepClone.ts b/src/vanilla/utils/deepClone.ts index 428bc33b..554cbf20 100644 --- a/src/vanilla/utils/deepClone.ts +++ b/src/vanilla/utils/deepClone.ts @@ -11,10 +11,10 @@ const getDefaultRefSet = (): WeakSet => { return defaultRefSet } -export const deepClone = ( +export function deepClone( obj: T, getRefSet: () => WeakSet = getDefaultRefSet, -): T => { +): T { if (!isObject(obj) || getRefSet().has(obj)) { return obj }