2.0.3 • Published 5 years ago

@1791-labs/object-utilities v2.0.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 years ago

Project: ObjectUtilities

Some utility functions for JavaScript objects.

npm (latest version) David David (dev) npm (license)

Travis CI (branch: master) Travis CI (branch: develop)

Coveralls (branch: master) Coveralls (branch: develop)

Installation

To install ObjectUtilities, run:

npm i --save '@1791-labs/object-utilities'

Usage

const ObjectUtilities = require('@1791-labs/object-utilities')

API

ObjectUtilities

Kind: global class


ObjectUtilities.createAccessorPropertyDescriptor(getter, setter) ⇒ PropertyDescriptor

Kind: static method of ObjectUtilities
Returns: PropertyDescriptor - The accessor property descriptor.

ParamTypeDescription
getterfunctionA function that serves as a getter for the property.
setterfunctionA function that serves as a setter for the property.

ObjectUtilities.createDataPropertyDescriptor(value, isWritable) ⇒ PropertyDescriptor

Kind: static method of ObjectUtilities
Returns: PropertyDescriptor - The data property descriptor.

ParamTypeDescription
value*The value associated with the property.
isWritableBooleanA boolean flag establishing whether or not the property's value may be changed with an assignment operator.

ObjectUtilities.createDescribedFrozenObject(propertyDescriptors) ⇒ Object

Kind: static method of ObjectUtilities
Returns: Object - The frozen object.

ParamTypeDescription
propertyDescriptorsArray.<PropertyDescriptor>A set of property descriptors defining each property of the object.

ObjectUtilities.createDescribedSealedObject(propertyDescriptors) ⇒ Object

Kind: static method of ObjectUtilities
Returns: Object - The sealed object.

ParamTypeDescription
propertyDescriptorsArray.<PropertyDescriptor>A set of property descriptors defining each property of the object.

ObjectUtilities.createEmptyObject() ⇒ Object

Kind: static method of ObjectUtilities
Returns: Object - The object.


ObjectUtilities.createEnumerableAccessorPropertyDescriptor(getter, setter) ⇒ PropertyDescriptor

Kind: static method of ObjectUtilities
Returns: PropertyDescriptor - The enumerable accessor property descriptor.

ParamTypeDescription
getterfunctionA function that serves as a getter for the property.
setterfunctionA function that serves as a setter for the property.

ObjectUtilities.createEnumerableDataPropertyDescriptor(value, isWritable) ⇒ PropertyDescriptor

Kind: static method of ObjectUtilities
Returns: PropertyDescriptor - The enumerable data property descriptor.

ParamTypeDescription
value*The value associated with the property.
isWritableBooleanA boolean flag establishing whether or not the property's value may be changed with an assignment operator.

ObjectUtilities.createFrozenObject(properties) ⇒ Object

Kind: static method of ObjectUtilities
Returns: Object - The frozen object.

ParamTypeDescription
propertiesObjectThe properties of the object.

ObjectUtilities.createObject(properties) ⇒ Object

Kind: static method of ObjectUtilities
Returns: Object - The object.

ParamTypeDescription
propertiesObjectThe properties of the object.

ObjectUtilities.createSealedObject(properties) ⇒ Object

Kind: static method of ObjectUtilities
Returns: Object - The sealed object.

ParamTypeDescription
propertiesObjectThe properties of the object.

Author

Jay B. [j@1791.io](mailto:j@1791.io)

License

Apache-2.0, Apache License, Version 2.0

2.0.3

5 years ago

2.0.2

5 years ago

2.0.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.0

5 years ago

0.1.4

5 years ago