In contrast to the built-in Object.getOwnPropertyDescriptors(), this function returns an empty object if provided undefined or null, rather than throwing an error.
Parameters
value: any
input object
Returns
PropertyDescriptorMap
property descriptors
Example
var obj = {
'beep': 'boop',
'foo': 3.14
};
var desc = getOwnPropertyDescriptors( obj );
// returns {...}
Returns an object's own property descriptors.
Notes
Object.getOwnPropertyDescriptors()
, this function returns an empty object if providedundefined
ornull
, rather than throwing an error.