async function writeFileMapperNode(input, node, filepath) {
  filepath = convertToLocalFileSystemPath(path.resolve(filepath));
  if (await skipExisting(input, filepath)) {
    return;
  }
  if (!node.folder) {
    try {
      await fetchAndWriteFileStream(input, node.path, filepath);
      return;
    } catch (err) {
      return false;
    }
  }
  try {
    await fs.ensureDir(filepath);
    logger.log('Wrote folder "%s"', filepath);
  } catch (err) {
    logFileSystemErrorInstance(
      err,
      new FileSystemErrorContext({
        filepath,
        accountId: input.accountId,
        write: true,
      })
    );
    return false;
  }
}
/**
 * Writes an individual file or folder (not recursive).  If file source is missing, the
 * file is fetched.
 *
 * @private
 * @async
 * @param {FileMapperInputArguments} input
 * @param {FileMapperNode}           node
 * @param {string}                   filepath
 * @returns {Promise}
 */
Writes an individual file or folder (not recursive).  If file source is missing, the
file is fetched.


Writes an individual file or folder ( not recursive ) . If file source is missing the file is fetched .
async function writeFileMapperNode(input, node, filepath) {
  filepath = convertToLocalFileSystemPath(path.resolve(filepath));
  if (await skipExisting(input, filepath)) {
    return;
  }
  if (!node.folder) {
    try {
      await fetchAndWriteFileStream(input, node.path, filepath);
      return;
    } catch (err) {
      return false;
    }
  }
  try {
    await fs.ensureDir(filepath);
    logger.log('Wrote folder "%s"', filepath);
  } catch (err) {
    logFileSystemErrorInstance(
      err,
      new FileSystemErrorContext({
        filepath,
        accountId: input.accountId,
        write: true,
      })
    );
    return false;
  }
}
async function writeFileMapperNode ( input , node , filepath ) { filepath = convertToLocalFileSystemPath ( path . resolve ( filepath ) ) ; if ( await skipExisting ( input , filepath ) ) { return ; } if ( ! node . folder ) { try { await fetchAndWriteFileStream ( input , node . path , filepath ) ; return ; } catch ( err ) { return false ; } } try { await fs . ensureDir ( filepath ) ; logger . log ( 'Wrote folder "%s"' , filepath ) ; } catch ( err ) { logFileSystemErrorInstance ( err , new FileSystemErrorContext ( { filepath , accountId : input . accountId , write : true , } ) ) ; return false ; } }
Writes an individual file or folder (not recursive).
Writes an individual file or folder ( not recursive ) .