new $k.Copier()
Helper for copying objects.
Methods
copy(object)
Copies the object and related objects
Name | Type | Description |
---|---|---|
object |
Object |
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.
Name | Type | Description |
---|---|---|
original |
Object |
The original object |
copy |
Object |
The copy |
- Version:
- Experimental feature, might be removed at any time
- Since:
- 5.3.3
setDeepCopyFilter(checkFunction)
Sets the property filter function
Name | Type | Description |
---|---|---|
checkFunction |
function |
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
Name | Type | Description |
---|---|---|
checkFunction |
function |
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
Name | Type | Description |
---|---|---|
filterFunction |
function |
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
Name | Type | Description |
---|---|---|
checkFunction |
function |
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