@hamgom95/objtools
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@hamgom95/objtools

Object helper methods.

API Documentation

Functions

setDefault(key, defaultValue)

Get value for key in object or set default.

getPath(...levels)

Get value at path in object.

setPath(value, ...levels)

Set value at path in object.

register(cls)

Register object methods to cls.

setDefault(key, defaultValue) ⇒

Get value for key in object or set default.

Kind: global function
Returns: Value for property in object.

Param Description
key Key in object.
defaultValue Default value to set if property not found.

getPath(...levels) ⇒

Get value at path in object.

Kind: global function
Returns: Value at path.

Param Description
...levels Path in object.

setPath(value, ...levels) ⇒

Set value at path in object.

Kind: global function
Returns: Set value at path.

Param Description
value Value to set at path.
...levels Path in object.

register(cls) ⇒

Register object methods to cls.

Kind: global function
Returns: Mixed in class.

Param Description
cls Class to add methods to.

Readme

Keywords

Package Sidebar

Install

npm i @hamgom95/objtools

Weekly Downloads

2

Version

2.0.0

License

ISC

Unpacked Size

5.17 kB

Total Files

6

Last publish

Collaborators

  • hamgom95