lib/index.js
function set(key, val, cb) {
  return type(key) != 'object'
    ? localForage.setItem(key, val).then(wrap(cb), cb)
    : Promise.all(Object.keys(key).map(setSubkey)).then(wrap(val), val);

  function setSubkey(subkey, next) {
    return key[subkey] === null
      ? del(subkey, next)
      : set(subkey, key[subkey], next);
  }
}
function set(key, val, cb) {
  return type(key) != 'object'
    ? localForage.setItem(key, val).then(wrap(cb), cb)
    : Promise.all(Object.keys(key).map(setSubkey)).then(wrap(val), val);

  function setSubkey(subkey, next) {
    return key[subkey] === null
      ? del(subkey, next)
      : set(subkey, key[subkey], next);
  }
}
function set ( key , val , cb ) { return type ( key ) != 'object' ? localForage . setItem ( key , val ) . then ( wrap ( cb ) , cb ) : Promise . all ( Object . keys ( key ) . map ( setSubkey ) ) . then ( wrap ( val ) , val ) ; function setSubkey ( subkey , next ) { return key [ subkey ] === null ? del ( subkey , next ) : set ( subkey , key [ subkey ] , next ) ; } }
Set `val` to `key`.

@param {Array|Mixed} key
@param {Mixed} val
@param {Function} cb
Set val to key .