UNPKG

349 BPlain TextView Raw
1'use strict';
2import type { SharedValue } from './commonTypes';
3
4export function isSharedValue<T = unknown>(
5 value: unknown
6): value is SharedValue<T> {
7 'worklet';
8 // We cannot use `in` operator here because `value` could be a HostObject and therefore we cast.
9 return (value as Record<string, unknown>)?._isReanimatedSharedValue === true;
10}