UNPKG

extract-base-iterator

Version:

Base iterator for extract iterators like tar-iterator and zip-iterator

10 lines (9 loc) 487 B
import fs from 'fs'; import lstatReal from './lstatReal.js'; export default function symlinkWin32(linkFullPath, linkpath, fullPath, callback) { lstatReal(linkFullPath, (err, targetStat)=>{ // If target doesn't exist, default to 'file' type (Windows requires a type for symlinks) const type = !err && (targetStat === null || targetStat === void 0 ? void 0 : targetStat.isDirectory()) ? 'dir' : 'file'; fs.symlink(linkpath, fullPath, type, callback); }); }