Libraries
    Preparing search index...

    Function mapObject

    • Apply a map of per-key transformations to an object, returning a new object with the transformed values.

      Keys not present in mappers are copied through unchanged. Keys present in mappers are passed through mapValue.

      Type Parameters

      • T extends Record<string, any>

      Parameters

      • obj: T

        The source object (e.g. a raw database row).

      • mappers: Record<string, ((v: any) => any) | string>

        A Record mapping property keys to mapper functions or MAPPERS built-in names.

      Returns T

      A shallow copy of obj with the specified values transformed.

      If obj is null or a non-object, it is returned as-is.