Socket
Socket
Sign inDemoInstall

@1791-labs/object-utilities

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@1791-labs/object-utilities

Some utility functions for JavaScript objects.


Version published
Maintainers
1
Created
Source

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

Some utility functions for JavaScript objects.

Kind: global class


ObjectUtilities.createAccessorPropertyDescriptor([getter], [setter]) ⇒ PropertyDescriptor

Creates an accessor property descriptor using the provided getter and setter functions.

Kind: static method of ObjectUtilities
Returns: PropertyDescriptor -

The accessor property descriptor.

ParamTypeDescription
[getter]function

A function that serves as a getter for the property.

[setter]function

A function that serves as a setter for the property.


ObjectUtilities.createDataPropertyDescriptor([value], [isWritable]) ⇒ PropertyDescriptor

Creates a data property descriptor using the provided value and isWritable flag.

Kind: static method of ObjectUtilities
Returns: PropertyDescriptor -

The data property descriptor.

ParamTypeDescription
[value]*

The value associated with the property.

[isWritable]Boolean

A boolean flag establishing whether or not the property's value may be changed with an assignment operator.


ObjectUtilities.createDescribedFrozenObject([propertyDescriptors]) ⇒ Object

Creates a frozen object (via Object.freeze) using the provided propertyDescriptors to define the properties of the object.

Kind: static method of ObjectUtilities
Returns: Object -

The frozen object.

ParamTypeDescription
[propertyDescriptors]Array.<PropertyDescriptor>

A set of property descriptors defining each property of the object.


ObjectUtilities.createDescribedSealedObject([propertyDescriptors]) ⇒ Object

Creates a sealed object (via Object.seal) using the provided propertyDescriptors to define the properties of the object.

Kind: static method of ObjectUtilities
Returns: Object -

The sealed object.

ParamTypeDescription
[propertyDescriptors]Array.<PropertyDescriptor>

A set of property descriptors defining each property of the object.


ObjectUtilities.createEmptyObject() ⇒ Object

Creates a null-prototyped empty object.

Kind: static method of ObjectUtilities
Returns: Object -

The object.


ObjectUtilities.createEnumerableAccessorPropertyDescriptor([getter], [setter]) ⇒ PropertyDescriptor

Creates an enumerable accessor property descriptor using the provided getter and setter functions.

Kind: static method of ObjectUtilities
Returns: PropertyDescriptor -

The enumerable accessor property descriptor.

ParamTypeDescription
[getter]function

A function that serves as a getter for the property.

[setter]function

A function that serves as a setter for the property.


ObjectUtilities.createEnumerableDataPropertyDescriptor([value], [isWritable]) ⇒ PropertyDescriptor

Creates an enumerable data property descriptor using the provided value and isWritable flag.

Kind: static method of ObjectUtilities
Returns: PropertyDescriptor -

The enumerable data property descriptor.

ParamTypeDescription
[value]*

The value associated with the property.

[isWritable]Boolean

A boolean flag establishing whether or not the property's value may be changed with an assignment operator.


ObjectUtilities.createFrozenObject([properties]) ⇒ Object

Creates a frozen object (via Object.freeze) with the provided properties.

Kind: static method of ObjectUtilities
Returns: Object -

The frozen object.

ParamTypeDescription
[properties]Object

The properties of the object.


ObjectUtilities.createObject([properties]) ⇒ Object

Creates an object with the provided properties.

Kind: static method of ObjectUtilities
Returns: Object -

The object.

ParamTypeDescription
[properties]Object

The properties of the object.


ObjectUtilities.createSealedObject([properties]) ⇒ Object

Creates a sealed object (via Object.seal) with the provided properties.

Kind: static method of ObjectUtilities
Returns: Object -

The sealed object.

ParamTypeDescription
[properties]Object

The properties of the object.


Author

Jay B. <j@1791.io>

License

Apache-2.0, Apache License, Version 2.0

FAQs

Package last updated on 21 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc