@luolapeikko/ts-common
    Preparing search index...

    Function objectValues

    • Type-safe Object.values() with overload for NonEmptyArray

      Type Parameters

      • R extends Record<string | number | symbol, unknown>

        The object shape

      Parameters

      • value: R

        The object shape to get the values from

      Returns ObjectMappedArray<R, R[keyof R]>

      Array of object values

      const result1: NonEmptyReadonlyArray<'value'> = objectValues({key: 'value'} as const);
      const result2: Array<string> = objectValues({key: 'value'});
      const result3: [] = objectValues({});

      v0.2.0