3.1.2 • Published 5 years ago

reflect-define-property-x v3.1.2

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

reflect-define-property-x

Sham for Reflect.defineProperty

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.
ParamTypeDescription
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

import reflectDefineProperty from 'reflect-define-property-x';

const obj = {};
reflectDefineProperty(obj, 'x', {value: 7}); // true
console.log(obj.x); // 7
3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.13

5 years ago

3.0.12

5 years ago

3.0.11

5 years ago

3.0.10

5 years ago

3.0.9

5 years ago

3.0.8

5 years ago

3.0.7

5 years ago

3.0.6

5 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago