File

projects/m2-core/src/lib/core/utils/object.utils.ts

Index

Methods

Methods

Static addMissingProperties
addMissingProperties(from: T, to: T)
Type parameters :
  • T

Add "from" object's properties to "to" object if "to" doesn't have them yet

Parameters :
Name Type Optional
from T No
to T No
Returns : void
Static clear
clear(obj: Object)
Parameters :
Name Type Optional
obj Object No
Returns : void
Static clone
clone(srcObj: T, propertyConfig)
Type parameters :
  • T

Warning! It's intended that object has constructor that can be safely called without parameters

Parameters :
Name Type Optional Default value
srcObj T No
propertyConfig No true
Returns : T
Static cloneDeep
cloneDeep(srcObj: T)
Type parameters :
  • T

Warning! It's intended that object has constructor that can be safely called without parameters

Parameters :
Name Type Optional
srcObj T No
Returns : T
Static copyProperties
copyProperties(from: T, to: T, propertyConfig)
Type parameters :
  • T

Copies properties from the first object to the second and returns the second object.

Parameters :
Name Type Optional Default value
from T No
to T No
propertyConfig No true
Returns : T
Static deleteMissingProperties
deleteMissingProperties(source: T, target: T)
Type parameters :
  • T

Deletes properties from "target" object that are missed in "source" object

Parameters :
Name Type Optional
source T No
target T No
Returns : void
Static isNullOrEmpty
isNullOrEmpty(obj: Object)
Parameters :
Name Type Optional
obj Object No
Returns : boolean
Static stringify
stringify(value: any, omitCircular)
Parameters :
Name Type Optional Default value
value any No
omitCircular No false
Returns : string
Static validateIsJustCreated
validateIsJustCreated(entity: E)
Type parameters :
  • E
Parameters :
Name Type Optional
entity E No
Returns : boolean

results matching ""

    No results matching ""