npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

reflect-define-property-x

2.1.0 • Public • Published

Travis status Dependency status devDependency status npm version

reflect-define-property-x

Sham for Reflect.defineProperty

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

module.exports(target, propertyKey, attributes)Object

This method allows precise addition to or modification of a property on an object. For more details see the Object.defineProperty which is similar. Object.defineProperty returns the object or throws a TypeError if the property has not been successfully defined. Reflect.defineProperty, however, simply returns a Boolean indicating whether or not the property was successfully defined.

Kind: Exported function
Returns: Object - A Boolean indicating whether or not the property was successfully defined.
Throws:

  • TypeError If target is not an Object.
Param Type Description
target * The target object on which to define the property.
propertyKey * The name of the property to be defined or modified.
attributes * The attributes for the property being defined or modified.

Example

var nativeDP = require('reflect-define-property-x');
var obj = {};
nativeDP(obj, 'x', {value: 7}); // true
obj.x; // 7

install

npm i reflect-define-property-x

Downloadsweekly downloads

0

version

2.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability