Skip to content

The open alternative to Salesforce, designed for AI.

439 B
Raw Blame
type IsMutationOldValueRequestedInput = {
  options: MutationObserverInit;
  recordType: MutationRecordType;
};

export const isMutationOldValueRequested = ({
  options,
  recordType,
}: IsMutationOldValueRequestedInput): boolean => {
  if (recordType === 'attributes') {
    return options.attributeOldValue === true;
  }

  if (recordType === 'characterData') {
    return options.characterDataOldValue === true;
  }

  return false;
};