docs: function _handleConvert(stat, dest, source, callback) {
    // "dest" arg is optional
    if (typeof source === 'function') {
      callback = source;
      source = dest;
      dest = null;
    }
  
    // assert input params
    assert.ok(
      dest === null || typeof dest === 'string',
      'Invalid type of argument "dest", expected "null" or "string", ' +
      'but is "' + (typeof dest) + '"'
    );
    assert.equal(
      typeof(callback),
      'function',
      'Invalid type of argument "callback", expected "function", ' +
      'but is "' + (typeof callback) + '"'
    );
  
    // perform an action according to "source" and "dest"
    switch(typeof source) {
      case 'string':
        // source is a path
        if (_isJsonPath(source)) {
          // source is meant to be a json file
          if (typeof dest === 'string') {
            // destination is meant to be a directory
            return _load2write(dest, source, callback);
          }
          // destination is meant to be a local object
          return _load(source, callback);
        }
        // source is meant to be a directory
        if (typeof dest === 'string') {
          // destination is meant to be a json file
          return _read2store(stat, dest, source, callback);
        }
        // destination is meant to be a local object
        return _read(stat, source, callback);
      case 'object':
        // source is an object
        if (_isJsonPath(dest)) {
          // destination is meant to be a json file
          return _store(dest, source, callback);
        }
        // destination is meant to be a directory
        return _write(dest, source, callback);
      default:
        // invalid source
        assert.ok(
          false,
          'Invalid type of argument "source", expected "string" or "object", ' +
          'but is "' + (typeof source) + '"'
        );
    }
  }