<commit_before>jsonValidate.js
===============

Simple json validate method.<commit_msg>Make some documentation.<commit_after>jsonValidate.js
===============

Its a simple method to validate Jsons from ajax request.

It recognize json objects, objects with arrays and variables. If we expected a array we should create map with array
with one value element to map.

First example show object map without validate object types.

Example 1.
---
```js
	var categories = {
	//Array
	categories: [
				//Array element object
              {
                id: void 0,
                name: void 0,
                image: void 0
              }
      ],
      //Object variable
      shop: void 0
	}
      $.ajax(_settings.brands, {
              type: "/categories",
              dataType: "json",
              success: function(data, textStatus, jqXHR) {
                if (data.validateJson(categories)) {
                 	alert("Working");
                } else {
                  	alert("Not working");
                }
              }
            }
```

Second example show how to validate json types. In map object, change variables to some real values. Method check
value constructor in json and in map. If they equal then it will pass.

Example 2.
---
```js
	var categories = {
	//Array
	categories: [
				//Array element object
              {
                id: 1,
                name: "",
                image: ""
              }
      ],
      //Object variable
      shop: ""
	}
      $.ajax(_settings.brands, {
              type: "/categories",
              dataType: "json",
              success: function(data, textStatus, jqXHR) {
                if (data.validateJson(categories)) {
                 	alert("Working");
                } else {
                  	alert("Not working");
                }
              }
            }
```
{'fraction_non_alphanumeric': 0.1084272678475577, 'fraction_numerical': 0.003757380568974772, 'mean_word_length': 1.4397905759162304, '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': '2509242', 'n_tokens_mistral': 491, 'n_tokens_neox': 453, 'n_words': 156}