<commit_before>Namespacer
==========

A simple utility for creating namespaces.

Usage
-----

Using namespaces is a great way for organizing code. In most other languages,
this is a built-in feature. With JavaScript, it must be done using objects.

Typical namespacing with JavaScript occurs like this:

```js
//Usually this step can be skipped, as the root namespace would be declared
//once in the beginning
if (typeof RootNamespace == 'undefined') {
    RootNamespace = {};
}

//To add a property on a namespace, you have to check for its existence first
if (!RootNamespace.level1) {
    RootNamespace.level1 = {};
}

//You have to repeat this boilerplate for every level of the namespace
if(!RootNamespace.level1.level2) {
    RootNamespace.level1.level2 = {};
}
```

Because of this, use of namespaces tends to be shallow. For most other 

With Namespacer, it becomes simplified:

```js
//use Namespacer.createNamespace() once to declare a root namespace
window.RootNamespace = Namespacer.createNamespace();

//Add or extend namespaces to your heart's content
RootNamespace('mywebapp')('category')('level1')('level2').property = 'blah';
```

```js
//You can also use Namespacer() as a shortcut
window.RootNamespace = Namespacer();

//use this for any type of value you would like,
var MyClass = RootNamespace('mywebapp')('category')('level1')('level2').MyClass = function(){};

MyClass.prototype.myMethod = function () {};
```

Best Practices
--------------

Use the method invocation for adding namespaces, but dot notation can be used
for accessing properties.<commit_msg>Fix README<commit_after>Namespacer
==========

A simple utility for creating namespaces.

Usage
-----

Using namespaces is a great way for organizing code. In most other languages,
this is a built-in feature. With JavaScript, it must be done using objects.

Typical namespacing with JavaScript occurs like this:

```js
//Usually this step can be skipped, as the root namespace would be declared
//once in the beginning
if (typeof RootNamespace == 'undefined') {
    RootNamespace = {};
}

//To add a property on a namespace, you have to check for its existence first
if (!RootNamespace.level1) {
    RootNamespace.level1 = {};
}

//You have to repeat this boilerplate for every level of the namespace
if(!RootNamespace.level1.level2) {
    RootNamespace.level1.level2 = {};
}
```

With Namespacer, it becomes simplified:

```js
//use Namespacer.createNamespace() once to declare a root namespace
window.RootNamespace = Namespacer.createNamespace();

//Add or extend namespaces to your heart's content
RootNamespace('mywebapp')('category')('level1')('level2').property = 'blah';
```

```js
//You can also use Namespacer() as a shortcut
window.RootNamespace = Namespacer();

//use this for any type of value you would like,
var MyClass = RootNamespace('mywebapp')('category')('level1')('level2').MyClass = function(){};

MyClass.prototype.myMethod = function () {};
```

Best Practices
--------------

Use the method invocation for adding namespaces, but dot notation can be used
for accessing properties.
{'fraction_non_alphanumeric': 0.12199870214146658, 'fraction_numerical': 0.006489292667099286, 'mean_word_length': 4.427816901408451, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6551266', 'n_tokens_mistral': 867, 'n_tokens_neox': 831, 'n_words': 347}