main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
503 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible');
|
---|
| 4 | var callBound = require('call-bind/callBound');
|
---|
| 5 | var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
|
---|
| 6 | var $push = callBound('Array.prototype.push');
|
---|
| 7 |
|
---|
| 8 | module.exports = function entries(O) {
|
---|
| 9 | var obj = RequireObjectCoercible(O);
|
---|
| 10 | var entrys = [];
|
---|
| 11 | for (var key in obj) {
|
---|
| 12 | if ($isEnumerable(obj, key)) { // checks own-ness as well
|
---|
| 13 | $push(entrys, [key, obj[key]]);
|
---|
| 14 | }
|
---|
| 15 | }
|
---|
| 16 | return entrys;
|
---|
| 17 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.