Skip to content
AutoMapper TypeScript
Esc
navigateopen⌘Jpreview

nullSubstitution

Replace a strictly null source member with a fixed destination value.

forMember(
  (destination) => destination.fullName,
  nullSubstitution('Unknown user'),
);

Only null is substituted. An undefined value is unchanged; use undefinedSubstitution() for that case. Object substitutions are assigned as provided without nested mapping.

Last updated on July 16, 2026

Was this page helpful?