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:
944 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | var _curry1 =
|
---|
| 2 | /*#__PURE__*/
|
---|
| 3 | require("./internal/_curry1.js");
|
---|
| 4 | /**
|
---|
| 5 | * Converts an object into an array of key, value arrays. The object's own
|
---|
| 6 | * properties and prototype properties are used. Note that the order of the
|
---|
| 7 | * output array is not guaranteed to be consistent across different JS
|
---|
| 8 | * platforms.
|
---|
| 9 | *
|
---|
| 10 | * @func
|
---|
| 11 | * @memberOf R
|
---|
| 12 | * @since v0.4.0
|
---|
| 13 | * @category Object
|
---|
| 14 | * @sig {String: *} -> [[String,*]]
|
---|
| 15 | * @param {Object} obj The object to extract from
|
---|
| 16 | * @return {Array} An array of key, value arrays from the object's own
|
---|
| 17 | * and prototype properties.
|
---|
| 18 | * @example
|
---|
| 19 | *
|
---|
| 20 | * const F = function() { this.x = 'X'; };
|
---|
| 21 | * F.prototype.y = 'Y';
|
---|
| 22 | * const f = new F();
|
---|
| 23 | * R.toPairsIn(f); //=> [['x','X'], ['y','Y']]
|
---|
| 24 | */
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 | var toPairsIn =
|
---|
| 28 | /*#__PURE__*/
|
---|
| 29 | _curry1(function toPairsIn(obj) {
|
---|
| 30 | var pairs = [];
|
---|
| 31 |
|
---|
| 32 | for (var prop in obj) {
|
---|
| 33 | pairs[pairs.length] = [prop, obj[prop]];
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | return pairs;
|
---|
| 37 | });
|
---|
| 38 |
|
---|
| 39 | module.exports = toPairsIn; |
---|
Note:
See
TracBrowser
for help on using the repository browser.