Options
All
  • Public
  • Public/Protected
  • All
Menu

Selective Utilities

Hierarchy

  • DeepObject

Index

Constructors

Properties

Methods

Constructors

constructor

  • new DeepObject(obj?: Record<string, any>): DeepObject

Properties

obj

obj: Record<string, any>

Methods

get

  • get(key: string): any
  • Allows for accessing nested values in an object with a single reference.

    Parameters

    • key: string

      Period separated reference to the deep value.

    Returns any

keys

  • keys(): string[]
  • Determine all of the 'key' references for a deep object.

    { foo: { bar: true } } => ['foo.bar']
    

    Returns string[]

set

  • set(key: string, value: any): void
  • Set a deep value on the object using a referenced key.

    Parameters

    • key: string

      Period separated reference to the deep value.

    • value: any

      New value to set at the deep reference.

    Returns void

update

  • update(value?: Record<string, any>): void
  • Updates the current object with the keys from a new value.

    Parameters

    • Optional value: Record<string, any>

      New object to be added to the existing object.

    Returns void

Generated using TypeDoc