<commit_before>/*
 * Angular.js localStorage module
 * https://github.com/agrublev/angularLocalStorage
 */

(function (window, angular, undefined) {
	'use strict';

	angular.module('angularLocalStorage', ['ngCookies']).factory('storage', ['$parse', '$cookieStore', '$window', '$log', function ($parse, $cookieStore, $window, $log) {
		/**
		 * Global Vars
		 */
		var storage = (typeof $window.localStorage === 'undefined') ? undefined : $window.localStorage;
		var supported = typeof storage !== 'undefined';

		var privateMethods = {
			/**
			 * Pass any type of a string from the localStorage to be parsed so it returns a usable version (like an Object)
			 * @param res - a string that will be parsed for type
			 * @returns {*} - whatever the real type of stored value was
			 */
			parseValue: function (res) {
				var val;
				try {
					val = angular.fromJson(res);
					if (typeof val === 'undefined') {
						val = res;
					}
					if (val === 'true') {<commit_msg>fixed checks in iOS for support of localStorage and improved the support in general<commit_after>/*
 * Angular.js localStorage module
 * https://github.com/agrublev/angularLocalStorage
 */

(function (window, angular, undefined) {
	'use strict';

	angular.module('angularLocalStorage', ['ngCookies']).factory('storage', ['$parse', '$cookieStore', '$window', '$log', function ($parse, $cookieStore, $window, $log) {
		/**
		 * Global Vars
		 */
		var storage = (typeof $window.localStorage === 'undefined') ? undefined : $window.localStorage;
		var supported = !(typeof storage === 'undefined');

		if (supported) {
			// When Safari (OS X or iOS) is in private browsing mode it appears as though localStorage
			// is available, but trying to call .setItem throws an exception below:
			// "QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota."
			var testKey = '__' + Math.round(Math.random() * 1e7);

			try {
				localStorage.setItem(testKey, testKey);
				localStorage.removeItem(testKey);
			}
			catch (err) {
				supported = false;
			}
		}

		var privateMethods = {
			/**
			 * Pass any type of a string from the localStorage to be parsed so it returns a usable version (like an Object)
			 * @param res - a string that will be parsed for type
			 * @returns {*} - whatever the real type of stored value was
			 */
			parseValue: function (res) {
				var val;
				try {
					val = angular.fromJson(res);
					if (typeof val === 'undefined') {
						val = res;
					}
					if (val === 'true') {
{'fraction_non_alphanumeric': 0.13406940063091483, 'fraction_numerical': 0.0015772870662460567, 'mean_word_length': 3.314625850340136, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1045589', 'n_tokens_mistral': 866, 'n_tokens_neox': 719, 'n_words': 261}