mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Move internal modules to “internal” folder.
This commit is contained in:
18
.internal/setToPairs.js
Normal file
18
.internal/setToPairs.js
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Converts `set` to its value-value pairs.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} set The set to convert.
|
||||
* @returns {Array} Returns the value-value pairs.
|
||||
*/
|
||||
function setToPairs(set) {
|
||||
let index = -1;
|
||||
const result = Array(set.size);
|
||||
|
||||
set.forEach(value =>
|
||||
result[++index] = [value, value]
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
export default setToPairs;
|
||||
Reference in New Issue
Block a user