5.1.2 • Published 5 years ago

object-define-property-x v5.1.2

Weekly downloads
1,308
License
MIT
Repository
github
Last release
5 years ago

object-define-property-x

Sham for Object.defineProperties

module.exports(object, prop, properties)Object

This method defines new or modifies existing properties directly on an object, returning the object.

Kind: Exported function
Returns: Object - The object that was passed to the function.

ParamTypeDescription
objectObjectThe object on which to define or modify properties.
pro*The name or Symbol of the property to be defined or modified.
propertiesObjectAn object whose own enumerable properties constitute descriptors for the properties to be defined or modified.

Example

import defineProperty from 'object-define-property-x';

const obj = {};
defineProperty(obj, 'key', {
  enumerable: false,
  configurable: false,
  writable: false,
  value: 'static',
});