 
 # Attempt to parse `value` as a JSON object if it's not `null`; otherwise just
 # return `value`.
-tryParse = (value) ->
-  if value? then JSON.parse value else value
+tryParse = (value) -> if value? then JSON.parse value else value
 
 # Attempt to stringify `value` in to a JSON string if it's not `null`;
 # otherwise just return `value`.
-tryStringify = (value) ->
-  if value? then JSON.stringify value else value
+tryStringify = (value) -> if value? then JSON.stringify value else value
 
 # Store setup
 # -----------

    encodeURIComponent JSON.stringify data

  # Clear all keys from `localStorage`.
  clear: ->
    delete localStorage[key] for own key of localStorage

  # Determine whether or not the specified `keys` exist in `localStorage`.
  exists: (keys...) ->


  # Search `localStorage` for all keys that match the specified regular
  # expression.
  search: (regex) -> key for own key of localStorage when regex.test key

  # Set the value of the specified key(s) in `localStorage`.  
  # `keys` can either be a string for a single key (in which case `value`
  # should also be specified) or a map of key/value pairs.  
  # If the specified value is `undefined`, assign that value directly to the
  # key; otherwise transform it to a JSON string beforehand.
  set: (keys, value) -> switch typeof keys
    when 'object' then @set key, value for own key, value of keys
    when 'string'
      oldValue = @get keys
      localStorage[keys] = tryStringify value
      oldValue

# Public classes
# --------------
