src/js/libs/spiritual-gui.js
function(string) {
		var result = String(string);
		switch (result) {
			case "null":
				result = null;
				break;
			case "true":
			case "false":
				result = (result === "true");
				break;
			default:
				if (String(parseInt(result, 10)) === result) {
					result = parseInt(result, 10);
				} else if (String(parseFloat(result)) === result) {
					result = parseFloat(result);
				}
				break;
		}
		return result;
	}
function(string) {
		var result = String(string);
		switch (result) {
			case "null":
				result = null;
				break;
			case "true":
			case "false":
				result = (result === "true");
				break;
			default:
				if (String(parseInt(result, 10)) === result) {
					result = parseInt(result, 10);
				} else if (String(parseFloat(result)) === result) {
					result = parseFloat(result);
				}
				break;
		}
		return result;
	}
function ( string ) { var result = String ( string ) ; switch ( result ) { case "null" : result = null ; break ; case "true" : case "false" : result = ( result === "true" ) ; break ; default : if ( String ( parseInt ( result , 10 ) ) === result ) { result = parseInt ( result , 10 ) ; } else if ( String ( parseFloat ( result ) ) === result ) { result = parseFloat ( result ) ; } break ; } return result ; }
Autocast string to an inferred type. "123" will
return a number, "false" will return a boolean.
@param {String} string
@returns {object}
Autocast string to an inferred type . 123 will return a number false will return a boolean .