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

Commit 5521797

Browse files
committed
Better grammar
1 parent 43e8a38 commit 5521797

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/MemoryFileSystem.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ MemoryFileSystem.prototype.statSync = function(_path) {
4040
var current = this.data;
4141
for(var i = 0; i < path.length - 1; i++) {
4242
if(!isDir(current[path[i]]))
43-
throw new Error("Path doesn't exists " + _path);
43+
throw new Error("Path doesn't exist " + _path);
4444
current = current[path[i]];
4545
}
4646
if(_path === "/" || isDir(current[path[i]])) {
@@ -64,22 +64,22 @@ MemoryFileSystem.prototype.statSync = function(_path) {
6464
isSocket: falseFn
6565
};
6666
} else
67-
throw new Error("Path doesn't exists " + _path);
67+
throw new Error("Path doesn't exist " + _path);
6868
};
6969

7070
MemoryFileSystem.prototype.readFileSync = function(_path, encoding) {
7171
var path = pathToArray(_path);
7272
var current = this.data;
7373
for(var i = 0; i < path.length - 1; i++) {
7474
if(!isDir(current[path[i]]))
75-
throw new Error("Path doesn't exists " + _path);
75+
throw new Error("Path doesn't exist " + _path);
7676
current = current[path[i]];
7777
}
7878
if(!isFile(current[path[i]])) {
7979
if(isDir(current[path[i]]))
8080
throw new Error("Cannot readFile on directory " + _path);
8181
else
82-
throw new Error("File doesn't exists " + _path);
82+
throw new Error("File doesn't exist " + _path);
8383
}
8484
current = current[path[i]];
8585
return encoding ? current.toString(encoding) : current;
@@ -91,14 +91,14 @@ MemoryFileSystem.prototype.readdirSync = function(_path) {
9191
var current = this.data;
9292
for(var i = 0; i < path.length - 1; i++) {
9393
if(!isDir(current[path[i]]))
94-
throw new Error("Path doesn't exists " + _path);
94+
throw new Error("Path doesn't exist " + _path);
9595
current = current[path[i]];
9696
}
9797
if(!isDir(current[path[i]])) {
9898
if(isFile(current[path[i]]))
9999
throw new Error("Cannot readdir on file " + _path);
100100
else
101-
throw new Error("File doesn't exists " + _path);
101+
throw new Error("File doesn't exist " + _path);
102102
}
103103
return Object.keys(current[path[i]]).filter(Boolean);
104104
};
@@ -123,7 +123,7 @@ MemoryFileSystem.prototype.mkdirSync = function(_path) {
123123
var current = this.data;
124124
for(var i = 0; i < path.length - 1; i++) {
125125
if(!isDir(current[path[i]]))
126-
throw new Error("Path doesn't exists " + _path);
126+
throw new Error("Path doesn't exist " + _path);
127127
current = current[path[i]];
128128
}
129129
if(isDir(current[path[i]]))
@@ -140,7 +140,7 @@ MemoryFileSystem.prototype._remove = function(_path, name, testFn) {
140140
var current = this.data;
141141
for(var i = 0; i < path.length - 1; i++) {
142142
if(!isDir(current[path[i]]))
143-
throw new Error("Path doesn't exists " + _path);
143+
throw new Error("Path doesn't exist " + _path);
144144
current = current[path[i]];
145145
}
146146
if(!testFn(current[path[i]]))
@@ -164,7 +164,7 @@ MemoryFileSystem.prototype.writeFileSync = function(_path, content, encoding) {
164164
var current = this.data;
165165
for(var i = 0; i < path.length - 1; i++) {
166166
if(!isDir(current[path[i]]))
167-
throw new Error("Path doesn't exists " + _path);
167+
throw new Error("Path doesn't exist " + _path);
168168
current = current[path[i]];
169169
}
170170
if(isDir(current[path[i]]))

0 commit comments

Comments
 (0)