Skip to content

Commit

Permalink
Add missing stat.isSocket (vercel#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvin authored Mar 2, 2021
1 parent d6f1d7c commit c7deaea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/packer.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export default function ({ records, entrypoint, bytecode }) {
const newStat = Object.assign({}, value);
newStat.isFileValue = value.isFile();
newStat.isDirectoryValue = value.isDirectory();
newStat.isSocketValue = value.isSocket();
const buffer = Buffer.from(JSON.stringify(newStat));
stripes.push({ snap, store, buffer });
} else {
Expand Down
5 changes: 5 additions & 0 deletions prelude/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -929,15 +929,20 @@ function payloadFileSync (pointer) {

var isFileValue = s.isFileValue;
var isDirectoryValue = s.isDirectoryValue;
var isSocketValue = s.isSocketValue;
delete s.isFileValue;
delete s.isDirectoryValue;
delete s.isSocketValue;

s.isFile = function () {
return isFileValue;
};
s.isDirectory = function () {
return isDirectoryValue;
};
s.isSocket = function () {
return isSocketValue;
};
s.isSymbolicLink = function () {
return false;
};
Expand Down

0 comments on commit c7deaea

Please sign in to comment.