Options
All
  • Public
  • Public/Protected
  • All
Menu

A class which provides some operations on Object {@see ObjectProps}

export
static
class

Objects

Hierarchy

  • Objects

Index

Methods

Static addValue

  • addValue<T>(src: T, key: string, value: any, keys?: string[]): T
  • Adds value by key or keys to the given source Object

    static

    Type parameters

    Parameters

    • src: T
    • key: string
    • value: any
    • Optional keys: string[]

    Returns T

Static clone

  • clone<T>(src: T, ignoreList?: string[]): T
  • Clones the given source object

    static

    Type parameters

    Parameters

    • src: T
    • Optional ignoreList: string[]

    Returns T

Static forEach

  • forEach<T, U, K>(map: MapItems<T>, callback: function): boolean
  • Provides to navigate in the given Object and can broken if return false from callback function.

    static

    Type parameters

    • T

    • U

    • K

    Parameters

    • map: MapItems<T>
    • callback: function
        • (value: T, key: K): void | boolean
        • Parameters

          • value: T
          • key: K

          Returns void | boolean

    Returns boolean

Static getLength

  • getLength<T>(src: T): number
  • Gets length of the given object keys

    static

    Type parameters

    Parameters

    • src: T

    Returns number

Static getValue

  • getValue<T, U>(src: T, key: string, keys?: string[]): U
  • Gets value by the given key or keys from the given source object

    static

    Type parameters

    Parameters

    • src: T
    • key: string
    • Optional keys: string[]

    Returns U

Static has

  • has<T>(src: T, key?: string): boolean
  • Checks the given Object (is exist or not) or (the given key is exist or not}

    static

    Type parameters

    Parameters

    • src: T
    • Optional key: string

    Returns boolean

Static keys

  • keys<T>(src: T): string[]
  • Gets keys of the given object as string[].

    static

    Type parameters

    Parameters

    • src: T

    Returns string[]

Static map

  • map<T, U, K>(map: MapItems<T>, callback: function): U[]
  • Provdes to navigate in the given Object and create an array from the result of the callback function. if the result of the callback is empty then ignores it.

    static

    Type parameters

    • T

    • U

    • K

    Parameters

    • map: MapItems<T>
    • callback: function
        • (value: T, key: K): U
        • Parameters

          • value: T
          • key: K

          Returns U

    Returns U[]

Static merge

  • merge<S, D, R>(src: S, dest: D, ignoreList?: string[]): R
  • Merges the given source object and destination object by ignoreList.

    static

    Type parameters

    Parameters

    • src: S
    • dest: D
    • Optional ignoreList: string[]

    Returns R

Static mergeDefaults

  • mergeDefaults<D, P, R>(defaults: D, props: P): R
  • Merges the given default props and the given props

    static

    Type parameters

    Parameters

    • defaults: D
    • props: P

    Returns R

Static remove

  • remove<R, T>(src: T, key: any): T
  • Removes value by the given key from the given object

    static

    Type parameters

    Parameters

    • src: T
    • key: any

    Returns T

Static removeValue

  • removeValue<T>(src: T, value: any): T
  • Removes value from the given object

    static

    Type parameters

    Parameters

    • src: T
    • value: any

    Returns T

Static replace

  • replace<S, D>(src: S, dest: D): D

Static values

  • values<T>(src: T): any[]
  • Gets values of the given object as any[].

    static

    Type parameters

    Parameters

    • src: T

    Returns any[]

Generated using TypeDoc