$k. Copier

new Copier()

Helper for copying objects.

Methods

copy(object)

Copies the object and related objects

Parameters:
NameTypeDescription
objectObject

The object to copy

Version
  • Experimental feature, might be removed at any time
Since
  • 5.1.1

registerCopy(original, copy)

Registers a copy of the original. It will be used instead of creating a new copy. Can be used to customize the copied structure.

Parameters:
NameTypeDescription
originalObject

The original object

copyObject

The copy

Version
  • Experimental feature, might be removed at any time
Since
  • 5.3.3

setDeepCopyFilter(checkFunction)

Sets the property filter function

Parameters:
NameTypeDescription
checkFunctionfunction

The function receives an object and should return true if the object should be deep copied.

Version
  • Experimental feature, might be removed at any time
Since
  • 5.0.3

setPostCopyCallback(checkFunction)

Sets the copy callback function function

Parameters:
NameTypeDescription
checkFunctionfunction

The function is called after an object is deep copied. It receives the original object and the copy.

Version
  • Experimental feature, might be removed at any time
Since
  • 5.1.1

setPropertyFilter(filterFunction)

Sets the property filter function

Parameters:
NameTypeDescription
filterFunctionfunction

The function receives a property and should return true if the property should be copied.

Version
  • Experimental feature, might be removed at any time
Since
  • 5.0.3

setPropertyPostCopyCallback(checkFunction)

Sets the property copy callback function function

Parameters:
NameTypeDescription
checkFunctionfunction

The function is called after a property is copied. It receives the original property and the copy.

Version
  • Experimental feature, might be removed at any time
Since
  • 5.1.1