Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
data.mode &= 511;
} else if (data.stats && data.mode === null) {
data.mode = data.stats.mode & 511;
// stat isn't reliable on windows; force 0755 for dir
if (win32 && isDir) {
data.mode = 493;
}
} else if (data.mode === null) {
data.mode = isDir ? 493 : 420;
}
if (data.stats && data.date === null) {
data.date = data.stats.mtime;
} else {
data.date = util.dateify(data.date);
}
return data;
};
} else {
data.mode = data.stats.mode & 4095;
}
// stat isn't reliable on windows; force 0755 for dir
if (win32 && isDir) {
data.mode = 493;
}
} else if (data.mode === null) {
data.mode = isDir ? 493 : 420;
}
if (data.stats && data.date === null) {
data.date = data.stats.mtime;
} else {
data.date = util.dateify(data.date);
}
return data;
};
if (data.name) {
data.name = util.sanitizePath(data.name);
if (!isSymlink && data.name.slice(-1) === '/') {
isDir = true;
data.type = 'directory';
} else if (isDir) {
data.name += '/';
}
}
if (isDir || isSymlink) {
data.store = true;
}
data.date = util.dateify(data.date);
return data;
};
if (data.name) {
data.name = util.sanitizePath(data.name);
if (!isSymlink && data.name.slice(-1) === '/') {
isDir = true;
data.type = 'directory';
} else if (isDir) {
data.name += '/';
}
}
if (isDir || isSymlink) {
data.store = true;
}
data.date = util.dateify(data.date);
return data;
};