Dynamics provides additional extension methods on any type.

Static methods

staticclone (v:Dynamic, cloneInstances:Bool = false):Dynamic

Clone the object.

Null values, strings, dates, numbers, enums and functions are immutable so will be returned as is. Anonymous objects will be created and each field cloned recursively. Arrays will be recreated and each object cloned recursively. Class instances will either be cloned, or the reference copied, depending on the value of cloneInstances.

Parameters:

v

The object which will be cloned.

cloneInstances

If true, class instances will be cloned using Type.createEmptyInstance and Reflect.setField. If false, class instances will be re-used, not cloned. Default is false.

staticcompare (a:Dynamic, b:Dynamic):Int

Compares two runtime values trying to match values.

staticequals<T1, T2> (a:T1, b:T2):Bool

Structural and recursive equality.

staticstring (v:Dynamic):String

Convert any value into a String.