lib/mem-fs-utils.js
function (storeOrEditor, from, to) {
    debug('Performing inMemoryMove from ' + from + ' to ' + to);
    var store = (storeOrEditor && storeOrEditor.store ? storeOrEditor.store : storeOrEditor);
    var memFsEditor = require('mem-fs-editor').create(store);
    var fromLen = from.length;
    store.each(function (file) {
      var idx = file.path.indexOf(from);
      if (idx === 0 && file.contents !== null && file.state !== 'deleted') {
        var absTo = path.join(to, file.path.substr(fromLen));
        // exact match so we are copying a single file and not a folder
        if (fromLen === file.path.length) {
          absTo = path.join(to, path.basename(file.path));
        }
        debug('IN-MEMORY MOVING FROM: ' + file.path + ' TO: ' + absTo);
        memFsEditor.move(file.path, absTo);
      }
    });
  }
function (storeOrEditor, from, to) {
    debug('Performing inMemoryMove from ' + from + ' to ' + to);
    var store = (storeOrEditor && storeOrEditor.store ? storeOrEditor.store : storeOrEditor);
    var memFsEditor = require('mem-fs-editor').create(store);
    var fromLen = from.length;
    store.each(function (file) {
      var idx = file.path.indexOf(from);
      if (idx === 0 && file.contents !== null && file.state !== 'deleted') {
        var absTo = path.join(to, file.path.substr(fromLen));
        // exact match so we are copying a single file and not a folder
        if (fromLen === file.path.length) {
          absTo = path.join(to, path.basename(file.path));
        }
        debug('IN-MEMORY MOVING FROM: ' + file.path + ' TO: ' + absTo);
        memFsEditor.move(file.path, absTo);
      }
    });
  }
function ( storeOrEditor , from , to ) { debug ( 'Performing inMemoryMove from ' + from + ' to ' + to ) ; var store = ( storeOrEditor && storeOrEditor . store ? storeOrEditor . store : storeOrEditor ) ; var memFsEditor = require ( 'mem-fs-editor' ) . create ( store ) ; var fromLen = from . length ; store . each ( function ( file ) { var idx = file . path . indexOf ( from ) ; if ( idx === 0 && file . contents !== null && file . state !== 'deleted' ) { var absTo = path . join ( to , file . path . substr ( fromLen ) ) ; // exact match so we are copying a single file and not a folder if ( fromLen === file . path . length ) { absTo = path . join ( to , path . basename ( file . path ) ) ; } debug ( 'IN-MEMORY MOVING FROM: ' + file . path + ' TO: ' + absTo ) ; memFsEditor . move ( file . path , absTo ) ; } } ) ; }
Given the path for a virtual file or folder and a destination path perform a move
completely within mem-fs.

@param {!Store|!EditionInterface} storeOrEditor
@param {string} from - file path or folder path
@param {string} to - folder path
Given the path for a virtual file or folder and a destination path perform a move completely within mem - fs .