<commit_before>
// TODO: vanillify ajax requests
// TODO: vanillify event handlers
// TODO: vanillify animations
// TODO: vanillify queries
// TODO: add standard animations like fade and slide


/**
 * The application namespace.
 * @module MOD
 */
var MOD = {};

/**
 * ## The Application Framework Core
 * This layer is the actual core of the framework. It contains all utitity functions such as dom functions, and assistive functions such as array checks, mapping, and any other functions that are used to assist in faster development of JS. It is the only layer that can communicate with the Base layer, and it is only accessed by the Sandbox layer.
 *
 * - This layer is responsible for communication with the Base layer
 * - All business logic is executed here
 * - Returns an object with the necessary functions for handling modules
 *
 *
 * ##### No core method should ever be called from a module, core methods should only be called from the MOD.app object for initialization and the MOD.sandbox object for business logic
 *
 *
 * @class core
 * @namespace  MOD
 * @static
 */
MOD.core = (function () {

	// module_data will be our storage for all information pertaining to our modules
	var module_data = {},
		root = this;

	/**
	 * The MOD.core.util object handles all logic operations and helps with application-wide common tasks, this would be mapping arrays, making ajax requests, etc... These functions should only be accessed by the sandbox, **never in the module!!**
	 * @class util
	 * @namespace MOD.core
	 */
	this.util = {

		debug : true,

		/**
		 * this function handles all custom logging, supports debug mode which logs to console, or non-debug which allows you to send logs to the server
		 *
		 * 	MOD.core.util.log( 1, 'LOG : ERROR: "There was an error"' );
		 *
		 *
		 * @param  {int} severity the level of severity
		 * @param  {string} message  the message to log
		 * @return {none}
		 * @method  log
		 * @private
		 */
		log : function ( severity, message ) {

			if ( this.debug ) {

				console[ ( severity === 1 ) ? 'log' : ( severity === 2 ) ? 'warn' : 'error' ]( message );
			} else {

				// add code for sending errors to server...need to discuss how to implement
			}
		},

		/**
		 * Converts anything to a string
		 *
		 * 	MOD.core.util.to_sting( some_unknown_value );
		 *
		 *
		 * @param  {anything} anything can literally pass in anything
		 * @return {string}          string version of passed in parameter
		 * @method  to_string
		 * @private
		 */
		to_string : function ( anything ) {
			return anything.toString();
		},

		/**
		 * Trim starting and trailing whitespace from an object
		 *
		 * 	var str = "   This is a messy string.   ";
		 *
		 * 	str = MOD.core.util.trim( str );
		 *
		 * 	// Returns: "This is a messy string."
		 *
		 *
		 * @param  {String} str the string to trim whitespace from
		 * @return {String} cleaned up string
		 * @method  trim
		 * @private
		 */
		trim: function ( str ) {
			return str.replace( /^\s+/, '' ).replace( /\s+$/, '' );
		},

		/**
		 * Converts dash-seperated words to camelCase, see what I did there =]
		 *
		 * 	var str = 'some-string';
		 *
		 * 	str = PIX.core.util.to_camel_case( str );
		 *
		 * 	console.log( str ); // would output 'someString'
		 *
		 *
		 * @param  {String} str the string to camel case
		 * @param  {String} splitter either space or dash
		 * @return {String} camel cased string
		 * @method  to_camel_case
		 * @private
		 */
		to_camel_case: function( str, splitter ) {
			var regex;

			switch ( splitter ) {
				case ' ':
					splitter = '\\s';
				break;
				default:
					splitter = '-';
				break;
			}

			regex = new RegExp( splitter + '([a-z])', 'gi' );

			return str.replace( regex, function( all, letter ) {

				return letter.toUpperCase();
			});
		},

		/**
		 * Checks for the type of whatever is passed in, if it is an object returns true
		 *
		 * 	MOD.core.util.is_object( obj );
		 *
		 *
		 * @param  {unknown}  anything the var to check for type of object
		 * @return {Boolean}          true if object, else false
		 * @method  is_object
		 * @private
		 */
		is_object : function ( anything ) {
			return ( typeof anything === 'object' && ( Object.prototype.toString.call( anything ) === '[object Object]' ) ) ? true : false;
		},

		/**
		 * Checks for the type of whatever is passed in, if it is an array returns true
		 *
		 * 	MOD.core.util.is_array( arr );
		 *
		 *
		 * @param  {unknown}  anything the var to check for type of array
		 * @return {Boolean}          true if array, else false
		 * @method  is_array
		 * @private
		 */
		is_array : function ( anything ) {
			return ( typeof anything === 'object' && ( Object.prototype.toString.call( anything ) === '[object Array]' ) ) ? true : false;
		},

		/**
		 * Checks an array for a given value
		 *
		 * 	if ( PIX.core.util.array_contains( arr, 'some value' ) ) {
		 * 		// do something with value
		 * 	}
		 *
		 *
		 * @param  {array} arr   the array to search through
		 * @param  {anything} value the value to look for
		 * @return {boolean}       true if array contains value, else false
		 * @method  array_contains
		 * @private
		 */<commit_msg>minor fixes to docs<commit_after>
// TODO: vanillify ajax requests
// TODO: vanillify event handlers
// TODO: vanillify animations
// TODO: vanillify queries
// TODO: add standard animations like fade and slide


/**
 * The application namespace.
 * @module MOD
 */
var MOD = {};

/**
 * ## The Application Framework Core
 * This layer is the actual core of the framework. It contains all utitity functions such as dom functions, and assistive functions such as array checks, mapping, and any other functions that are used to assist in faster development of JS. It is the only layer that can communicate with the Base layer, and it is only accessed by the Sandbox layer.
 *
 * - This layer is responsible for communication with the Base layer
 * - All business logic is executed here
 * - Returns an object with the necessary functions for handling modules
 *
 *
 * ##### No core method should ever be called from a module, core methods should only be called from the MOD.app object for initialization and the MOD.sandbox object for business logic
 *
 *
 * @class core
 * @namespace  MOD
 * @static
 */
MOD.core = (function () {

	// module_data will be our storage for all information pertaining to our modules
	var module_data = {},
		root = this;

	/**
	 * The MOD.core.util object handles all logic operations and helps with application-wide common tasks, this would be mapping arrays, making ajax requests, etc... These functions should only be accessed by the sandbox, **never in the module!!**
	 * @class util
	 * @namespace MOD.core
	 */
	this.util = {

		debug : true,

		/**
		 * this function handles all custom logging, supports debug mode which logs to console, or non-debug which allows you to send logs to the server
		 *
		 * 	MOD.core.util.log( 1, 'LOG : ERROR: "There was an error"' );
		 *
		 *
		 * @param  {int} severity the level of severity
		 * @param  {string} message  the message to log
		 * @return {none}
		 * @method  log
		 * @private
		 */
		log : function ( severity, message ) {

			if ( this.debug ) {

				console[ ( severity === 1 ) ? 'log' : ( severity === 2 ) ? 'warn' : 'error' ]( message );
			} else {

				// add code for sending errors to server...need to discuss how to implement
			}
		},

		/**
		 * Converts anything to a string
		 *
		 * 	MOD.core.util.to_sting( some_unknown_value );
		 *
		 *
		 * @param  {anything} anything can literally pass in anything
		 * @return {string}          string version of passed in parameter
		 * @method  to_string
		 * @private
		 */
		to_string : function ( anything ) {
			return anything.toString();
		},

		/**
		 * Trim starting and trailing whitespace from an object
		 *
		 * 	var str = "   This is a messy string.   ";
		 *
		 * 	str = MOD.core.util.trim( str );
		 *
		 * 	// Returns: "This is a messy string."
		 *
		 *
		 * @param  {String} str the string to trim whitespace from
		 * @return {String} cleaned up string
		 * @method  trim
		 * @private
		 */
		trim: function ( str ) {
			return str.replace( /^\s+/, '' ).replace( /\s+$/, '' );
		},

		/**
		 * Converts dash-seperated words to camelCase, see what I did there =]
		 *
		 * 	var str = 'some-string';
		 *
		 * 	str = MOD.core.util.to_camel_case( str );
		 *
		 * 	console.log( str ); // would output 'someString'
		 *
		 *
		 * @param  {String} str the string to camel case
		 * @param  {String} splitter either space or dash
		 * @return {String} camel cased string
		 * @method  to_camel_case
		 * @private
		 */
		to_camel_case: function( str, splitter ) {
			var regex;

			switch ( splitter ) {
				case ' ':
					splitter = '\\s';
				break;
				default:
					splitter = '-';
				break;
			}

			regex = new RegExp( splitter + '([a-z])', 'gi' );

			return str.replace( regex, function( all, letter ) {

				return letter.toUpperCase();
			});
		},

		/**
		 * Checks for the type of whatever is passed in, if it is an object returns true
		 *
		 * 	MOD.core.util.is_object( obj );
		 *
		 *
		 * @param  {unknown}  anything the var to check for type of object
		 * @return {Boolean}          true if object, else false
		 * @method  is_object
		 * @private
		 */
		is_object : function ( anything ) {
			return ( typeof anything === 'object' && ( Object.prototype.toString.call( anything ) === '[object Object]' ) ) ? true : false;
		},

		/**
		 * Checks for the type of whatever is passed in, if it is an array returns true
		 *
		 * 	MOD.core.util.is_array( arr );
		 *
		 *
		 * @param  {unknown}  anything the var to check for type of array
		 * @return {Boolean}          true if array, else false
		 * @method  is_array
		 * @private
		 */
		is_array : function ( anything ) {
			return ( typeof anything === 'object' && ( Object.prototype.toString.call( anything ) === '[object Array]' ) ) ? true : false;
		},

		/**
		 * Checks an array for a given value
		 *
		 * 	if ( MOD.core.util.array_contains( arr, 'some value' ) ) {
		 * 		// do something with value
		 * 	}
		 *
		 *
		 * @param  {array} arr   the array to search through
		 * @param  {anything} value the value to look for
		 * @return {boolean}       true if array contains value, else false
		 * @method  array_contains
		 * @private
		 */
{'fraction_non_alphanumeric': 0.11486486486486487, 'fraction_numerical': 0.0005791505791505791, 'mean_word_length': 2.5925797503467405, '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': '3159707', 'n_tokens_mistral': 3535, 'n_tokens_neox': 2943, 'n_words': 1193}