0
0
mirror of https://github.com/Doodle3D/Doodle3D-API synced 2024-12-23 14:13:47 +01:00
Doodle3D-API/jspm_packages/npm/core-js@0.9.18/modules/es7.object.to-array.js
2015-07-15 15:06:18 +02:00

25 lines
572 B
JavaScript

/* */
var $ = require("./$"),
$def = require("./$.def");
function createObjectToArray(isEntries) {
return function(object) {
var O = $.toObject(object),
keys = $.getKeys(O),
length = keys.length,
i = 0,
result = Array(length),
key;
if (isEntries)
while (length > i)
result[i] = [key = keys[i++], O[key]];
else
while (length > i)
result[i] = O[keys[i++]];
return result;
};
}
$def($def.S, 'Object', {
values: createObjectToArray(false),
entries: createObjectToArray(true)
});