cli/copy.js
function copy(args) {
  // TODO: Split arguments with destructure in the future
  const source = splitArg(args.source);
  const sourceApp = source[0];
  const sourcePath = source[1];
  const dest = splitArg(args.dest);
  const destApp = dest[0];
  const destPath = dest[1];

  return login(sourceApp, destApp).then((dbs) => {
    const sourceDB = dbs[0];
    const destDB = dbs[1];

    return normalizeArgs(sourceDB, sourcePath, destDB, destPath).then((paths) => {
      const sourcePath = paths[0];
      const destPath = paths[1];

      return streamFrom(sourceDB, sourcePath).then((args) => {
        const rs = args[0];
        const size = args[1];

        return streamTo(destDB, destPath, rs, size);
      });
    });
  });
}
function copy(args) {
  // TODO: Split arguments with destructure in the future
  const source = splitArg(args.source);
  const sourceApp = source[0];
  const sourcePath = source[1];
  const dest = splitArg(args.dest);
  const destApp = dest[0];
  const destPath = dest[1];

  return login(sourceApp, destApp).then((dbs) => {
    const sourceDB = dbs[0];
    const destDB = dbs[1];

    return normalizeArgs(sourceDB, sourcePath, destDB, destPath).then((paths) => {
      const sourcePath = paths[0];
      const destPath = paths[1];

      return streamFrom(sourceDB, sourcePath).then((args) => {
        const rs = args[0];
        const size = args[1];

        return streamTo(destDB, destPath, rs, size);
      });
    });
  });
}
function copy ( args ) { // TODO: Split arguments with destructure in the future const source = splitArg ( args . source ) ; const sourceApp = source [ 0 ] ; const sourcePath = source [ 1 ] ; const dest = splitArg ( args . dest ) ; const destApp = dest [ 0 ] ; const destPath = dest [ 1 ] ; return login ( sourceApp , destApp ) . then ( ( dbs ) => { const sourceDB = dbs [ 0 ] ; const destDB = dbs [ 1 ] ; return normalizeArgs ( sourceDB , sourcePath , destDB , destPath ) . then ( ( paths ) => { const sourcePath = paths [ 0 ] ; const destPath = paths [ 1 ] ; return streamFrom ( sourceDB , sourcePath ) . then ( ( args ) => { const rs = args [ 0 ] ; const size = args [ 1 ] ; return streamTo ( destDB , destPath , rs , size ) ; } ) ; } ) ; } ) ; }
Copies from arbitrary location to each other.

@param {{ source: string, dest: string }} args
@return {Promise<any>}
Copies from arbitrary location to each other .