 # For all details and documentation:  
 # <http://neocotic.com/template>
 
-#### Private variables
+# Private variables
+# -----------------
 
 # Mapping for internationalization handlers.  
 # Each handler represents an attribute (based on the property name) and is


  # Copy the value of the existing key to that of the new key then remove the
  # old key from `localStorage`.  
  # If the old key doesn't exist in `localStorage`, assign the specified default
  # value to it instead.
  rename: (oldKey, newKey, defaultValue) ->
    if utils.exists oldKey
      utils.init newKey, utils.get oldKey

      break
  return subs

# Utilities setup
# ---------------

utils = window.utils =

  # Data functions
  # --------------

  # Determine whether or not the specified key exists in `localStorage`.
  exists: (key) ->
    return localStorage.hasOwnProperty key

  # Retrieve the value associated with the specified key from `localStorage`.  
  # If the value is found, parse it as JSON before being returning it;
  # otherwise return `undefined`.
  get: (key) ->
    value = localStorage[key]
    return if value? then JSON.parse value else value
