Amazon Vinyl
    Preparing search index...

    Function addIfPresent

    • Conditionally adds properties from an attribute map to an object. Only adds a property if the corresponding attribute key exists and is truthy.

      Type Parameters

      • T extends Record<string, any>

      Parameters

      • obj: T
      • attrs: Record<string, string>
      • mappings: Record<string, string>

      Returns T