Skip to content

The open alternative to Salesforce, designed for AI.

311 B
Raw Blame
import { isPlainObject } from 'twenty-shared/utils';

export const getValidationRulePreviewValue = (
  record: Record<string, unknown>,
  path: string,
): unknown =>
  path
    .split('.')
    .reduce<unknown>(
      (value, segment) => (isPlainObject(value) ? value[segment] : undefined),
      record,
    );