Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "objects"

Index

Variables

Const toString

toString: toString = Object.prototype.toString

Functions

arrayMerge

  • arrayMerge<T, S>(target: T, source: S): Array<T | S>
  • Type parameters

    • T: Array<any>

    • S: Array<any>

    Parameters

    • target: T
    • source: S

    Returns Array<T | S>

cloneIfNecessary

  • cloneIfNecessary<T>(value: T): T
  • Type parameters

    • T

    Parameters

    • value: T

    Returns T

emptyTarget

  • emptyTarget<T>(val: T): object
  • Type parameters

    • T

    Parameters

    • val: T

    Returns object

filter

  • filter<T>(item: T, filterFn: function): Partial<T>
  • Filter item keys and create new object

    Type parameters

    • T: any

    Parameters

    • item: T
    • filterFn: function
        • (key: keyof T): boolean
        • Parameters

          • key: keyof T

          Returns boolean

    Returns Partial<T>

isEmpty

  • isEmpty(item?: Object | Array<any> | null): boolean
  • Is object empty (no keys)

    Parameters

    • Optional item: Object | Array<any> | null

      The object to check

    Returns boolean

isMergeableObject

  • isMergeableObject(val: any): boolean

keys

  • keys<T>(item: T): keyof T[]
  • Get object keys from item

    Type parameters

    • T: any

    Parameters

    • item: T

      The object to get keys from

    Returns keyof T[]

    Object keys

mapKeyValues

  • mapKeyValues<V, T, R>(item: T, mapKeyFn: function, mapValueFn: function): object
  • Create new object with mapped key/value from item

    Type parameters

    • V

    • T: object

    • R

    Parameters

    • item: T
    • mapKeyFn: function

      Function to map keys

        • (key: keyof T): string
        • Parameters

          • key: keyof T

          Returns string

    • mapValueFn: function

      Function to map values

        • (value: V): R
        • Parameters

          • value: V

          Returns R

    Returns object

    • [key: string]: R

mapKeys

  • mapKeys<V, T>(item: T, mapKeyFn: function): object
  • Create new object with mapped keys from item

    Type parameters

    • V

    • T: object

    Parameters

    • item: T
    • mapKeyFn: function

      Function to map key

        • (key: keyof T): string
        • Parameters

          • key: keyof T

          Returns string

    Returns object

    • [key: string]: V

mapValues

  • mapValues<R, V, T>(item: T, mapValueFn: function): object
  • Create new object with mapped values from item

    Type parameters

    • R

    • V

    • T: object

    Parameters

    • item: T
    • mapValueFn: function

      Function to map values

        • (value: V): R
        • Parameters

          • value: V

          Returns R

    Returns object

    • [key: string]: R

merge

  • merge<T, S>(target: T, source: S): T & S | Array<T | S>
  • This method is like Object.assign except that it recursively merges own and inherited enumerable string keyed properties of source objects into the destination object. Source properties that resolve to undefined are skipped if a destination value exists. Array and plain object properties are merged recursively. Other objects and value types are overridden by assignment. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.

    Type parameters

    • T

    • S

    Parameters

    • target: T
    • source: S

    Returns T & S | Array<T | S>

mergeObject

  • mergeObject<T, S>(target: T, source: S): T & S
  • Type parameters

    • T: Object

    • S: Object

    Parameters

    • target: T
    • source: S

    Returns T & S

omit

  • omit<T>(item: T, keys: (string | keyof T)[]): Partial<T>
  • Omit keys from item and return new object

    Type parameters

    • T: any

    Parameters

    • item: T
    • keys: (string | keyof T)[]

      The keys to exclude

    Returns Partial<T>

patch

  • patch<T>(old: T, patch: Partial<T>): Partial<T>
  • Creates a patch for old using values from patch

    example

    patch({a:1,b:2}, {a:1,b:3,c:4}) === {b:3,c:4}

    Type parameters

    • T: any

    Parameters

    • old: T
    • patch: Partial<T>

    Returns Partial<T>

pick

  • pick<T>(item: T, keys: (string | keyof T)[]): Partial<T>
  • Pick keys from item and return new object

    Type parameters

    • T: any

    Parameters

    • item: T
    • keys: (string | keyof T)[]

      The keys to include

    Returns Partial<T>

reduce

  • reduce<V, T, R>(item: T, reduceFn: function): object
  • Reduce item keys and creates new object

    Type parameters

    • V

    • T: object

    • R

    Parameters

    • item: T
    • reduceFn: function

      Reduce function

        • (key: keyof T, value: V): R
        • Parameters

          • key: keyof T
          • value: V

          Returns R

    Returns object

    • [key: string]: R

shallowEqual

  • shallowEqual(objA: Object | null | undefined, objB: Object | null | undefined): boolean
  • Check object keys equality

    Parameters

    • objA: Object | null | undefined
    • objB: Object | null | undefined

    Returns boolean

values

  • values<V, T>(item: T): V[]
  • Get object key values from item

    Type parameters

    • V

    • T: object

    Parameters

    • item: T

      The object to get keys from

    Returns V[]

    Object values

Generated using TypeDoc