   # @param [Object] value
   set: (key, value, def=undefined) ->
     throw 'key missing' unless key?
-    @storage["#{Persist.PREFIX}#{key}"] = value
+    @storage["#{Persist.PREFIX}.#{key}"] = value
     @default(key, def) if def?
 
   # set the default value for a key

#   persist.default('hello', 'world')
#   persist.get('hello') # returns world
class Persist
  @PREFIX = 'ce.'
  @DEFAULT_SUFFIX = '.default'

  # chooses storage type. By default, it uses localStorage
  #

  # @param [String] key
  get: (key) ->
    value = @_get(key)
    if !value? then @_get("#{key}.#{Persist.DEFAULT_SUFFIX}") else value

  # Get a value in the storage
  _get: (key) ->
    throw 'key missing' unless key?
    value = @storage["#{Persist.PREFIX}.#{key}"]
    return Number(value) if isNumeric(value)
    return Boolean(value) if ['true', 'false'].includes(value)
    return undefined if value == 'undefined'
