Prelude.readDirectory

This commit is contained in:
2021-11-27 13:13:08 -07:00
parent 1dddc5de65
commit d122106a14
2 changed files with 9 additions and 0 deletions

View File

@@ -110,6 +110,7 @@ class Kiss {
"zipDrop" => Symbol("Prelude.zipDrop"), "zipDrop" => Symbol("Prelude.zipDrop"),
"zipThrow" => Symbol("Prelude.zipThrow"), "zipThrow" => Symbol("Prelude.zipThrow"),
"joinPath" => Symbol("Prelude.joinPath"), "joinPath" => Symbol("Prelude.joinPath"),
"readDirectory" => Symbol("Prelude.readDirectory"),
], ],
fieldList: [], fieldList: [],
fieldDict: new Map(), fieldDict: new Map(),

View File

@@ -622,6 +622,14 @@ class Prelude {
return Lambda.filter(l, p); return Lambda.filter(l, p);
} }
#if (sys || hxnodejs)
public static function readDirectory(dir:String) {
return [for (file in FileSystem.readDirectory(dir)) {
joinPath(dir, file);
}];
}
#end
public static var newLine = "\n"; public static var newLine = "\n";
public static var backSlash = "\\"; public static var backSlash = "\\";
} }