Files
asciidisco.com/build/node_modules/object-get-own-property-descriptor-x/README.md
2023-08-01 13:49:46 +02:00

2.2 KiB

Travis status Dependency status devDependency status npm version

object-get-own-property-descriptor-x

Sham for ES6 Object.getOwnPropertyDescriptor

Version: 3.2.0
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750

module.exportsObject

This method returns a property descriptor for an own property (that is, one directly present on an object and not in the object's prototype chain) of a given object.

Kind: Exported member
Returns: Object - A property descriptor of the given property if it exists on the object, undefined otherwise.

Param Type Description
object * The object in which to look for the property.
property * The name of the property whose description is to be retrieved.

Example

var getOwnPropertyDescriptor = require('object-get-own-property-descriptor-x');
var obj = { bar: 42 };
var d = getOwnPropertyDescriptor(o, 'bar');
// d is {
//   configurable: true,
//   enumerable: true,
//   value: 42,
//   writable: true
// }