Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit c2b2ee7

Browse files
Change signature for exists to match node spec.
1 parent 8d0f163 commit c2b2ee7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/MemoryFileSystem.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ MemoryFileSystem.prototype.normalize = normalize;
196196

197197
// async functions
198198

199-
["exists", "stat", "readdir", "mkdirp", "mkdir", "rmdir", "unlink", "readlink"].forEach(function(fn) {
199+
["stat", "readdir", "mkdirp", "mkdir", "rmdir", "unlink", "readlink"].forEach(function(fn) {
200200
MemoryFileSystem.prototype[fn] = function(path, callback) {
201201
try {
202202
var result = this[fn + "Sync"](path);
@@ -207,6 +207,10 @@ MemoryFileSystem.prototype.normalize = normalize;
207207
};
208208
});
209209

210+
MemoryFileSystem.prototype.exists = function(path, callback) {
211+
return callback(this.existsSync(path));
212+
}
213+
210214
MemoryFileSystem.prototype.readFile = function(path, optArg, callback) {
211215
if(!callback) {
212216
callback = optArg;

0 commit comments

Comments
 (0)