<commit_before># UltraDeepClone (or UDC)

The last deep-clone implementation you will *ever* need!

Features:

* Clones (almost) everything: *functions*, *objects*, *arrays*, *primitives* (*numbers*, *strings*, *booleans*), *regexp*, *dates* and even *null* and *undefined*!

* Handles cycles - objects that contain references to themselves or a parent object.

## Installation

### Node.js

For *Node.js*, use `npm`:

````console
npm install UltraDeepClone
````

..then `require` UltraDeepClone:

````javascript
var UltraDeepClone = require('UltraDeepClone');
````

### In the browser, traditional

For the *browser*, add the following to your pages:

````html
<script src="UltraDeepClone/index.js"></script>
````

And the global function `UltraDeepClone` will be available.

### In the browser, using AMD (require.js)

...Or using AMD in the browser:

````javascript
require(["UltraDeepClone"], function(UltraDeepClone) {
	// ...
});
````

## Usage

````javascript
var newObject = UltraDeepClone(oldObject); 
````

## Caveats

This will not clone *constructed* objects properly. Objects built using a constructor function will be cloned as well as possible but the values passed into the <commit_msg>clarified caveat<commit_after># UltraDeepClone (or UDC)

The last deep-clone implementation you will *ever* need!

Features:

* Clones (almost\*) everything: *functions*, *objects*, *arrays*, *regexp*, *dates*, *numbers*, *strings*, *booleans*, and even *null* and *undefined*!

* Handles cycles - objects that contain references to themselves or a parent object.

## Installation

### Node.js

For *Node.js*, use `npm`:

````console
npm install UltraDeepClone
````

..then `require` UltraDeepClone:

````javascript
var UltraDeepClone = require('UltraDeepClone');
````

### In the browser, traditional

For the *browser*, add the following to your pages:

````html
<script src="UltraDeepClone/index.js"></script>
````

And the global function `UltraDeepClone` will be available.

### In the browser, using AMD (require.js)

...Or using AMD in the browser:

````javascript
require(["UltraDeepClone"], function(UltraDeepClone) {
	// ...
});
````

## Usage

````javascript
var newObject = UltraDeepClone(oldObject); 
````

## \*Note

This will **not** clone *constructed* objects properly. An object built with a constructor function can have hidden state (within the closure) that simply can not be recovered. Also since the value of the arguments passed to the constructor can not be recovered, we can't reconstruct a similar object.

Therefore, objects built using a constructor function will be cloned as well as possible and will have the same properties but they will probably **not** work correctly!
{'fraction_non_alphanumeric': 0.13493530499075784, 'fraction_numerical': 0.0, 'mean_word_length': 5.122171945701357, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '455395', 'n_tokens_mistral': 815, 'n_tokens_neox': 770, 'n_words': 309}