Skip to content

Commit a5e92a1

Browse files
author
mahsa shadi
committed
Preserving the options passed into filterOptions method
1 parent 14615e5 commit a5e92a1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

__tests__/vfs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ describe('VFS', () => {
7979
.toBeInstanceOf(ArrayBuffer);
8080
});
8181

82-
test('writefile - blob', () => {
82+
test('#writefile - blob', () => {
8383
return expect(call('writefile', 'null:/filename', new Blob()))
8484
.resolves
8585
.toBe(-1);

src/vfs.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ const handleDirectoryList = (path, options) => result =>
7575
}));
7676

7777
// Returns a new "options" object without properties from "ignore"
78-
const filterOptions = (ignore, options) => {
79-
ignore.forEach(item => delete options[item]);
80-
return options;
81-
};
78+
const filterOptions = (ignore, options) => Object.fromEntries(
79+
Object
80+
.entries(options)
81+
.filter(([k]) => !ignore.includes(k))
82+
);
8283

8384
/**
8485
* Read a directory

0 commit comments

Comments
 (0)