Xotic750 / object-define-properties-x

Sham for Object.defineProperties

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

object-define-properties-x

Sham for Object.defineProperties

module.exports(object, 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.

Param Type Description
object Object The object on which to define or modify properties.
properties Object An object whose own enumerable properties constitute descriptors for the properties to be defined or modified.

Example

import defineProperties from 'object-define-properties-x';

const obj = {};
defineProperties(obj, {
  property1: {
    value: true,
    writable: true,
  },
  property2: {
    value: 'Hello',
    writable: true,
  },
  // etc. etc.
});

About

Sham for Object.defineProperties

License:MIT License


Languages

Language:JavaScript 100.0%