MCPcopy
hub / github.com/phaserjs/phaser / Clone

Function Clone

src/utils/object/Clone.js:17–34  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

15 * @return {object} A new object with the same properties as the input object.
16 */
17var Clone = function (obj)
18{
19 var clone = {};
20
21 for (var key in obj)
22 {
23 if (Array.isArray(obj[key]))
24 {
25 clone[key] = obj[key].slice(0);
26 }
27 else
28 {
29 clone[key] = obj[key];
30 }
31 }
32
33 return clone;
34};
35
36module.exports = Clone;

Callers 2

MergeFunction · 0.70
MergeRightFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…