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