fs: move type checking for multiple fs methods to js
Update errors to use internal/errors, move type checking
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
fs