Function createValueGetter

  • A function that reads a value from a row: a property path ("address.city", missing parents → undefined) or the given function itself.

    Type Parameters

    • T = any

    Parameters

    Returns ((row) => unknown)

    the getter

      • (row): unknown
      • Parameters

        • row: T

        Returns unknown

    Example

    const city = createValueGetter<{ address?: { city: string } }>("address.city");
    city({ address: { city: "Kiel" } }); // "Kiel"
    city({}); // undefined

    Since

    1.1.94