Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! fix lint issues
  • Loading branch information
sapphi-red committed Oct 12, 2023
commit b7d65504423c110d3fb7b07f8b35cb83d0a89ea6
78 changes: 39 additions & 39 deletions lib/internal/fs/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ async function readFileHandle(filehandle, options) {
const statFields = await PromisePrototypeThen(
binding.fstat(filehandle.fd, false, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);

checkAborted(signal);
Expand Down Expand Up @@ -542,7 +542,7 @@ async function readFileHandle(filehandle, options) {
const bytesRead = (await PromisePrototypeThen(
binding.read(filehandle.fd, buffer, offset, length, -1, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
)) ?? 0;
totalRead += bytesRead;

Expand Down Expand Up @@ -594,7 +594,7 @@ async function access(path, mode = F_OK) {
return await PromisePrototypeThen(
binding.access(pathModule.toNamespacedPath(path), mode, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -615,7 +615,7 @@ async function copyFile(src, dest, mode) {
mode,
kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -627,9 +627,9 @@ async function open(path, flags, mode) {
mode = parseFileMode(mode, 'mode', 0o666);
return new FileHandle(await PromisePrototypeThen(
binding.openFileHandle(pathModule.toNamespacedPath(path),
flagsNumber, mode, kUsePromises),
flagsNumber, mode, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
));
}

Expand Down Expand Up @@ -686,7 +686,7 @@ async function read(handle, bufferOrParams, offset, length, position) {
const bytesRead = (await PromisePrototypeThen(
binding.read(handle.fd, buffer, offset, length, position, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
)) || 0;

return { __proto__: null, bytesRead, buffer };
Expand All @@ -701,7 +701,7 @@ async function readv(handle, buffers, position) {
const bytesRead = (await PromisePrototypeThen(
binding.readBuffers(handle.fd, buffers, position, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
)) || 0;
return { __proto__: null, bytesRead, buffers };
}
Expand Down Expand Up @@ -735,7 +735,7 @@ async function write(handle, buffer, offsetOrOptions, length, position) {
binding.writeBuffer(handle.fd, buffer, offset,
length, position, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
)) || 0;
return { __proto__: null, bytesWritten, buffer };
}
Expand All @@ -745,7 +745,7 @@ async function write(handle, buffer, offsetOrOptions, length, position) {
const bytesWritten = (await PromisePrototypeThen(
binding.writeString(handle.fd, buffer, offset, length, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
)) || 0;
return { __proto__: null, bytesWritten, buffer };
}
Expand All @@ -763,7 +763,7 @@ async function writev(handle, buffers, position) {
const bytesWritten = (await PromisePrototypeThen(
binding.writeBuffers(handle.fd, buffers, position, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
)) || 0;
return { __proto__: null, bytesWritten, buffers };
}
Expand All @@ -776,7 +776,7 @@ async function rename(oldPath, newPath) {
pathModule.toNamespacedPath(newPath),
kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -791,7 +791,7 @@ async function ftruncate(handle, len = 0) {
return await PromisePrototypeThen(
binding.ftruncate(handle.fd, len, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -816,23 +816,23 @@ async function rmdir(path, options) {
return await PromisePrototypeThen(
binding.rmdir(path, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

async function fdatasync(handle) {
return await PromisePrototypeThen(
binding.fdatasync(handle.fd, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

async function fsync(handle) {
return await PromisePrototypeThen(
binding.fsync(handle.fd, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -852,7 +852,7 @@ async function mkdir(path, options) {
parseFileMode(mode, 'mode', 0o777), recursive,
kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -869,7 +869,7 @@ async function readdirRecursive(originalPath, options) {
kUsePromises,
),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
),
],
];
Expand All @@ -893,7 +893,7 @@ async function readdirRecursive(originalPath, options) {
kUsePromises,
),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
),
]);
}
Expand All @@ -920,7 +920,7 @@ async function readdirRecursive(originalPath, options) {
kUsePromises,
),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
),
]);
}
Expand All @@ -945,7 +945,7 @@ async function readdir(path, options) {
kUsePromises,
),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
return options.withFileTypes ?
getDirectoryEntriesPromise(path, result) :
Expand All @@ -959,7 +959,7 @@ async function readlink(path, options) {
binding.readlink(pathModule.toNamespacedPath(path),
options.encoding, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -982,15 +982,15 @@ async function symlink(target, path, type_) {
stringToSymlinkType(type),
kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

async function fstat(handle, options = { bigint: false }) {
const result = await PromisePrototypeThen(
binding.fstat(handle.fd, options.bigint, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
return getStatsFromBinding(result);
}
Expand All @@ -1001,7 +1001,7 @@ async function lstat(path, options = { bigint: false }) {
binding.lstat(pathModule.toNamespacedPath(path),
options.bigint, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
return getStatsFromBinding(result);
}
Expand All @@ -1012,7 +1012,7 @@ async function stat(path, options = { bigint: false }) {
binding.stat(pathModule.toNamespacedPath(path),
options.bigint, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
return getStatsFromBinding(result);
}
Expand All @@ -1023,7 +1023,7 @@ async function statfs(path, options = { bigint: false }) {
binding.statfs(pathModule.toNamespacedPath(path),
options.bigint, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
return getStatFsFromBinding(result);
}
Expand All @@ -1036,7 +1036,7 @@ async function link(existingPath, newPath) {
pathModule.toNamespacedPath(newPath),
kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -1045,7 +1045,7 @@ async function unlink(path) {
return await PromisePrototypeThen(
binding.unlink(pathModule.toNamespacedPath(path), kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -1054,7 +1054,7 @@ async function fchmod(handle, mode) {
return await PromisePrototypeThen(
binding.fchmod(handle.fd, mode, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -1064,7 +1064,7 @@ async function chmod(path, mode) {
return await PromisePrototypeThen(
binding.chmod(pathModule.toNamespacedPath(path), mode, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -1083,7 +1083,7 @@ async function lchown(path, uid, gid) {
return await PromisePrototypeThen(
binding.lchown(pathModule.toNamespacedPath(path), uid, gid, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -1093,7 +1093,7 @@ async function fchown(handle, uid, gid) {
return await PromisePrototypeThen(
binding.fchown(handle.fd, uid, gid, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -1104,7 +1104,7 @@ async function chown(path, uid, gid) {
return await PromisePrototypeThen(
binding.chown(pathModule.toNamespacedPath(path), uid, gid, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -1116,7 +1116,7 @@ async function utimes(path, atime, mtime) {
toUnixTimestamp(mtime),
kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -1126,7 +1126,7 @@ async function futimes(handle, atime, mtime) {
return await PromisePrototypeThen(
binding.futimes(handle.fd, atime, mtime, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -1138,7 +1138,7 @@ async function lutimes(path, atime, mtime) {
toUnixTimestamp(mtime),
kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -1148,7 +1148,7 @@ async function realpath(path, options) {
return await PromisePrototypeThen(
binding.realpath(path, options.encoding, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand All @@ -1168,7 +1168,7 @@ async function mkdtemp(prefix, options) {
return await PromisePrototypeThen(
binding.mkdtemp(path, options.encoding, kUsePromises),
undefined,
handleErrorFromBinding
handleErrorFromBinding,
);
}

Expand Down