@@ -40,7 +40,7 @@ MemoryFileSystem.prototype.statSync = function(_path) {
40
40
var current = this . data ;
41
41
for ( var i = 0 ; i < path . length - 1 ; i ++ ) {
42
42
if ( ! isDir ( current [ path [ i ] ] ) )
43
- throw new Error ( "Path doesn't exists " + _path ) ;
43
+ throw new Error ( "Path doesn't exist " + _path ) ;
44
44
current = current [ path [ i ] ] ;
45
45
}
46
46
if ( _path === "/" || isDir ( current [ path [ i ] ] ) ) {
@@ -64,22 +64,22 @@ MemoryFileSystem.prototype.statSync = function(_path) {
64
64
isSocket : falseFn
65
65
} ;
66
66
} else
67
- throw new Error ( "Path doesn't exists " + _path ) ;
67
+ throw new Error ( "Path doesn't exist " + _path ) ;
68
68
} ;
69
69
70
70
MemoryFileSystem . prototype . readFileSync = function ( _path , encoding ) {
71
71
var path = pathToArray ( _path ) ;
72
72
var current = this . data ;
73
73
for ( var i = 0 ; i < path . length - 1 ; i ++ ) {
74
74
if ( ! isDir ( current [ path [ i ] ] ) )
75
- throw new Error ( "Path doesn't exists " + _path ) ;
75
+ throw new Error ( "Path doesn't exist " + _path ) ;
76
76
current = current [ path [ i ] ] ;
77
77
}
78
78
if ( ! isFile ( current [ path [ i ] ] ) ) {
79
79
if ( isDir ( current [ path [ i ] ] ) )
80
80
throw new Error ( "Cannot readFile on directory " + _path ) ;
81
81
else
82
- throw new Error ( "File doesn't exists " + _path ) ;
82
+ throw new Error ( "File doesn't exist " + _path ) ;
83
83
}
84
84
current = current [ path [ i ] ] ;
85
85
return encoding ? current . toString ( encoding ) : current ;
@@ -91,14 +91,14 @@ MemoryFileSystem.prototype.readdirSync = function(_path) {
91
91
var current = this . data ;
92
92
for ( var i = 0 ; i < path . length - 1 ; i ++ ) {
93
93
if ( ! isDir ( current [ path [ i ] ] ) )
94
- throw new Error ( "Path doesn't exists " + _path ) ;
94
+ throw new Error ( "Path doesn't exist " + _path ) ;
95
95
current = current [ path [ i ] ] ;
96
96
}
97
97
if ( ! isDir ( current [ path [ i ] ] ) ) {
98
98
if ( isFile ( current [ path [ i ] ] ) )
99
99
throw new Error ( "Cannot readdir on file " + _path ) ;
100
100
else
101
- throw new Error ( "File doesn't exists " + _path ) ;
101
+ throw new Error ( "File doesn't exist " + _path ) ;
102
102
}
103
103
return Object . keys ( current [ path [ i ] ] ) . filter ( Boolean ) ;
104
104
} ;
@@ -123,7 +123,7 @@ MemoryFileSystem.prototype.mkdirSync = function(_path) {
123
123
var current = this . data ;
124
124
for ( var i = 0 ; i < path . length - 1 ; i ++ ) {
125
125
if ( ! isDir ( current [ path [ i ] ] ) )
126
- throw new Error ( "Path doesn't exists " + _path ) ;
126
+ throw new Error ( "Path doesn't exist " + _path ) ;
127
127
current = current [ path [ i ] ] ;
128
128
}
129
129
if ( isDir ( current [ path [ i ] ] ) )
@@ -140,7 +140,7 @@ MemoryFileSystem.prototype._remove = function(_path, name, testFn) {
140
140
var current = this . data ;
141
141
for ( var i = 0 ; i < path . length - 1 ; i ++ ) {
142
142
if ( ! isDir ( current [ path [ i ] ] ) )
143
- throw new Error ( "Path doesn't exists " + _path ) ;
143
+ throw new Error ( "Path doesn't exist " + _path ) ;
144
144
current = current [ path [ i ] ] ;
145
145
}
146
146
if ( ! testFn ( current [ path [ i ] ] ) )
@@ -164,7 +164,7 @@ MemoryFileSystem.prototype.writeFileSync = function(_path, content, encoding) {
164
164
var current = this . data ;
165
165
for ( var i = 0 ; i < path . length - 1 ; i ++ ) {
166
166
if ( ! isDir ( current [ path [ i ] ] ) )
167
- throw new Error ( "Path doesn't exists " + _path ) ;
167
+ throw new Error ( "Path doesn't exist " + _path ) ;
168
168
current = current [ path [ i ] ] ;
169
169
}
170
170
if ( isDir ( current [ path [ i ] ] ) )
0 commit comments