aswi2020vldc-gitlab/templetes/node_modules/lodash/_mapToArray.js @ ae1ff627
1 | 3a515b92 | cagy | /**
|
---|---|---|---|
2 | * Converts `map` to its key-value pairs.
|
||
3 | *
|
||
4 | * @private
|
||
5 | * @param {Object} map The map to convert.
|
||
6 | * @returns {Array} Returns the key-value pairs.
|
||
7 | */
|
||
8 | function mapToArray(map) { |
||
9 | var index = -1, |
||
10 | result = Array(map.size); |
||
11 | |||
12 | map.forEach(function(value, key) { |
||
13 | result[++index] = [key, value]; |
||
14 | });
|
||
15 | return result; |
||
16 | }
|
||
17 | |||
18 | module.exports = mapToArray; |