aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/node/dir_iterator.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-07-11 19:14:34 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-11 19:14:34 -0700
commitcbb88672f217a90db1aa1eb29cd92d5d9035b22b (patch)
tree43a00501f3cde495967e116f0b660777051551f8 /src/bun.js/node/dir_iterator.zig
parent1f900cff453700b19bca2acadfe26da4468c1282 (diff)
parent34b0e7a2bbd8bf8097341cdb0075d0908283e834 (diff)
downloadbun-cbb88672f217a90db1aa1eb29cd92d5d9035b22b.tar.gz
bun-cbb88672f217a90db1aa1eb29cd92d5d9035b22b.tar.zst
bun-cbb88672f217a90db1aa1eb29cd92d5d9035b22b.zip
Merge branch 'main' into jarred/esm-conditionsjarred/esm-conditions
Diffstat (limited to 'src/bun.js/node/dir_iterator.zig')
-rw-r--r--src/bun.js/node/dir_iterator.zig54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/bun.js/node/dir_iterator.zig b/src/bun.js/node/dir_iterator.zig
index aa939679c..dac78e5e2 100644
--- a/src/bun.js/node/dir_iterator.zig
+++ b/src/bun.js/node/dir_iterator.zig
@@ -78,15 +78,15 @@ pub const Iterator = switch (builtin.os.tag) {
}
const entry_kind = switch (darwin_entry.d_type) {
- os.DT.BLK => Entry.Kind.BlockDevice,
- os.DT.CHR => Entry.Kind.CharacterDevice,
- os.DT.DIR => Entry.Kind.Directory,
- os.DT.FIFO => Entry.Kind.NamedPipe,
- os.DT.LNK => Entry.Kind.SymLink,
- os.DT.REG => Entry.Kind.File,
- os.DT.SOCK => Entry.Kind.UnixDomainSocket,
- os.DT.WHT => Entry.Kind.Whiteout,
- else => Entry.Kind.Unknown,
+ os.DT.BLK => Entry.Kind.block_device,
+ os.DT.CHR => Entry.Kind.character_device,
+ os.DT.DIR => Entry.Kind.directory,
+ os.DT.FIFO => Entry.Kind.named_pipe,
+ os.DT.LNK => Entry.Kind.sym_link,
+ os.DT.REG => Entry.Kind.file,
+ os.DT.SOCK => Entry.Kind.unix_domain_socket,
+ os.DT.WHT => Entry.Kind.whiteout,
+ else => Entry.Kind.unknown,
};
return .{
.result = IteratorResult{
@@ -134,14 +134,14 @@ pub const Iterator = switch (builtin.os.tag) {
}
const entry_kind = switch (linux_entry.d_type) {
- linux.DT.BLK => Entry.Kind.BlockDevice,
- linux.DT.CHR => Entry.Kind.CharacterDevice,
- linux.DT.DIR => Entry.Kind.Directory,
- linux.DT.FIFO => Entry.Kind.NamedPipe,
- linux.DT.LNK => Entry.Kind.SymLink,
- linux.DT.REG => Entry.Kind.File,
- linux.DT.SOCK => Entry.Kind.UnixDomainSocket,
- else => Entry.Kind.Unknown,
+ linux.DT.BLK => Entry.Kind.block_device,
+ linux.DT.CHR => Entry.Kind.character_device,
+ linux.DT.DIR => Entry.Kind.directory,
+ linux.DT.FIFO => Entry.Kind.named_pipe,
+ linux.DT.LNK => Entry.Kind.sym_link,
+ linux.DT.REG => Entry.Kind.file,
+ linux.DT.SOCK => Entry.Kind.unix_domain_socket,
+ else => Entry.Kind.unknown,
};
return .{
.result = IteratorResult{
@@ -213,9 +213,9 @@ pub const Iterator = switch (builtin.os.tag) {
const name_utf8 = self.name_data[0..name_utf8_len];
const kind = blk: {
const attrs = dir_info.FileAttributes;
- if (attrs & w.FILE_ATTRIBUTE_DIRECTORY != 0) break :blk Entry.Kind.Directory;
- if (attrs & w.FILE_ATTRIBUTE_REPARSE_POINT != 0) break :blk Entry.Kind.SymLink;
- break :blk Entry.Kind.File;
+ if (attrs & w.FILE_ATTRIBUTE_DIRECTORY != 0) break :blk Entry.Kind.directory;
+ if (attrs & w.FILE_ATTRIBUTE_REPARSE_POINT != 0) break :blk Entry.Kind.sym_link;
+ break :blk Entry.Kind.file;
};
return .{
.result = IteratorResult{
@@ -275,13 +275,13 @@ pub const Iterator = switch (builtin.os.tag) {
}
const entry_kind = switch (entry.d_type) {
- .BLOCK_DEVICE => Entry.Kind.BlockDevice,
- .CHARACTER_DEVICE => Entry.Kind.CharacterDevice,
- .DIRECTORY => Entry.Kind.Directory,
- .SYMBOLIC_LINK => Entry.Kind.SymLink,
- .REGULAR_FILE => Entry.Kind.File,
- .SOCKET_STREAM, .SOCKET_DGRAM => Entry.Kind.UnixDomainSocket,
- else => Entry.Kind.Unknown,
+ .BLOCK_DEVICE => Entry.Kind.block_device,
+ .CHARACTER_DEVICE => Entry.Kind.character_device,
+ .DIRECTORY => Entry.Kind.directory,
+ .SYMBOLIC_LINK => Entry.Kind.sym_link,
+ .REGULAR_FILE => Entry.Kind.file,
+ .SOCKET_STREAM, .SOCKET_DGRAM => Entry.Kind.unix_domain_socket,
+ else => Entry.Kind.unknown,
};
return IteratorResult{
.name = name,