init
This commit is contained in:
36
node_modules/ramda/es/toPairs.js
generated
vendored
Normal file
36
node_modules/ramda/es/toPairs.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import _curry1 from "./internal/_curry1.js";
|
||||
import _has from "./internal/_has.js";
|
||||
/**
|
||||
* Converts an object into an array of key, value arrays. Only the object's
|
||||
* own properties are used.
|
||||
* Note that the order of the output array is not guaranteed to be consistent
|
||||
* across different JS platforms.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.4.0
|
||||
* @category Object
|
||||
* @sig {String: *} -> [[String,*]]
|
||||
* @param {Object} obj The object to extract from
|
||||
* @return {Array} An array of key, value arrays from the object's own properties.
|
||||
* @see R.fromPairs
|
||||
* @example
|
||||
*
|
||||
* R.toPairs({a: 1, b: 2, c: 3}); //=> [['a', 1], ['b', 2], ['c', 3]]
|
||||
*/
|
||||
|
||||
var toPairs =
|
||||
/*#__PURE__*/
|
||||
_curry1(function toPairs(obj) {
|
||||
var pairs = [];
|
||||
|
||||
for (var prop in obj) {
|
||||
if (_has(prop, obj)) {
|
||||
pairs[pairs.length] = [prop, obj[prop]];
|
||||
}
|
||||
}
|
||||
|
||||
return pairs;
|
||||
});
|
||||
|
||||
export default toPairs;
|
Reference in New Issue
Block a user