<commit_before>query-string-handler
====================

This turns the query string into a private object. Use the API to read and manipulate the query string.

API
---

### .update()

```js
// only call this if an outside script updates the query string
queryStringHandler.update();
```

### .getValue(name)
@param *name* {String}  
@return {String}  

```js
// get a value from the query string
var val = queryStringHandler.getValue('name');
```

### .toString([encoded[, params]])
@param *encoded* {Boolean}  
@param *params* {Object}  
@return {String}  

```js
// get the query string in string format
// optionally encode the ampersands with the first parameter
// optionally temporary extend the query string with the second parameter
// if all parameters are blank, it will return location.pathname
var url = queryStringHandler.toString(true, { beep: 'bop' });
console.log(url); // '?beep=bop'
```

### .push(changes[, title])
@param *changes* {Object}  
@param *title* {String}  

```js
// push a new state with changes to the query string<commit_msg>add readme<commit_after>query-string-handler
====================

This turns the query string into a private object. Use the API to read and manipulate the query string.

API
---

### .update()

```js
// only call this if an outside script updates the query string
queryStringHandler.update();
```

### .setDefaults(obj)
@param *obj* {Object}  

```js
// When values equal the default value, they are ignored in the "toString"
queryStringHandler.setDefaults({ name: '<NAME>' });
```

### .setTypes(obj)
@param *obj* {Object}  

```js
// Setting the type converts the query string value to that type
queryStringHandler.setTypes({ num: 'float' });
```

### .getValue(name)
@param *name* {String}  
@return {String}  

```js
// get a value from the query string
var val = queryStringHandler.getValue('name');
```

### .toString([encoded[, params]])
@param *encoded* {Boolean}  
@param *params* {Object}  
@return {String}  

```js
// get the query string in string format
// optionally encode the ampersands with the first parameter
// optionally temporary extend the query string with the second parameter
// if all parameters are blank, it will return location.pathname
var url = queryStringHandler.toString(true, { beep: 'bop' });
console.log(url); // '?beep=bop'
```

### .push(changes[, title])
@param *changes* {Object}  
@param *title* {String}  

```js
// push a new state with changes to the query string
{'fraction_non_alphanumeric': 0.1556813586736757, 'fraction_numerical': 0.0, 'mean_word_length': 4.34341252699784, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '5115908', 'n_tokens_mistral': 746, 'n_tokens_neox': 714, 'n_words': 285}