<commit_before>#*****************************************
# JSUserDefaults - User Default Class
# Coded by kouichi.sakazaki 2013.07.24
#*****************************************

class JSUserDefaults extends JSObject
	constructor:->
		super()

	setObject:(value, forKey)->
		$.post "syslibs/library.php",
			"mode": "setUserDefaults"
			"forKey": forKey
			"value": JSON.stringify(value)

	stringForKey:(forKey, action)->
		$.post "syslibs/library.php",
			"mode": "getUserDefaults"
			"forKey": forKey
		, (data)=>
			if (typeof(data) == "object")
				data2 = JSON.parse(data)
			else
				data2 = data
			action(data2)

	removeObjectForKey:(forKey)->
		$.post "syslibs/library.php",
			"mode": "removeUserDefaults"
			"forKey": forKey<commit_msg>getUserDefaults bug fix<commit_after>#*****************************************
# JSUserDefaults - User Default Class
# Coded by kouichi.sakazaki 2013.07.24
#*****************************************

class JSUserDefaults extends JSObject
	constructor:->
		super()

	setObject:(value, forKey)->
		$.post "syslibs/library.php",
			"mode": "setUserDefaults"
			"forKey": forKey
			"value": JSON.stringify(value)

	stringForKey:(forKey, action)->
		$.post "syslibs/library.php",
			"mode": "getUserDefaults"
			"forKey": forKey
		, (data)=>
			data2 = JSON.parse(data)
			action(data2)

	removeObjectForKey:(forKey)->
		$.post "syslibs/library.php",
			"mode": "removeUserDefaults"
			"forKey": forKey
{'fraction_non_alphanumeric': 0.2512110726643599, 'fraction_numerical': 0.01453287197231834, 'mean_word_length': 4.830645161290323, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 13, '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': '1856395', 'n_tokens_mistral': 563, 'n_tokens_neox': 467, 'n_words': 95}