Object

Type module

Sources

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

/**
 * --------------------------------------------------------
 * Import via main package: core.ts
 * Access items like: am5.object.myVariable
 *                    am5.object.myFunction()
 * --------------------------------------------------------
 */
import * as am5 from "@amcharts/amcharts5";

/**
 * --------------------------------------------------------
 * Import via: Object.ts
 * Access items like: $object.myVariable
 *                    $object.myFunction()
 * --------------------------------------------------------
 */
import * as $object from "@amcharts/amcharts5/Object";

/**
 * --------------------------------------------------------
 * Include via "index.js"
 * E.g.: "https://cdn.amcharts.com/lib/5/index.js"
 * Access items like: am5.object.myVariable
 *                    am5.object.myFunction()
 * --------------------------------------------------------
 */

Variables

Object does not have any variables.

Functions

copy(

array: ArrayLike

)

#

Returns Array

Returns a copy of the Date object.

each(

array: ArrayLike,
fn: ( value: A, index: number) => void

)

#

Returns void

Iterates through all items in array and calls fn function for each of them.

eachContinue(

array: ArrayLike,
fn: ( value: A, index: number) => boolean

)

#

Returns void

Iterates through all properties of the object calling fn for each of them.

If return value of the function evaluates to false further iteration is cancelled.

eachOrdered(

object: Object,
fn: ( key: Key, value: Object[""]) => void,
ord: ( a: Keyof, b: Keyof) => number

)

#

Returns void

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

hasKey(

object: Object,
key: Key

)

#

Returns boolean

Checks if object has a specific key.

keys(

object: O

)

#

Returns Array

keysOrdered(

object: Object,
order: ( a: Keyof, b: Keyof) => number

)

#

Returns Array

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

softCopyProperties(

source: Object,
target: Object

)

#

Returns Object

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

@todo Maybe consolidate with utils.copy?