Skip to content

Object

Type module

Sources

Items from Object can be imported/included and used via following ways.

/**
* Import via main package
* Access items like: am4core.object.myVariable
*/
import * as am4core from "@amcharts/amcharts4";
/**
* Import via: Object.ts
* Access items like: $object.myVariable
*/
import * as $object from "@amcharts/amcharts4/Object";

Variables

Object does not have any variables.

Functions

clone(object: Object)

Returns Object

Returns object clone.

copyAllProperties(from: object,
to: object
)

Returns void

Copies all properties from one object to another.

copyProperties(source: object,
target: object,
keys: Array <string>
)

Returns void

Copies all properties of one object to the other, omitting undefined.

eachOrdered(object: Object,
fn: (key: Key, value: Object[""]) => void,
ord: (a: $type.Keyof <Object>, b: $type.Keyof <Object>) => Ordering
)

Returns void

Orders object properties using custom ord function and iterates through them calling fn for each of them.

entries(object: Object)

Returns Iterator <...>

Returns an iterator for all entries in object.

Can be used to safely iterate through all properties of the object.

forceCopyProperties(source: object,
target: object,
keys: Array <string>
)

Returns void

Copies a list of properties from one object to another.

Will copy empty properties.

getKey(object: Object,
key: Key
)

Returns Object[""]

Returns value of the specific key.

hasKey(object: Object,
key: Key
)

Returns boolean

Checks if object has a specific key.

keys(object: Object)

Returns Array <$type.Keyof <Object>>

Returns an array of object's property names.

keysOrdered(object: Object,
order: (a: $type.Keyof <Object>, b: $type.Keyof <Object>) => Ordering
)

Returns Array <$type.Keyof <Object>>

Returns an array of object's property names ordered using specific ordering function.

merge(object1: Object1,
object2: Object2
)

Returns Object1 & Object2

Merges two objects and returns a new object that contains properties from both source objects.

softCopyProperties(source: object,
target: object,
keys: Array <string>
)

Returns void

Copies all properties of one object to the other, omitting undefined, but only if property in target object doesn't have a value set.