source: node_modules/ramda/src/values.js

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: 877 bytes
Line 
1var _curry1 =
2/*#__PURE__*/
3require("./internal/_curry1.js");
4
5var keys =
6/*#__PURE__*/
7require("./keys.js");
8/**
9 * Returns a list of all the enumerable own properties of the supplied object.
10 * Note that the order of the output array is not guaranteed across different
11 * JS platforms.
12 *
13 * @func
14 * @memberOf R
15 * @since v0.1.0
16 * @category Object
17 * @sig {k: v} -> [v]
18 * @param {Object} obj The object to extract values from
19 * @return {Array} An array of the values of the object's own properties.
20 * @see R.valuesIn, R.keys, R.toPairs
21 * @example
22 *
23 * R.values({a: 1, b: 2, c: 3}); //=> [1, 2, 3]
24 */
25
26
27var values =
28/*#__PURE__*/
29_curry1(function values(obj) {
30 var props = keys(obj);
31 var len = props.length;
32 var vals = [];
33 var idx = 0;
34
35 while (idx < len) {
36 vals[idx] = obj[props[idx]];
37 idx += 1;
38 }
39
40 return vals;
41});
42
43module.exports = values;
Note: See TracBrowser for help on using the repository browser.