UNPKG
@forabi/memfs
Version:
latest (2.7.2)
2.7.2
In-memory file-system with Node's fs API.
github.com/streamich/memfs
streamich/memfs
@forabi/memfs
/
src
/
__tests__
/
util.ts
12 lines
(8 loc)
•
268 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import
{createFsFromVolume,
Volume
}
from
'..'
;
export
const
create
= (
json
: {[s:
string
]:
string
} = {
'/foo'
:
'bar'
}
) => {
const
vol =
Volume
.
fromJSON
(json);
return
vol; };
export
const
createFs
= (
json?
) => {
return
createFsFromVolume
(
create
(json)); };