source: frontend/node_modules/underscore/modules/keys.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 565 bytes
Line 
1import isObject from './isObject.js';
2import { nativeKeys, hasEnumBug } from './_setup.js';
3import has from './_has.js';
4import collectNonEnumProps from './_collectNonEnumProps.js';
5
6// Retrieve the names of an object's own properties.
7// Delegates to **ECMAScript 5**'s native `Object.keys`.
8export default function keys(obj) {
9 if (!isObject(obj)) return [];
10 if (nativeKeys) return nativeKeys(obj);
11 var keys = [];
12 for (var key in obj) if (has(obj, key)) keys.push(key);
13 // Ahem, IE < 9.
14 if (hasEnumBug) collectNonEnumProps(obj, keys);
15 return keys;
16}
Note: See TracBrowser for help on using the repository browser.