diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-07-04 00:17:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-04 00:17:52 +0200 |
commit | 5addba2abc2e384e751e8884b4ac3219688c2473 (patch) | |
tree | a5249a82092909f32a852a910e5e144ddeffa497 /runtime/js/40_files.js | |
parent | ffa75be48044255ed49a822a7a61a2a130123a4a (diff) |
refactor: use primordials in runtime/, part2 (#11248)
Diffstat (limited to 'runtime/js/40_files.js')
-rw-r--r-- | runtime/js/40_files.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/runtime/js/40_files.js b/runtime/js/40_files.js index 82cf19ffc..dfd471750 100644 --- a/runtime/js/40_files.js +++ b/runtime/js/40_files.js @@ -6,6 +6,11 @@ const { read, readSync, write, writeSync } = window.__bootstrap.io; const { ftruncate, ftruncateSync, fstat, fstatSync } = window.__bootstrap.fs; const { pathFromURL } = window.__bootstrap.util; + const { + Error, + ObjectValues, + ArrayPrototypeFilter, + } = window.__bootstrap.primordials; function seekSync( rid, @@ -193,7 +198,12 @@ const stderr = new Stderr(); function checkOpenOptions(options) { - if (Object.values(options).filter((val) => val === true).length === 0) { + if ( + ArrayPrototypeFilter( + ObjectValues(options), + (val) => val === true, + ).length === 0 + ) { throw new Error("OpenOptions requires at least one option to be true"); } |