main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
839 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import _curry1 from "./internal/_curry1.js";
|
---|
| 2 | import keys from "./keys.js";
|
---|
| 3 | /**
|
---|
| 4 | * Returns a list of all the enumerable own properties of the supplied object.
|
---|
| 5 | * Note that the order of the output array is not guaranteed across different
|
---|
| 6 | * JS platforms.
|
---|
| 7 | *
|
---|
| 8 | * @func
|
---|
| 9 | * @memberOf R
|
---|
| 10 | * @since v0.1.0
|
---|
| 11 | * @category Object
|
---|
| 12 | * @sig {k: v} -> [v]
|
---|
| 13 | * @param {Object} obj The object to extract values from
|
---|
| 14 | * @return {Array} An array of the values of the object's own properties.
|
---|
| 15 | * @see R.valuesIn, R.keys, R.toPairs
|
---|
| 16 | * @example
|
---|
| 17 | *
|
---|
| 18 | * R.values({a: 1, b: 2, c: 3}); //=> [1, 2, 3]
|
---|
| 19 | */
|
---|
| 20 |
|
---|
| 21 | var values =
|
---|
| 22 | /*#__PURE__*/
|
---|
| 23 | _curry1(function values(obj) {
|
---|
| 24 | var props = keys(obj);
|
---|
| 25 | var len = props.length;
|
---|
| 26 | var vals = [];
|
---|
| 27 | var idx = 0;
|
---|
| 28 |
|
---|
| 29 | while (idx < len) {
|
---|
| 30 | vals[idx] = obj[props[idx]];
|
---|
| 31 | idx += 1;
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | return vals;
|
---|
| 35 | });
|
---|
| 36 |
|
---|
| 37 | export default values; |
---|
Note:
See
TracBrowser
for help on using the repository browser.