remeda
Version:
A utility library for JavaScript and Typescript.
38 lines (35 loc) • 1.21 kB
text/typescript
import { E as EnumerableStringKeyedValueOf } from './EnumerableStringKeyedValueOf-BU9R_cEk.cjs';
import { I as IterableContainer } from './IterableContainer-CtfinwiH.cjs';
import 'type-fest';
type Values<T extends object> = T extends IterableContainer ? Array<T[number]> : Array<EnumerableStringKeyedValueOf<T>>;
/**
* Returns a new array containing the values of the array or object.
*
* @param data - Either an array or an object.
* @signature
* R.values(source)
* @example
* R.values(['x', 'y', 'z']) // => ['x', 'y', 'z']
* R.values({ a: 'x', b: 'y', c: 'z' }) // => ['x', 'y', 'z']
* @dataFirst
* @category Object
*/
declare function values<T extends object>(data: T): Values<T>;
/**
* Returns a new array containing the values of the array or object.
*
* @signature
* R.values()(source)
* @example
* R.pipe(['x', 'y', 'z'], R.values()) // => ['x', 'y', 'z']
* R.pipe({ a: 'x', b: 'y', c: 'z' }, R.values()) // => ['x', 'y', 'z']
* R.pipe(
* { a: 'x', b: 'y', c: 'z' },
* R.values(),
* R.first(),
* ) // => 'x'
* @dataLast
* @category Object
*/
declare function values(): <T extends object>(data: T) => Values<T>;
export { values };